]> Cypherpunks repositories - gostls13.git/commit
runtime: move entry method from _func to funcInfo
authorJosh Bleecher Snyder <josharian@gmail.com>
Tue, 21 Sep 2021 21:22:51 +0000 (14:22 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Mon, 27 Sep 2021 20:59:03 +0000 (20:59 +0000)
commitf0c79caa1398b6a840ec9406eb34b46a125ecb82
tree3de59275a0da2ef040404223bea11ae1e509d424
parent61a0a701135e38c48131ea18925dc5b027cc3a3c
runtime: move entry method from _func to funcInfo

This will be required when we change from storing entry PCs in _func
to entry PC offsets, which are relative to the containing module.

Notably, almost all uses of the entry method were already called
on a funcInfo. Only Func.Entry incurs the additional module
lookup cost.

This makes Entry considerably slower, but it is probably
still fast enough in absolute terms that it is OK.

name             old time/op  new time/op  delta
Func/Name-8      8.86ns ± 0%  8.33ns ± 2%    -5.92%  (p=0.000 n=12+13)
Func/Entry-8     0.64ns ± 0%  2.62ns ±36%  +310.07%  (p=0.000 n=14+15)
Func/FileLine-8  24.5ns ± 0%  25.0ns ± 4%    +2.21%  (p=0.015 n=14+13)

Change-Id: Ia2d5de5f2f83fab334f1875452b9e8e87651d340
Reviewed-on: https://go-review.googlesource.com/c/go/+/351461
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/cmd/compile/internal/test/inl_test.go
src/runtime/symtab.go