• 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
..
5g Loading commit data...
5l Loading commit data...
6g Loading commit data...
6l Loading commit data...
7g Loading commit data...
7l Loading commit data...
8g Loading commit data...
8l Loading commit data...
9g Loading commit data...
9l Loading commit data...
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
cgo Loading commit data...
dist Loading commit data...
fix Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
old5a Loading commit data...
old6a Loading commit data...
old8a Loading commit data...
old9a Loading commit data...
pack Loading commit data...
pprof Loading commit data...
trace Loading commit data...
yacc Loading commit data...