]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: inline convI2E
authorKeith Randall <khr@golang.org>
Mon, 17 Oct 2016 06:40:12 +0000 (23:40 -0700)
committerKeith Randall <khr@golang.org>
Mon, 17 Oct 2016 19:09:07 +0000 (19:09 +0000)
commit395d36a67df8d25b35617ec8709f0164ae2f655e
tree4d47d8877fd3e63e41ecb5397a5358f963629905
parentd5bd797ee55d36b07b388d0b8ca2393dc186bea1
cmd/compile: inline convI2E

It's pretty simple.  For:
  e = (interface{})(i)
Do:
  tmp = i.itab
  if tmp != nil {
    tmp = tmp.typ_ // load type from itab
  }
  e = eface{tmp, i.data}

It is smaller and faster than calling the runtime.

Change-Id: I0ad27f62f4ec0b6cd53bc8530e4da0eae3e67a6c
Reviewed-on: https://go-review.googlesource.com/31260
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/builtin.go
src/cmd/compile/internal/gc/builtin/runtime.go
src/cmd/compile/internal/gc/walk.go
src/runtime/iface.go