Skip to content

Commit c620abf

Browse files
patch 2
1 parent b5a512b commit c620abf

File tree

2 files changed

+14
-18
lines changed

2 files changed

+14
-18
lines changed

src/cmd/compile/internal/ssagen/ssa.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7095,30 +7095,13 @@ func EmitArgInfo(f *ir.Func, abiInfo *abi.ABIParamResultInfo) *obj.LSym {
70957095
return t.IsStruct() || t.IsArray() || t.IsComplex() || t.IsInterface() || t.IsString() || t.IsSlice()
70967096
}
70977097

7098-
// Populate the data.
7099-
// The data is a stream of bytes, which contains the offsets and sizes of the
7100-
// non-aggregate arguments or non-aggregate fields/elements of aggregate-typed
7101-
// arguments, along with special "operators". Specifically,
7102-
// - for each non-aggrgate arg/field/element, its offset from FP (1 byte) and
7103-
// size (1 byte)
7104-
// - special operators:
7105-
// - 0xff - end of sequence
7106-
// - 0xfe - print { (at the start of an aggregate-typed argument)
7107-
// - 0xfd - print } (at the end of an aggregate-typed argument)
7108-
// - 0xfc - print ... (more args/fields/elements)
7109-
// - 0xfb - print _ (offset too large)
7110-
// These constants need to be in sync with runtime.traceback.go:printArgs.
7111-
const (
7112-
_special = 0xf0 // above this are operators, below this are ordinary offsets
7113-
)
7114-
71157098
wOff := 0
71167099
n := 0
71177100
writebyte := func(o uint8) { wOff = objw.Uint8(x, wOff, o) }
71187101

71197102
// Write one non-aggregate arg/field/element.
71207103
write1 := func(sz, offset int64) {
7121-
if offset >= _special {
7104+
if offset >= rtabi.TraceArgsSpecial {
71227105
writebyte(rtabi.TraceArgsOffsetTooLarge)
71237106
} else {
71247107
writebyte(uint8(offset))

src/internal/abi/type.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,10 +723,23 @@ const (
723723
TraceArgsMaxLen = (TraceArgsMaxDepth*3+2)*TraceArgsLimit + 1
724724
)
725725

726+
// Populate the data.
727+
// The data is a stream of bytes, which contains the offsets and sizes of the
728+
// non-aggregate arguments or non-aggregate fields/elements of aggregate-typed
729+
// arguments, along with special "operators". Specifically,
730+
// - for each non-aggrgate arg/field/element, its offset from FP (1 byte) and
731+
// size (1 byte)
732+
// - special operators:
733+
// - 0xff - end of sequence
734+
// - 0xfe - print { (at the start of an aggregate-typed argument)
735+
// - 0xfd - print } (at the end of an aggregate-typed argument)
736+
// - 0xfc - print ... (more args/fields/elements)
737+
// - 0xfb - print _ (offset too large)
726738
const (
727739
TraceArgsEndSeq = 0xff
728740
TraceArgsStartAgg = 0xfe
729741
TraceArgsEndAgg = 0xfd
730742
TraceArgsDotdotdot = 0xfc
731743
TraceArgsOffsetTooLarge = 0xfb
744+
TraceArgsSpecial = 0xf0 // above this are operators, below this are ordinary offsets
732745
)

0 commit comments

Comments
 (0)