diff options
author | David Chase <drchase@google.com> | 2021-03-12 13:37:24 -0500 |
---|---|---|
committer | David Chase <drchase@google.com> | 2021-03-22 18:42:15 +0000 |
commit | 196c33e92d86eb21fe1cb7d244ea61209b4a554e (patch) | |
tree | 4e45e3c3de287b7e46f63822c3ec55f258be2473 /src/cmd/compile/internal/objw | |
parent | ba6b8e75ed16b3e9ecb305399e5ec2e29778e299 (diff) | |
download | go-196c33e92d86eb21fe1cb7d244ea61209b4a554e.tar.gz go-196c33e92d86eb21fe1cb7d244ea61209b4a554e.zip |
cmd/compile: fix WriteFuncMap for new ABI.
replaced old type-based logic with new abi-based logic;
earlier versions of this CL compared them for equality.
For not-in-a-register, they match everywhere tested.
also modified GetFrameOffset to make it more like the one it replaces;
the LocalsOffset is subtracted.
Change-Id: I65ce7f0646c493c277df6b6f46e4839a0d886ac9
Reviewed-on: https://go-review.googlesource.com/c/go/+/302072
Trust: David Chase <drchase@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Diffstat (limited to 'src/cmd/compile/internal/objw')
-rw-r--r-- | src/cmd/compile/internal/objw/objw.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/objw/objw.go b/src/cmd/compile/internal/objw/objw.go index dfbcf51556..50ce7b747d 100644 --- a/src/cmd/compile/internal/objw/objw.go +++ b/src/cmd/compile/internal/objw/objw.go @@ -11,6 +11,8 @@ import ( "cmd/internal/obj" ) +// Uint8 writes an unsigned byte v into s at offset off, +// and returns the next unused offset (i.e., off+1). func Uint8(s *obj.LSym, off int, v uint8) int { return UintN(s, off, uint64(v), 1) } @@ -27,6 +29,8 @@ func Uintptr(s *obj.LSym, off int, v uint64) int { return UintN(s, off, v, types.PtrSize) } +// UintN writes an unsigned integer v of size wid bytes into s at offset off, +// and returns the next unused offset. func UintN(s *obj.LSym, off int, v uint64, wid int) int { if off&(wid-1) != 0 { base.Fatalf("duintxxLSym: misaligned: v=%d wid=%d off=%d", v, wid, off) @@ -62,6 +66,8 @@ func Global(s *obj.LSym, width int32, flags int16) { base.Ctxt.Globl(s, int64(width), int(flags)) } +// Bitvec writes the contents of bv into s as sequence of bytes +// in little-endian order, and returns the next unused offset. func BitVec(s *obj.LSym, off int, bv bitvec.BitVec) int { // Runtime reads the bitmaps as byte arrays. Oblige. for j := 0; int32(j) < bv.N; j += 8 { |