mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.link] create runtime.funcnametab
Move the function names out of runtime.pclntab_old, creating runtime.funcnametab. There is an unfortunate artifact in this change in that calculating the funcID still requires loading the name. Future work will likely pull this out and put it into the object file Funcs. ls -l cmd/compile (darwin): before: 18524016 after: 18519952 The difference in size can be attributed to alignment in pclntab_old. Change-Id: Ibcbb230d4632178f8fcd0667165f5335786381f8 Reviewed-on: https://go-review.googlesource.com/c/go/+/243223 Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
3067a8dc02
commit
6ac9914383
9 changed files with 221 additions and 79 deletions
|
|
@ -311,6 +311,16 @@ func (sb *SymbolBuilder) SetAddr(arch *sys.Arch, off int64, tgt Sym) int64 {
|
|||
return sb.SetAddrPlus(arch, off, tgt, 0)
|
||||
}
|
||||
|
||||
func (sb *SymbolBuilder) AddStringAt(off int64, str string) int64 {
|
||||
strLen := int64(len(str))
|
||||
if off+strLen+1 > int64(len(sb.data)) {
|
||||
panic("attempt to write past end of buffer")
|
||||
}
|
||||
copy(sb.data[off:off+strLen], str)
|
||||
sb.data[off+strLen] = 0
|
||||
return off + strLen + 1
|
||||
}
|
||||
|
||||
func (sb *SymbolBuilder) Addstring(str string) int64 {
|
||||
if sb.kind == 0 {
|
||||
sb.kind = sym.SNOPTRDATA
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue