aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/goobj2/funcinfo.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/internal/goobj2/funcinfo.go')
-rw-r--r--src/cmd/internal/goobj2/funcinfo.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/cmd/internal/goobj2/funcinfo.go b/src/cmd/internal/goobj2/funcinfo.go
index 8620931970..053d7adc15 100644
--- a/src/cmd/internal/goobj2/funcinfo.go
+++ b/src/cmd/internal/goobj2/funcinfo.go
@@ -14,8 +14,6 @@ import (
//
// TODO: make each pcdata a separate symbol?
type FuncInfo struct {
- NoSplit uint8
-
Args uint32
Locals uint32
@@ -32,8 +30,6 @@ type FuncInfo struct {
}
func (a *FuncInfo) Write(w *bytes.Buffer) {
- w.WriteByte(a.NoSplit)
-
var b [4]byte
writeUint32 := func(x uint32) {
binary.LittleEndian.PutUint32(b[:], x)
@@ -68,9 +64,6 @@ func (a *FuncInfo) Write(w *bytes.Buffer) {
}
func (a *FuncInfo) Read(b []byte) {
- a.NoSplit = b[0]
- b = b[1:]
-
readUint32 := func() uint32 {
x := binary.LittleEndian.Uint32(b)
b = b[4:]
@@ -107,6 +100,16 @@ func (a *FuncInfo) Read(b []byte) {
}
}
+// Accessors reading only some fields.
+// TODO: more accessors.
+
+func (*FuncInfo) ReadLocals(b []byte) uint32 { return binary.LittleEndian.Uint32(b[4:]) }
+
+// return start and end offsets.
+func (*FuncInfo) ReadPcsp(b []byte) (uint32, uint32) {
+ return binary.LittleEndian.Uint32(b[8:]), binary.LittleEndian.Uint32(b[12:])
+}
+
// InlTreeNode is the serialized form of FileInfo.InlTree.
type InlTreeNode struct {
Parent int32