• Russ Cox's avatar
    cmd/internal/gc: inline x := y.(*T) and x, ok := y.(*T) · 4224d81f
    Russ Cox authored
    These can be implemented with just a compare and a move instruction.
    Do so, avoiding the overhead of a call into the runtime.
    
    These assertions are a significant cost in Go code that uses interface{}
    as a safe alternative to C's void* (or unsafe.Pointer), such as the
    current version of the Go compiler.
    
    *T here includes pointer to T but also any Go type represented as
    a single pointer (chan, func, map). It does not include [1]*T or struct{*int}.
    That requires more work in other parts of the compiler; there is a TODO.
    
    Change-Id: I7ff681c20d2c3eb6ad11dd7b3a37b1f3dda23965
    Reviewed-on: https://go-review.googlesource.com/7862Reviewed-by: 's avatarRob Pike <r@golang.org>
    4224d81f
Name
Last commit
Last update
..
embed1.dir Loading commit data...
private.dir Loading commit data...
recursive1.dir Loading commit data...
assertinline.go Loading commit data...
bigdata.go Loading commit data...
convert.go Loading commit data...
convert1.go Loading commit data...
convert2.go Loading commit data...
embed.go Loading commit data...
embed1.go Loading commit data...
embed2.go Loading commit data...
explicit.go Loading commit data...
fail.go Loading commit data...
fake.go Loading commit data...
noeq.go Loading commit data...
pointer.go Loading commit data...
private.go Loading commit data...
receiver.go Loading commit data...
receiver1.go Loading commit data...
recursive.go Loading commit data...
recursive1.go Loading commit data...
returntype.go Loading commit data...
struct.go Loading commit data...