From 69cca05981d1ca650a90955e7bb3ba24dad6a441 Mon Sep 17 00:00:00 2001 From: Masaaki Goshima Date: Tue, 1 Jun 2021 01:36:30 +0900 Subject: [PATCH] Pass RuntimeContext to the first argument of all append functions --- encode.go | 12 +- internal/cmd/generator/vm.go.tmpl | 1524 ++++++++++++++-------------- internal/encoder/encoder.go | 26 +- internal/encoder/vm/util.go | 16 +- internal/encoder/vm/vm.go | 1524 ++++++++++++++-------------- internal/encoder/vm_indent/util.go | 16 +- internal/encoder/vm_indent/vm.go | 1524 ++++++++++++++-------------- 7 files changed, 2321 insertions(+), 2321 deletions(-) diff --git a/encode.go b/encode.go index 8bb405e..16f1a12 100644 --- a/encode.go +++ b/encode.go @@ -170,8 +170,8 @@ func marshalIndent(v interface{}, prefix, indent string, optFuncs ...EncodeOptio func encode(ctx *encoder.RuntimeContext, v interface{}) ([]byte, error) { b := ctx.Buf[:0] if v == nil { - b = encoder.AppendNull(b) - b = encoder.AppendComma(b) + b = encoder.AppendNull(ctx, b) + b = encoder.AppendComma(ctx, b) return b, nil } header := (*emptyInterface)(unsafe.Pointer(&v)) @@ -198,8 +198,8 @@ func encode(ctx *encoder.RuntimeContext, v interface{}) ([]byte, error) { func encodeNoEscape(ctx *encoder.RuntimeContext, v interface{}) ([]byte, error) { b := ctx.Buf[:0] if v == nil { - b = encoder.AppendNull(b) - b = encoder.AppendComma(b) + b = encoder.AppendNull(ctx, b) + b = encoder.AppendComma(ctx, b) return b, nil } header := (*emptyInterface)(unsafe.Pointer(&v)) @@ -225,8 +225,8 @@ func encodeNoEscape(ctx *encoder.RuntimeContext, v interface{}) ([]byte, error) func encodeIndent(ctx *encoder.RuntimeContext, v interface{}, prefix, indent string) ([]byte, error) { b := ctx.Buf[:0] if v == nil { - b = encoder.AppendNull(b) - b = encoder.AppendCommaIndent(b) + b = encoder.AppendNull(ctx, b) + b = encoder.AppendCommaIndent(ctx, b) return b, nil } header := (*emptyInterface)(unsafe.Pointer(&v)) diff --git a/internal/cmd/generator/vm.go.tmpl b/internal/cmd/generator/vm.go.tmpl index 6e38c04..6c1bda1 100644 --- a/internal/cmd/generator/vm.go.tmpl +++ b/internal/cmd/generator/vm.go.tmpl @@ -31,8 +31,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpIntPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -40,13 +40,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b fallthrough case encoder.OpInt: b = appendInt(b, ptrToUint64(load(ctxptr, code.Idx)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpUintPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -54,39 +54,39 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b fallthrough case encoder.OpUint: b = appendUint(b, ptrToUint64(load(ctxptr, code.Idx)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpIntString: b = append(b, '"') b = appendInt(b, ptrToUint64(load(ctxptr, code.Idx)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpUintString: b = append(b, '"') b = appendUint(b, ptrToUint64(load(ctxptr, code.Idx)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpFloat32Ptr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpFloat32: - b = appendFloat32(b, ptrToFloat32(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(load(ctxptr, code.Idx))) + b = appendComma(ctx, b) code = code.Next case encoder.OpFloat64Ptr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -97,14 +97,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStringPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -112,58 +112,58 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b fallthrough case encoder.OpString: b = appendString(ctx, b, ptrToString(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpBoolPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpBool: - b = appendBool(b, ptrToBool(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(load(ctxptr, code.Idx))) + b = appendComma(ctx, b) code = code.Next case encoder.OpBytesPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpBytes: - b = appendByteSlice(b, ptrToBytes(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(load(ctxptr, code.Idx))) + b = appendComma(ctx, b) code = code.Next case encoder.OpNumberPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpNumber: - bb, err := appendNumber(b, ptrToNumber(load(ctxptr, code.Idx))) + bb, err := appendNumber(ctx, b, ptrToNumber(load(ctxptr, code.Idx))) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpInterfacePtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -172,8 +172,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpInterface: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -185,8 +185,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b ctx.SeenPtr = append(ctx.SeenPtr, p) iface := (*emptyInterface)(ptrToUnsafePtr(p)) if iface.ptr == nil { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -202,8 +202,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMarshalJSONPtr: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -212,8 +212,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMarshalJSON: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -224,13 +224,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpMarshalTextPtr: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -240,7 +240,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { b = append(b, `""`...) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next break } @@ -251,13 +251,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpSlicePtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -267,8 +267,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) slice := ptrToSlice(p) if p == 0 || slice.Data == nil { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -280,7 +280,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b code = code.Next store(ctxptr, code.Idx, uintptr(slice.Data)) } else { - b = appendEmptyArray(b) + b = appendEmptyArray(ctx, b) code = code.End.Next } case encoder.OpSliceElem: @@ -301,8 +301,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpArrayPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -311,8 +311,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpArray: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -322,7 +322,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b code = code.Next store(ctxptr, code.Idx, p) } else { - b = appendEmptyArray(b) + b = appendEmptyArray(ctx, b) code = code.End.Next } case encoder.OpArrayElem: @@ -342,8 +342,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMapPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -352,19 +352,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMap: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } uptr := ptrToUnsafePtr(p) mlen := maplen(uptr) if mlen <= 0 { - b = appendEmptyObject(b) + b = appendEmptyObject(ctx, b) code = code.End.Next break } - b = appendStructHead(b) + b = appendStructHead(ctx, b) iter := mapiterinit(code.Type, uptr) ctx.KeepRefs = append(ctx.KeepRefs, iter) store(ctxptr, code.ElemIdx, 0) @@ -415,7 +415,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } case encoder.OpMapValue: if ctx.Option.UnorderedMap { - b = appendColon(b) + b = appendColon(ctx, b) } else { ptr := load(ctxptr, code.End.MapPos) mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(ptr)) @@ -514,8 +514,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -526,14 +526,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags&encoder.AnonymousKeyFlags) == 0 && len(code.Key) > 0 { b = appendStructKey(ctx, code, b) @@ -545,8 +545,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -557,14 +557,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } p += uintptr(code.Offset) if p == 0 || (ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0) { @@ -579,8 +579,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -592,26 +592,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyInt: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -623,14 +623,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -639,7 +639,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendInt(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadIntString: @@ -647,8 +647,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -660,28 +660,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyIntString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -693,14 +693,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -711,15 +711,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadIntPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -730,32 +730,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendInt(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyIntPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -766,14 +766,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -781,15 +781,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadIntPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -800,34 +800,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyIntPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -838,14 +838,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -855,7 +855,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadUint: @@ -863,8 +863,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -876,26 +876,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUint: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -907,14 +907,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -923,7 +923,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendUint(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadUintString: @@ -931,8 +931,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -944,28 +944,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUintString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -977,14 +977,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -995,15 +995,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadUintPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1014,32 +1014,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendUint(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUintPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1050,14 +1050,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1065,15 +1065,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadUintPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1084,34 +1084,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUintPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1122,14 +1122,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1139,7 +1139,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat32: @@ -1147,8 +1147,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1160,26 +1160,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1191,22 +1191,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat32(p + uintptr(code.Offset)) if v == 0 { code = code.NextField } else { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, v) - b = appendComma(b) + b = appendFloat32(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat32String: @@ -1214,8 +1214,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1227,28 +1227,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32String: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1260,14 +1260,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat32(p + uintptr(code.Offset)) if v == 0 { @@ -1275,17 +1275,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat32Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1296,32 +1296,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1332,30 +1332,30 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p)) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat32PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1366,34 +1366,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1404,14 +1404,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1419,9 +1419,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat64: @@ -1429,8 +1429,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1442,8 +1442,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1453,19 +1453,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1477,14 +1477,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat64(p + uintptr(code.Offset)) if v == 0 { @@ -1494,8 +1494,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat64String: @@ -1503,8 +1503,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1516,14 +1516,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat64(p + uintptr(code.Offset)) if math.IsInf(v, 0) || math.IsNaN(v) { @@ -1531,17 +1531,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64String: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1553,14 +1553,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat64(p + uintptr(code.Offset)) if v == 0 { @@ -1571,17 +1571,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat64Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1592,36 +1592,36 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1632,14 +1632,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1650,16 +1650,16 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat64PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1670,38 +1670,38 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1712,14 +1712,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1731,9 +1731,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadString: @@ -1741,8 +1741,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1754,26 +1754,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1785,14 +1785,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToString(p + uintptr(code.Offset)) if v == "" { @@ -1800,7 +1800,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, v) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadStringString: @@ -1808,8 +1808,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1821,26 +1821,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p+uintptr(code.Offset))))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyStringString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1852,14 +1852,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToString(p + uintptr(code.Offset)) if v == "" { @@ -1867,15 +1867,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadStringPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1886,32 +1886,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, ptrToString(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyStringPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1922,14 +1922,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1937,15 +1937,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p)) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadStringPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1956,32 +1956,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyStringPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1992,14 +1992,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2007,7 +2007,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadBool: @@ -2015,8 +2015,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2028,26 +2028,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBool: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2059,20 +2059,20 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) - b = appendBool(b, v) - b = appendComma(b) + b = appendBool(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } else { code = code.NextField @@ -2082,8 +2082,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2095,28 +2095,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBoolString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2128,22 +2128,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } else { code = code.NextField @@ -2152,8 +2152,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2164,32 +2164,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBoolPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2200,30 +2200,30 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p)) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadBoolPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2234,34 +2234,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBoolPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2272,14 +2272,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2287,9 +2287,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadBytes: @@ -2297,8 +2297,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2310,26 +2310,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBytes: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2341,30 +2341,30 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToBytes(p + uintptr(code.Offset)) if len(v) == 0 { code = code.NextField } else { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, v) - b = appendComma(b) + b = appendByteSlice(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadBytesPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2375,32 +2375,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBytesPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2411,22 +2411,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p)) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadNumber: @@ -2434,8 +2434,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2447,29 +2447,29 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumber: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2481,25 +2481,25 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToNumber(p + uintptr(code.Offset)) if v == "" { code = code.NextField } else { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next } case encoder.OpStructPtrHeadNumberString: @@ -2507,8 +2507,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2520,31 +2520,31 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumberString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2556,14 +2556,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToNumber(p + uintptr(code.Offset)) if v == "" { @@ -2571,20 +2571,20 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadNumberPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2595,36 +2595,36 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumberPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2635,33 +2635,33 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructPtrHeadNumberPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2672,37 +2672,37 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumberPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2713,14 +2713,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2728,12 +2728,12 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadArray, encoder.OpStructPtrHeadSlice: @@ -2741,8 +2741,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2754,14 +2754,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) p += uintptr(code.Offset) @@ -2772,8 +2772,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2785,14 +2785,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } p += uintptr(code.Offset) b = appendStructKey(ctx, code, b) @@ -2803,8 +2803,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2816,14 +2816,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } p += uintptr(code.Offset) slice := ptrToSlice(p) @@ -2838,8 +2838,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2850,22 +2850,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.NextField } else { code = code.Next @@ -2875,8 +2875,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2887,14 +2887,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2910,8 +2910,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2922,14 +2922,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { @@ -2941,8 +2941,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2953,14 +2953,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { p = ptrToPtr(p + uintptr(code.Offset)) @@ -2976,8 +2976,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2988,26 +2988,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.NextField break } p = ptrToPtr(p + uintptr(code.Offset)) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.NextField } else { if (code.Flags & encoder.IndirectFlags) != 0 { @@ -3020,8 +3020,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3032,14 +3032,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p == 0 { code = code.NextField @@ -3060,8 +3060,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3074,14 +3074,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IsNilableTypeFlags) != 0 { @@ -3090,7 +3090,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3098,14 +3098,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalJSON: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3118,14 +3118,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IsNilableTypeFlags) != 0 { if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalJSON { @@ -3142,15 +3142,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadMarshalJSONPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3161,21 +3161,21 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3183,14 +3183,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalJSONPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3201,8 +3201,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3211,7 +3211,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p == 0 { code = code.NextField @@ -3222,15 +3222,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadMarshalText: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3243,14 +3243,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IsNilableTypeFlags) != 0 { @@ -3259,7 +3259,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3267,14 +3267,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalText: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3287,14 +3287,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IsNilableTypeFlags) != 0 { if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalText { @@ -3310,15 +3310,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadMarshalTextPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3329,21 +3329,21 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3351,14 +3351,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalTextPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3369,8 +3369,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3379,7 +3379,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p == 0 { code = code.NextField @@ -3390,7 +3390,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructField: @@ -3414,7 +3414,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyInt: p := load(ctxptr, code.Idx) @@ -3423,7 +3423,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = appendInt(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldIntString: @@ -3432,7 +3432,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyIntString: p := load(ctxptr, code.Idx) @@ -3443,7 +3443,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldIntPtr: @@ -3451,11 +3451,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendInt(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyIntPtr: p := load(ctxptr, code.Idx) @@ -3463,7 +3463,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldIntPtrString: @@ -3471,13 +3471,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyIntPtrString: p := load(ctxptr, code.Idx) @@ -3487,14 +3487,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUint: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUint: p := load(ctxptr, code.Idx) @@ -3503,7 +3503,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = appendUint(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUintString: @@ -3512,7 +3512,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUintString: p := load(ctxptr, code.Idx) @@ -3523,7 +3523,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUintPtr: @@ -3531,11 +3531,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendUint(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUintPtr: p := load(ctxptr, code.Idx) @@ -3543,7 +3543,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUintPtrString: @@ -3551,13 +3551,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUintPtrString: p := load(ctxptr, code.Idx) @@ -3567,31 +3567,31 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32: p := load(ctxptr, code.Idx) v := ptrToFloat32(p + uintptr(code.Offset)) if v != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, v) - b = appendComma(b) + b = appendFloat32(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32String: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32String: p := load(ctxptr, code.Idx) @@ -3599,9 +3599,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32Ptr: @@ -3609,19 +3609,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32Ptr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p)) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32PtrString: @@ -3629,13 +3629,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32PtrString: p := load(ctxptr, code.Idx) @@ -3643,9 +3643,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64: @@ -3655,8 +3655,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64: p := load(ctxptr, code.Idx) @@ -3666,8 +3666,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64String: @@ -3678,9 +3678,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64String: p := load(ctxptr, code.Idx) @@ -3691,9 +3691,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64Ptr: @@ -3701,8 +3701,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -3710,8 +3710,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64Ptr: p := load(ctxptr, code.Idx) @@ -3722,8 +3722,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64PtrString: @@ -3731,17 +3731,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64PtrString: p := load(ctxptr, code.Idx) @@ -3753,16 +3753,16 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldString: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyString: p := load(ctxptr, code.Idx) @@ -3770,7 +3770,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, v) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldStringString: @@ -3778,7 +3778,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b s := ptrToString(p + uintptr(code.Offset)) b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, s))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyStringString: p := load(ctxptr, code.Idx) @@ -3786,7 +3786,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldStringPtr: @@ -3794,11 +3794,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, ptrToString(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyStringPtr: p := load(ctxptr, code.Idx) @@ -3806,7 +3806,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p)) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldStringPtrString: @@ -3814,11 +3814,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyStringPtrString: p := load(ctxptr, code.Idx) @@ -3826,31 +3826,31 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBool: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBool: p := load(ctxptr, code.Idx) v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) - b = appendBool(b, v) - b = appendComma(b) + b = appendBool(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBoolString: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBoolString: p := load(ctxptr, code.Idx) @@ -3858,9 +3858,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBoolPtr: @@ -3868,19 +3868,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBoolPtr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p)) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBoolPtrString: @@ -3888,13 +3888,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBoolPtrString: p := load(ctxptr, code.Idx) @@ -3902,24 +3902,24 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBytes: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBytes: p := load(ctxptr, code.Idx) v := ptrToBytes(p + uintptr(code.Offset)) if len(v) > 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, v) - b = appendComma(b) + b = appendByteSlice(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBytesPtr: @@ -3927,52 +3927,52 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBytesPtr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p)) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldNumber: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructFieldOmitEmptyNumber: p := load(ctxptr, code.Idx) v := ptrToNumber(p + uintptr(code.Offset)) if v != "" { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldNumberString: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyNumberString: p := load(ctxptr, code.Idx) @@ -3980,12 +3980,12 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldNumberPtr: @@ -3993,26 +3993,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyNumberPtr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldNumberPtrString: @@ -4020,16 +4020,16 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyNumberPtrString: p := load(ctxptr, code.Idx) @@ -4037,12 +4037,12 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldMarshalJSON: @@ -4053,7 +4053,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToPtr(p) } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4061,7 +4061,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalJSON: p := load(ctxptr, code.Idx) @@ -4083,14 +4083,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructFieldMarshalJSONPtr: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4098,7 +4098,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalJSONPtr: p := load(ctxptr, code.Idx) @@ -4109,7 +4109,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldMarshalText: @@ -4120,7 +4120,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToPtr(p) } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4128,7 +4128,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalText: p := load(ctxptr, code.Idx) @@ -4145,14 +4145,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructFieldMarshalTextPtr: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4160,7 +4160,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalTextPtr: p := load(ctxptr, code.Idx) @@ -4171,7 +4171,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldArray: @@ -4339,7 +4339,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendInt(b, ptrToUint64(p), code) } @@ -4361,7 +4361,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) @@ -4427,7 +4427,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendUint(b, ptrToUint64(p), code) } @@ -4449,7 +4449,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) @@ -4473,7 +4473,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndFloat32: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyFloat32: @@ -4481,7 +4481,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToFloat32(p + uintptr(code.Offset)) if v != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4491,7 +4491,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = append(b, '"') b = appendStructEnd(ctx, code, b) code = code.Next @@ -4501,7 +4501,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4513,9 +4513,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) } b = appendStructEnd(ctx, code, b) code = code.Next @@ -4524,7 +4524,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4535,10 +4535,10 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') } b = appendStructEnd(ctx, code, b) @@ -4549,7 +4549,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4563,7 +4563,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyFloat64: @@ -4574,7 +4574,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4588,7 +4588,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) code = code.Next @@ -4601,7 +4601,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4613,7 +4613,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) b = appendStructEnd(ctx, code, b) code = code.Next break @@ -4622,7 +4622,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyFloat64Ptr: @@ -4634,7 +4634,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4645,14 +4645,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') } b = appendStructEnd(ctx, code, b) @@ -4667,7 +4667,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4714,7 +4714,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, ptrToString(p)) } @@ -4736,7 +4736,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) } @@ -4756,7 +4756,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndBool: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyBool: @@ -4764,7 +4764,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4774,7 +4774,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = append(b, '"') b = appendStructEnd(ctx, code, b) code = code.Next @@ -4784,7 +4784,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4796,9 +4796,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) } b = appendStructEnd(ctx, code, b) code = code.Next @@ -4807,7 +4807,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4818,10 +4818,10 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') } b = appendStructEnd(ctx, code, b) @@ -4832,7 +4832,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4842,7 +4842,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndBytes: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p+uintptr(code.Offset))) + b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyBytes: @@ -4850,7 +4850,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToBytes(p + uintptr(code.Offset)) if len(v) > 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, v) + b = appendByteSlice(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4861,9 +4861,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) } b = appendStructEnd(ctx, code, b) code = code.Next @@ -4872,7 +4872,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4881,7 +4881,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndNumber: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } @@ -4892,7 +4892,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToNumber(p + uintptr(code.Offset)) if v != "" { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } @@ -4905,7 +4905,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } @@ -4918,7 +4918,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } @@ -4933,9 +4933,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } @@ -4948,7 +4948,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } @@ -4962,10 +4962,10 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } @@ -4979,7 +4979,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } diff --git a/internal/encoder/encoder.go b/internal/encoder/encoder.go index 38445dd..0a737c9 100644 --- a/internal/encoder/encoder.go +++ b/internal/encoder/encoder.go @@ -269,7 +269,7 @@ func MapIterNext(it unsafe.Pointer) //go:noescape func MapLen(m unsafe.Pointer) int -func AppendByteSlice(b []byte, src []byte) []byte { +func AppendByteSlice(_ *RuntimeContext, b []byte, src []byte) []byte { if src == nil { return append(b, `null`...) } @@ -287,7 +287,7 @@ func AppendByteSlice(b []byte, src []byte) []byte { return append(append(b, buf...), '"') } -func AppendFloat32(b []byte, v float32) []byte { +func AppendFloat32(_ *RuntimeContext, b []byte, v float32) []byte { f64 := float64(v) abs := math.Abs(f64) fmt := byte('f') @@ -301,7 +301,7 @@ func AppendFloat32(b []byte, v float32) []byte { return strconv.AppendFloat(b, f64, fmt, -1, 32) } -func AppendFloat64(b []byte, v float64) []byte { +func AppendFloat64(_ *RuntimeContext, b []byte, v float64) []byte { abs := math.Abs(v) fmt := byte('f') // Note: Must use float32 comparisons for underlying float32 value to get precise cutoffs right. @@ -313,7 +313,7 @@ func AppendFloat64(b []byte, v float64) []byte { return strconv.AppendFloat(b, v, fmt, -1, 64) } -func AppendBool(b []byte, v bool) []byte { +func AppendBool(_ *RuntimeContext, b []byte, v bool) []byte { if v { return append(b, "true"...) } @@ -340,7 +340,7 @@ var ( } ) -func AppendNumber(b []byte, n json.Number) ([]byte, error) { +func AppendNumber(_ *RuntimeContext, b []byte, n json.Number) ([]byte, error) { if len(n) == 0 { return append(b, '0'), nil } @@ -367,7 +367,7 @@ func AppendMarshalJSON(ctx *RuntimeContext, code *Opcode, b []byte, v interface{ v = rv.Interface() marshaler, ok := v.(json.Marshaler) if !ok { - return AppendNull(b), nil + return AppendNull(ctx, b), nil } bb, err := marshaler.MarshalJSON() if err != nil { @@ -397,7 +397,7 @@ func AppendMarshalJSONIndent(ctx *RuntimeContext, code *Opcode, b []byte, v inte v = rv.Interface() marshaler, ok := v.(json.Marshaler) if !ok { - return AppendNull(b), nil + return AppendNull(ctx, b), nil } bb, err := marshaler.MarshalJSON() if err != nil { @@ -433,7 +433,7 @@ func AppendMarshalText(ctx *RuntimeContext, code *Opcode, b []byte, v interface{ v = rv.Interface() marshaler, ok := v.(encoding.TextMarshaler) if !ok { - return AppendNull(b), nil + return AppendNull(ctx, b), nil } bytes, err := marshaler.MarshalText() if err != nil { @@ -456,7 +456,7 @@ func AppendMarshalTextIndent(ctx *RuntimeContext, code *Opcode, b []byte, v inte v = rv.Interface() marshaler, ok := v.(encoding.TextMarshaler) if !ok { - return AppendNull(b), nil + return AppendNull(ctx, b), nil } bytes, err := marshaler.MarshalText() if err != nil { @@ -465,19 +465,19 @@ func AppendMarshalTextIndent(ctx *RuntimeContext, code *Opcode, b []byte, v inte return AppendString(ctx, b, *(*string)(unsafe.Pointer(&bytes))), nil } -func AppendNull(b []byte) []byte { +func AppendNull(_ *RuntimeContext, b []byte) []byte { return append(b, "null"...) } -func AppendComma(b []byte) []byte { +func AppendComma(_ *RuntimeContext, b []byte) []byte { return append(b, ',') } -func AppendCommaIndent(b []byte) []byte { +func AppendCommaIndent(_ *RuntimeContext, b []byte) []byte { return append(b, ',', '\n') } -func AppendStructEnd(b []byte) []byte { +func AppendStructEnd(_ *RuntimeContext, b []byte) []byte { return append(b, '}', ',') } diff --git a/internal/encoder/vm/util.go b/internal/encoder/vm/util.go index bbe6e04..7e358e2 100644 --- a/internal/encoder/vm/util.go +++ b/internal/encoder/vm/util.go @@ -90,22 +90,22 @@ func ptrToInterface(code *encoder.Opcode, p uintptr) interface{} { })) } -func appendBool(b []byte, v bool) []byte { +func appendBool(_ *encoder.RuntimeContext, b []byte, v bool) []byte { if v { return append(b, "true"...) } return append(b, "false"...) } -func appendNull(b []byte) []byte { +func appendNull(_ *encoder.RuntimeContext, b []byte) []byte { return append(b, "null"...) } -func appendComma(b []byte) []byte { +func appendComma(_ *encoder.RuntimeContext, b []byte) []byte { return append(b, ',') } -func appendColon(b []byte) []byte { +func appendColon(_ *encoder.RuntimeContext, b []byte) []byte { last := len(b) - 1 b[last] = ':' return b @@ -174,11 +174,11 @@ func appendArrayEnd(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []by return append(b, ',') } -func appendEmptyArray(b []byte) []byte { +func appendEmptyArray(_ *encoder.RuntimeContext, b []byte) []byte { return append(b, '[', ']', ',') } -func appendEmptyObject(b []byte) []byte { +func appendEmptyObject(_ *encoder.RuntimeContext, b []byte) []byte { return append(b, '{', '}', ',') } @@ -188,7 +188,7 @@ func appendObjectEnd(_ *encoder.RuntimeContext, _ *encoder.Opcode, b []byte) []b return append(b, ',') } -func appendStructHead(b []byte) []byte { +func appendStructHead(_ *encoder.RuntimeContext, b []byte) []byte { return append(b, '{') } @@ -204,7 +204,7 @@ func appendStructEndSkipLast(ctx *encoder.RuntimeContext, code *encoder.Opcode, last := len(b) - 1 if b[last] == ',' { b[last] = '}' - return appendComma(b) + return appendComma(ctx, b) } return appendStructEnd(ctx, code, b) } diff --git a/internal/encoder/vm/vm.go b/internal/encoder/vm/vm.go index 6e38c04..6c1bda1 100644 --- a/internal/encoder/vm/vm.go +++ b/internal/encoder/vm/vm.go @@ -31,8 +31,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpIntPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -40,13 +40,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b fallthrough case encoder.OpInt: b = appendInt(b, ptrToUint64(load(ctxptr, code.Idx)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpUintPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -54,39 +54,39 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b fallthrough case encoder.OpUint: b = appendUint(b, ptrToUint64(load(ctxptr, code.Idx)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpIntString: b = append(b, '"') b = appendInt(b, ptrToUint64(load(ctxptr, code.Idx)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpUintString: b = append(b, '"') b = appendUint(b, ptrToUint64(load(ctxptr, code.Idx)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpFloat32Ptr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpFloat32: - b = appendFloat32(b, ptrToFloat32(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(load(ctxptr, code.Idx))) + b = appendComma(ctx, b) code = code.Next case encoder.OpFloat64Ptr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -97,14 +97,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStringPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -112,58 +112,58 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b fallthrough case encoder.OpString: b = appendString(ctx, b, ptrToString(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpBoolPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpBool: - b = appendBool(b, ptrToBool(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(load(ctxptr, code.Idx))) + b = appendComma(ctx, b) code = code.Next case encoder.OpBytesPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpBytes: - b = appendByteSlice(b, ptrToBytes(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(load(ctxptr, code.Idx))) + b = appendComma(ctx, b) code = code.Next case encoder.OpNumberPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpNumber: - bb, err := appendNumber(b, ptrToNumber(load(ctxptr, code.Idx))) + bb, err := appendNumber(ctx, b, ptrToNumber(load(ctxptr, code.Idx))) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpInterfacePtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -172,8 +172,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpInterface: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -185,8 +185,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b ctx.SeenPtr = append(ctx.SeenPtr, p) iface := (*emptyInterface)(ptrToUnsafePtr(p)) if iface.ptr == nil { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -202,8 +202,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMarshalJSONPtr: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -212,8 +212,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMarshalJSON: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -224,13 +224,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpMarshalTextPtr: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -240,7 +240,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { b = append(b, `""`...) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next break } @@ -251,13 +251,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpSlicePtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -267,8 +267,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) slice := ptrToSlice(p) if p == 0 || slice.Data == nil { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -280,7 +280,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b code = code.Next store(ctxptr, code.Idx, uintptr(slice.Data)) } else { - b = appendEmptyArray(b) + b = appendEmptyArray(ctx, b) code = code.End.Next } case encoder.OpSliceElem: @@ -301,8 +301,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpArrayPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -311,8 +311,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpArray: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -322,7 +322,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b code = code.Next store(ctxptr, code.Idx, p) } else { - b = appendEmptyArray(b) + b = appendEmptyArray(ctx, b) code = code.End.Next } case encoder.OpArrayElem: @@ -342,8 +342,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMapPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -352,19 +352,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMap: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } uptr := ptrToUnsafePtr(p) mlen := maplen(uptr) if mlen <= 0 { - b = appendEmptyObject(b) + b = appendEmptyObject(ctx, b) code = code.End.Next break } - b = appendStructHead(b) + b = appendStructHead(ctx, b) iter := mapiterinit(code.Type, uptr) ctx.KeepRefs = append(ctx.KeepRefs, iter) store(ctxptr, code.ElemIdx, 0) @@ -415,7 +415,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } case encoder.OpMapValue: if ctx.Option.UnorderedMap { - b = appendColon(b) + b = appendColon(ctx, b) } else { ptr := load(ctxptr, code.End.MapPos) mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(ptr)) @@ -514,8 +514,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -526,14 +526,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags&encoder.AnonymousKeyFlags) == 0 && len(code.Key) > 0 { b = appendStructKey(ctx, code, b) @@ -545,8 +545,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -557,14 +557,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } p += uintptr(code.Offset) if p == 0 || (ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0) { @@ -579,8 +579,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -592,26 +592,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyInt: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -623,14 +623,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -639,7 +639,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendInt(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadIntString: @@ -647,8 +647,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -660,28 +660,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyIntString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -693,14 +693,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -711,15 +711,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadIntPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -730,32 +730,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendInt(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyIntPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -766,14 +766,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -781,15 +781,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadIntPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -800,34 +800,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyIntPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -838,14 +838,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -855,7 +855,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadUint: @@ -863,8 +863,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -876,26 +876,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUint: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -907,14 +907,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -923,7 +923,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendUint(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadUintString: @@ -931,8 +931,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -944,28 +944,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUintString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -977,14 +977,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -995,15 +995,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadUintPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1014,32 +1014,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendUint(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUintPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1050,14 +1050,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1065,15 +1065,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadUintPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1084,34 +1084,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUintPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1122,14 +1122,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1139,7 +1139,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat32: @@ -1147,8 +1147,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1160,26 +1160,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1191,22 +1191,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat32(p + uintptr(code.Offset)) if v == 0 { code = code.NextField } else { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, v) - b = appendComma(b) + b = appendFloat32(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat32String: @@ -1214,8 +1214,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1227,28 +1227,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32String: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1260,14 +1260,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat32(p + uintptr(code.Offset)) if v == 0 { @@ -1275,17 +1275,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat32Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1296,32 +1296,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1332,30 +1332,30 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p)) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat32PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1366,34 +1366,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1404,14 +1404,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1419,9 +1419,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat64: @@ -1429,8 +1429,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1442,8 +1442,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1453,19 +1453,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1477,14 +1477,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat64(p + uintptr(code.Offset)) if v == 0 { @@ -1494,8 +1494,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat64String: @@ -1503,8 +1503,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1516,14 +1516,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat64(p + uintptr(code.Offset)) if math.IsInf(v, 0) || math.IsNaN(v) { @@ -1531,17 +1531,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64String: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1553,14 +1553,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat64(p + uintptr(code.Offset)) if v == 0 { @@ -1571,17 +1571,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat64Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1592,36 +1592,36 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1632,14 +1632,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1650,16 +1650,16 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat64PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1670,38 +1670,38 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1712,14 +1712,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1731,9 +1731,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadString: @@ -1741,8 +1741,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1754,26 +1754,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1785,14 +1785,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToString(p + uintptr(code.Offset)) if v == "" { @@ -1800,7 +1800,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, v) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadStringString: @@ -1808,8 +1808,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1821,26 +1821,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p+uintptr(code.Offset))))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyStringString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1852,14 +1852,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToString(p + uintptr(code.Offset)) if v == "" { @@ -1867,15 +1867,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadStringPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1886,32 +1886,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, ptrToString(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyStringPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1922,14 +1922,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1937,15 +1937,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p)) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadStringPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1956,32 +1956,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyStringPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1992,14 +1992,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2007,7 +2007,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadBool: @@ -2015,8 +2015,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2028,26 +2028,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBool: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2059,20 +2059,20 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) - b = appendBool(b, v) - b = appendComma(b) + b = appendBool(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } else { code = code.NextField @@ -2082,8 +2082,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2095,28 +2095,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBoolString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2128,22 +2128,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } else { code = code.NextField @@ -2152,8 +2152,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2164,32 +2164,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBoolPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2200,30 +2200,30 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p)) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadBoolPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2234,34 +2234,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBoolPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2272,14 +2272,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2287,9 +2287,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadBytes: @@ -2297,8 +2297,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2310,26 +2310,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBytes: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2341,30 +2341,30 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToBytes(p + uintptr(code.Offset)) if len(v) == 0 { code = code.NextField } else { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, v) - b = appendComma(b) + b = appendByteSlice(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadBytesPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2375,32 +2375,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBytesPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2411,22 +2411,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p)) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadNumber: @@ -2434,8 +2434,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2447,29 +2447,29 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumber: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2481,25 +2481,25 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToNumber(p + uintptr(code.Offset)) if v == "" { code = code.NextField } else { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next } case encoder.OpStructPtrHeadNumberString: @@ -2507,8 +2507,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2520,31 +2520,31 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumberString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2556,14 +2556,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToNumber(p + uintptr(code.Offset)) if v == "" { @@ -2571,20 +2571,20 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadNumberPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2595,36 +2595,36 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumberPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2635,33 +2635,33 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructPtrHeadNumberPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2672,37 +2672,37 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumberPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2713,14 +2713,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2728,12 +2728,12 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadArray, encoder.OpStructPtrHeadSlice: @@ -2741,8 +2741,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2754,14 +2754,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) p += uintptr(code.Offset) @@ -2772,8 +2772,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2785,14 +2785,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } p += uintptr(code.Offset) b = appendStructKey(ctx, code, b) @@ -2803,8 +2803,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2816,14 +2816,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } p += uintptr(code.Offset) slice := ptrToSlice(p) @@ -2838,8 +2838,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2850,22 +2850,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.NextField } else { code = code.Next @@ -2875,8 +2875,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2887,14 +2887,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2910,8 +2910,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2922,14 +2922,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { @@ -2941,8 +2941,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2953,14 +2953,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { p = ptrToPtr(p + uintptr(code.Offset)) @@ -2976,8 +2976,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2988,26 +2988,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.NextField break } p = ptrToPtr(p + uintptr(code.Offset)) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.NextField } else { if (code.Flags & encoder.IndirectFlags) != 0 { @@ -3020,8 +3020,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3032,14 +3032,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p == 0 { code = code.NextField @@ -3060,8 +3060,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3074,14 +3074,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IsNilableTypeFlags) != 0 { @@ -3090,7 +3090,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3098,14 +3098,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalJSON: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3118,14 +3118,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IsNilableTypeFlags) != 0 { if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalJSON { @@ -3142,15 +3142,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadMarshalJSONPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3161,21 +3161,21 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3183,14 +3183,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalJSONPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3201,8 +3201,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3211,7 +3211,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p == 0 { code = code.NextField @@ -3222,15 +3222,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadMarshalText: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3243,14 +3243,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IsNilableTypeFlags) != 0 { @@ -3259,7 +3259,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3267,14 +3267,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalText: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3287,14 +3287,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IsNilableTypeFlags) != 0 { if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalText { @@ -3310,15 +3310,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadMarshalTextPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3329,21 +3329,21 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3351,14 +3351,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalTextPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3369,8 +3369,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3379,7 +3379,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p == 0 { code = code.NextField @@ -3390,7 +3390,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructField: @@ -3414,7 +3414,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyInt: p := load(ctxptr, code.Idx) @@ -3423,7 +3423,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = appendInt(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldIntString: @@ -3432,7 +3432,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyIntString: p := load(ctxptr, code.Idx) @@ -3443,7 +3443,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldIntPtr: @@ -3451,11 +3451,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendInt(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyIntPtr: p := load(ctxptr, code.Idx) @@ -3463,7 +3463,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldIntPtrString: @@ -3471,13 +3471,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyIntPtrString: p := load(ctxptr, code.Idx) @@ -3487,14 +3487,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUint: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUint: p := load(ctxptr, code.Idx) @@ -3503,7 +3503,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = appendUint(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUintString: @@ -3512,7 +3512,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUintString: p := load(ctxptr, code.Idx) @@ -3523,7 +3523,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUintPtr: @@ -3531,11 +3531,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendUint(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUintPtr: p := load(ctxptr, code.Idx) @@ -3543,7 +3543,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUintPtrString: @@ -3551,13 +3551,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUintPtrString: p := load(ctxptr, code.Idx) @@ -3567,31 +3567,31 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32: p := load(ctxptr, code.Idx) v := ptrToFloat32(p + uintptr(code.Offset)) if v != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, v) - b = appendComma(b) + b = appendFloat32(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32String: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32String: p := load(ctxptr, code.Idx) @@ -3599,9 +3599,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32Ptr: @@ -3609,19 +3609,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32Ptr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p)) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32PtrString: @@ -3629,13 +3629,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32PtrString: p := load(ctxptr, code.Idx) @@ -3643,9 +3643,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64: @@ -3655,8 +3655,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64: p := load(ctxptr, code.Idx) @@ -3666,8 +3666,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64String: @@ -3678,9 +3678,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64String: p := load(ctxptr, code.Idx) @@ -3691,9 +3691,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64Ptr: @@ -3701,8 +3701,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -3710,8 +3710,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64Ptr: p := load(ctxptr, code.Idx) @@ -3722,8 +3722,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64PtrString: @@ -3731,17 +3731,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64PtrString: p := load(ctxptr, code.Idx) @@ -3753,16 +3753,16 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldString: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyString: p := load(ctxptr, code.Idx) @@ -3770,7 +3770,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, v) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldStringString: @@ -3778,7 +3778,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b s := ptrToString(p + uintptr(code.Offset)) b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, s))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyStringString: p := load(ctxptr, code.Idx) @@ -3786,7 +3786,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldStringPtr: @@ -3794,11 +3794,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, ptrToString(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyStringPtr: p := load(ctxptr, code.Idx) @@ -3806,7 +3806,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p)) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldStringPtrString: @@ -3814,11 +3814,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyStringPtrString: p := load(ctxptr, code.Idx) @@ -3826,31 +3826,31 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBool: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBool: p := load(ctxptr, code.Idx) v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) - b = appendBool(b, v) - b = appendComma(b) + b = appendBool(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBoolString: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBoolString: p := load(ctxptr, code.Idx) @@ -3858,9 +3858,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBoolPtr: @@ -3868,19 +3868,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBoolPtr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p)) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBoolPtrString: @@ -3888,13 +3888,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBoolPtrString: p := load(ctxptr, code.Idx) @@ -3902,24 +3902,24 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBytes: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBytes: p := load(ctxptr, code.Idx) v := ptrToBytes(p + uintptr(code.Offset)) if len(v) > 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, v) - b = appendComma(b) + b = appendByteSlice(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBytesPtr: @@ -3927,52 +3927,52 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBytesPtr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p)) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldNumber: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructFieldOmitEmptyNumber: p := load(ctxptr, code.Idx) v := ptrToNumber(p + uintptr(code.Offset)) if v != "" { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldNumberString: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyNumberString: p := load(ctxptr, code.Idx) @@ -3980,12 +3980,12 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldNumberPtr: @@ -3993,26 +3993,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyNumberPtr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldNumberPtrString: @@ -4020,16 +4020,16 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyNumberPtrString: p := load(ctxptr, code.Idx) @@ -4037,12 +4037,12 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldMarshalJSON: @@ -4053,7 +4053,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToPtr(p) } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4061,7 +4061,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalJSON: p := load(ctxptr, code.Idx) @@ -4083,14 +4083,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructFieldMarshalJSONPtr: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4098,7 +4098,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalJSONPtr: p := load(ctxptr, code.Idx) @@ -4109,7 +4109,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldMarshalText: @@ -4120,7 +4120,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToPtr(p) } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4128,7 +4128,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalText: p := load(ctxptr, code.Idx) @@ -4145,14 +4145,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructFieldMarshalTextPtr: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4160,7 +4160,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalTextPtr: p := load(ctxptr, code.Idx) @@ -4171,7 +4171,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldArray: @@ -4339,7 +4339,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendInt(b, ptrToUint64(p), code) } @@ -4361,7 +4361,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) @@ -4427,7 +4427,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendUint(b, ptrToUint64(p), code) } @@ -4449,7 +4449,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) @@ -4473,7 +4473,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndFloat32: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyFloat32: @@ -4481,7 +4481,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToFloat32(p + uintptr(code.Offset)) if v != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4491,7 +4491,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = append(b, '"') b = appendStructEnd(ctx, code, b) code = code.Next @@ -4501,7 +4501,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4513,9 +4513,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) } b = appendStructEnd(ctx, code, b) code = code.Next @@ -4524,7 +4524,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4535,10 +4535,10 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') } b = appendStructEnd(ctx, code, b) @@ -4549,7 +4549,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4563,7 +4563,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyFloat64: @@ -4574,7 +4574,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4588,7 +4588,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) code = code.Next @@ -4601,7 +4601,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4613,7 +4613,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) b = appendStructEnd(ctx, code, b) code = code.Next break @@ -4622,7 +4622,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyFloat64Ptr: @@ -4634,7 +4634,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4645,14 +4645,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') } b = appendStructEnd(ctx, code, b) @@ -4667,7 +4667,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4714,7 +4714,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, ptrToString(p)) } @@ -4736,7 +4736,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) } @@ -4756,7 +4756,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndBool: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyBool: @@ -4764,7 +4764,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4774,7 +4774,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = append(b, '"') b = appendStructEnd(ctx, code, b) code = code.Next @@ -4784,7 +4784,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4796,9 +4796,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) } b = appendStructEnd(ctx, code, b) code = code.Next @@ -4807,7 +4807,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4818,10 +4818,10 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') } b = appendStructEnd(ctx, code, b) @@ -4832,7 +4832,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4842,7 +4842,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndBytes: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p+uintptr(code.Offset))) + b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyBytes: @@ -4850,7 +4850,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToBytes(p + uintptr(code.Offset)) if len(v) > 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, v) + b = appendByteSlice(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4861,9 +4861,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) } b = appendStructEnd(ctx, code, b) code = code.Next @@ -4872,7 +4872,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4881,7 +4881,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndNumber: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } @@ -4892,7 +4892,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToNumber(p + uintptr(code.Offset)) if v != "" { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } @@ -4905,7 +4905,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } @@ -4918,7 +4918,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } @@ -4933,9 +4933,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } @@ -4948,7 +4948,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } @@ -4962,10 +4962,10 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } @@ -4979,7 +4979,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } diff --git a/internal/encoder/vm_indent/util.go b/internal/encoder/vm_indent/util.go index a6dd37a..2e057aa 100644 --- a/internal/encoder/vm_indent/util.go +++ b/internal/encoder/vm_indent/util.go @@ -92,22 +92,22 @@ func ptrToInterface(code *encoder.Opcode, p uintptr) interface{} { })) } -func appendBool(b []byte, v bool) []byte { +func appendBool(_ *encoder.RuntimeContext, b []byte, v bool) []byte { if v { return append(b, "true"...) } return append(b, "false"...) } -func appendNull(b []byte) []byte { +func appendNull(_ *encoder.RuntimeContext, b []byte) []byte { return append(b, "null"...) } -func appendComma(b []byte) []byte { +func appendComma(_ *encoder.RuntimeContext, b []byte) []byte { return append(b, ',', '\n') } -func appendColon(b []byte) []byte { +func appendColon(_ *encoder.RuntimeContext, b []byte) []byte { return append(b, ':', ' ') } @@ -175,11 +175,11 @@ func appendArrayEnd(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []byte) return append(b, ']', ',', '\n') } -func appendEmptyArray(b []byte) []byte { +func appendEmptyArray(_ *encoder.RuntimeContext, b []byte) []byte { return append(b, '[', ']', ',', '\n') } -func appendEmptyObject(b []byte) []byte { +func appendEmptyObject(_ *encoder.RuntimeContext, b []byte) []byte { return append(b, '{', '}', ',', '\n') } @@ -198,7 +198,7 @@ func appendMarshalText(ctx *encoder.RuntimeContext, code *encoder.Opcode, b []by return encoder.AppendMarshalTextIndent(ctx, code, b, v) } -func appendStructHead(b []byte) []byte { +func appendStructHead(_ *encoder.RuntimeContext, b []byte) []byte { return append(b, '{', '\n') } @@ -221,7 +221,7 @@ func appendStructEndSkipLast(ctx *encoder.RuntimeContext, code *encoder.Opcode, b = appendIndent(ctx, b, code.Indent-1) b = append(b, '}') } - return appendComma(b) + return appendComma(ctx, b) } func restoreIndent(ctx *encoder.RuntimeContext, code *encoder.Opcode, ctxptr uintptr) { diff --git a/internal/encoder/vm_indent/vm.go b/internal/encoder/vm_indent/vm.go index 7089aac..b9cd1d2 100644 --- a/internal/encoder/vm_indent/vm.go +++ b/internal/encoder/vm_indent/vm.go @@ -31,8 +31,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpIntPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -40,13 +40,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b fallthrough case encoder.OpInt: b = appendInt(b, ptrToUint64(load(ctxptr, code.Idx)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpUintPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -54,39 +54,39 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b fallthrough case encoder.OpUint: b = appendUint(b, ptrToUint64(load(ctxptr, code.Idx)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpIntString: b = append(b, '"') b = appendInt(b, ptrToUint64(load(ctxptr, code.Idx)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpUintString: b = append(b, '"') b = appendUint(b, ptrToUint64(load(ctxptr, code.Idx)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpFloat32Ptr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpFloat32: - b = appendFloat32(b, ptrToFloat32(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(load(ctxptr, code.Idx))) + b = appendComma(ctx, b) code = code.Next case encoder.OpFloat64Ptr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -97,14 +97,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStringPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -112,58 +112,58 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b fallthrough case encoder.OpString: b = appendString(ctx, b, ptrToString(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpBoolPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpBool: - b = appendBool(b, ptrToBool(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(load(ctxptr, code.Idx))) + b = appendComma(ctx, b) code = code.Next case encoder.OpBytesPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpBytes: - b = appendByteSlice(b, ptrToBytes(load(ctxptr, code.Idx))) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(load(ctxptr, code.Idx))) + b = appendComma(ctx, b) code = code.Next case encoder.OpNumberPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } store(ctxptr, code.Idx, p) fallthrough case encoder.OpNumber: - bb, err := appendNumber(b, ptrToNumber(load(ctxptr, code.Idx))) + bb, err := appendNumber(ctx, b, ptrToNumber(load(ctxptr, code.Idx))) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpInterfacePtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -172,8 +172,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpInterface: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -185,8 +185,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b ctx.SeenPtr = append(ctx.SeenPtr, p) iface := (*emptyInterface)(ptrToUnsafePtr(p)) if iface.ptr == nil { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -202,8 +202,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMarshalJSONPtr: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -212,8 +212,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMarshalJSON: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -224,13 +224,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpMarshalTextPtr: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -240,7 +240,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { b = append(b, `""`...) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next break } @@ -251,13 +251,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpSlicePtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -267,8 +267,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) slice := ptrToSlice(p) if p == 0 || slice.Data == nil { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -280,7 +280,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b code = code.Next store(ctxptr, code.Idx, uintptr(slice.Data)) } else { - b = appendEmptyArray(b) + b = appendEmptyArray(ctx, b) code = code.End.Next } case encoder.OpSliceElem: @@ -301,8 +301,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpArrayPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -311,8 +311,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpArray: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -322,7 +322,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b code = code.Next store(ctxptr, code.Idx, p) } else { - b = appendEmptyArray(b) + b = appendEmptyArray(ctx, b) code = code.End.Next } case encoder.OpArrayElem: @@ -342,8 +342,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMapPtr: p := loadNPtr(ctxptr, code.Idx, code.PtrNum) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } @@ -352,19 +352,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpMap: p := load(ctxptr, code.Idx) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.End.Next break } uptr := ptrToUnsafePtr(p) mlen := maplen(uptr) if mlen <= 0 { - b = appendEmptyObject(b) + b = appendEmptyObject(ctx, b) code = code.End.Next break } - b = appendStructHead(b) + b = appendStructHead(ctx, b) iter := mapiterinit(code.Type, uptr) ctx.KeepRefs = append(ctx.KeepRefs, iter) store(ctxptr, code.ElemIdx, 0) @@ -415,7 +415,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } case encoder.OpMapValue: if ctx.Option.UnorderedMap { - b = appendColon(b) + b = appendColon(ctx, b) } else { ptr := load(ctxptr, code.End.MapPos) mapCtx := (*encoder.MapContext)(ptrToUnsafePtr(ptr)) @@ -514,8 +514,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -526,14 +526,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags&encoder.AnonymousKeyFlags) == 0 && len(code.Key) > 0 { b = appendStructKey(ctx, code, b) @@ -545,8 +545,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -557,14 +557,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && ((code.Flags&encoder.IndirectFlags) != 0 || code.Next.Op == encoder.OpStructEnd) { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } p += uintptr(code.Offset) if p == 0 || (ptrToPtr(p) == 0 && (code.Flags&encoder.IsNextOpPtrTypeFlags) != 0) { @@ -579,8 +579,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -592,26 +592,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyInt: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -623,14 +623,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -639,7 +639,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendInt(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadIntString: @@ -647,8 +647,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -660,28 +660,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyIntString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -693,14 +693,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -711,15 +711,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadIntPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -730,32 +730,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendInt(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyIntPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -766,14 +766,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -781,15 +781,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadIntPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -800,34 +800,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyIntPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -838,14 +838,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -855,7 +855,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadUint: @@ -863,8 +863,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -876,26 +876,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUint: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -907,14 +907,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -923,7 +923,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendUint(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadUintString: @@ -931,8 +931,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -944,28 +944,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUintString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -977,14 +977,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } u64 := ptrToUint64(p + uintptr(code.Offset)) v := u64 & ((1 << code.NumBitSize) - 1) @@ -995,15 +995,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadUintPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1014,32 +1014,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendUint(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUintPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1050,14 +1050,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1065,15 +1065,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadUintPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1084,34 +1084,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyUintPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1122,14 +1122,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1139,7 +1139,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat32: @@ -1147,8 +1147,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1160,26 +1160,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1191,22 +1191,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat32(p + uintptr(code.Offset)) if v == 0 { code = code.NextField } else { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, v) - b = appendComma(b) + b = appendFloat32(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat32String: @@ -1214,8 +1214,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1227,28 +1227,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32String: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1260,14 +1260,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat32(p + uintptr(code.Offset)) if v == 0 { @@ -1275,17 +1275,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat32Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1296,32 +1296,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1332,30 +1332,30 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p)) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat32PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1366,34 +1366,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat32PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1404,14 +1404,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1419,9 +1419,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat64: @@ -1429,8 +1429,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1442,8 +1442,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1453,19 +1453,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1477,14 +1477,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat64(p + uintptr(code.Offset)) if v == 0 { @@ -1494,8 +1494,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat64String: @@ -1503,8 +1503,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1516,14 +1516,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat64(p + uintptr(code.Offset)) if math.IsInf(v, 0) || math.IsNaN(v) { @@ -1531,17 +1531,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64String: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1553,14 +1553,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToFloat64(p + uintptr(code.Offset)) if v == 0 { @@ -1571,17 +1571,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadFloat64Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1592,36 +1592,36 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64Ptr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1632,14 +1632,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1650,16 +1650,16 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadFloat64PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1670,38 +1670,38 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyFloat64PtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1712,14 +1712,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1731,9 +1731,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadString: @@ -1741,8 +1741,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1754,26 +1754,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1785,14 +1785,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToString(p + uintptr(code.Offset)) if v == "" { @@ -1800,7 +1800,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, v) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadStringString: @@ -1808,8 +1808,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1821,26 +1821,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p+uintptr(code.Offset))))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyStringString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1852,14 +1852,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToString(p + uintptr(code.Offset)) if v == "" { @@ -1867,15 +1867,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadStringPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1886,32 +1886,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, ptrToString(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyStringPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1922,14 +1922,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -1937,15 +1937,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p)) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadStringPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1956,32 +1956,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyStringPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -1992,14 +1992,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2007,7 +2007,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadBool: @@ -2015,8 +2015,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2028,26 +2028,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBool: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2059,20 +2059,20 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) - b = appendBool(b, v) - b = appendComma(b) + b = appendBool(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } else { code = code.NextField @@ -2082,8 +2082,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2095,28 +2095,28 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBoolString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2128,22 +2128,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } else { code = code.NextField @@ -2152,8 +2152,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2164,32 +2164,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBoolPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2200,30 +2200,30 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p)) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadBoolPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2234,34 +2234,34 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBoolPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2272,14 +2272,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2287,9 +2287,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadBytes: @@ -2297,8 +2297,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2310,26 +2310,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBytes: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2341,30 +2341,30 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToBytes(p + uintptr(code.Offset)) if len(v) == 0 { code = code.NextField } else { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, v) - b = appendComma(b) + b = appendByteSlice(ctx, b, v) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadBytesPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2375,32 +2375,32 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyBytesPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2411,22 +2411,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p)) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadNumber: @@ -2434,8 +2434,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2447,29 +2447,29 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumber: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2481,25 +2481,25 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToNumber(p + uintptr(code.Offset)) if v == "" { code = code.NextField } else { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next } case encoder.OpStructPtrHeadNumberString: @@ -2507,8 +2507,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2520,31 +2520,31 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumberString: if (code.Flags & encoder.IndirectFlags) != 0 { p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2556,14 +2556,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } v := ptrToNumber(p + uintptr(code.Offset)) if v == "" { @@ -2571,20 +2571,20 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } else { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadNumberPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2595,36 +2595,36 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumberPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2635,33 +2635,33 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p != 0 { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructPtrHeadNumberPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2672,37 +2672,37 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyNumberPtrString: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2713,14 +2713,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2728,12 +2728,12 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructPtrHeadArray, encoder.OpStructPtrHeadSlice: @@ -2741,8 +2741,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2754,14 +2754,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) p += uintptr(code.Offset) @@ -2772,8 +2772,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2785,14 +2785,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } p += uintptr(code.Offset) b = appendStructKey(ctx, code, b) @@ -2803,8 +2803,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2816,14 +2816,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } p += uintptr(code.Offset) slice := ptrToSlice(p) @@ -2838,8 +2838,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2850,22 +2850,22 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.NextField } else { code = code.Next @@ -2875,8 +2875,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2887,14 +2887,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) @@ -2910,8 +2910,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2922,14 +2922,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { @@ -2941,8 +2941,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2953,14 +2953,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p != 0 && (code.Flags&encoder.IndirectFlags) != 0 { p = ptrToPtr(p + uintptr(code.Offset)) @@ -2976,8 +2976,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -2988,26 +2988,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.NextField break } p = ptrToPtr(p + uintptr(code.Offset)) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.NextField } else { if (code.Flags & encoder.IndirectFlags) != 0 { @@ -3020,8 +3020,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3032,14 +3032,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p == 0 { code = code.NextField @@ -3060,8 +3060,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3074,14 +3074,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IsNilableTypeFlags) != 0 { @@ -3090,7 +3090,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3098,14 +3098,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalJSON: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3118,14 +3118,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IsNilableTypeFlags) != 0 { if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalJSON { @@ -3142,15 +3142,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadMarshalJSONPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3161,21 +3161,21 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3183,14 +3183,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalJSONPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3201,8 +3201,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3211,7 +3211,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p == 0 { code = code.NextField @@ -3222,15 +3222,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadMarshalText: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3243,14 +3243,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IsNilableTypeFlags) != 0 { @@ -3259,7 +3259,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3267,14 +3267,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalText: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3287,14 +3287,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if (code.Flags & encoder.IsNilableTypeFlags) != 0 { if (code.Flags&encoder.IndirectFlags) != 0 || code.Op == encoder.OpStructPtrHeadOmitEmptyMarshalText { @@ -3310,15 +3310,15 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructPtrHeadMarshalTextPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3329,21 +3329,21 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } b = appendStructKey(ctx, code, b) if (code.Flags & encoder.IndirectFlags) != 0 { p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -3351,14 +3351,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructPtrHeadOmitEmptyMarshalTextPtr: p := load(ctxptr, code.Idx) if p == 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3369,8 +3369,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) if p == 0 && (code.Flags&encoder.IndirectFlags) != 0 { if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) } code = code.End.Next break @@ -3379,7 +3379,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) } if code.Flags&encoder.AnonymousHeadFlags == 0 { - b = appendStructHead(b) + b = appendStructHead(ctx, b) } if p == 0 { code = code.NextField @@ -3390,7 +3390,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, err } b = bb - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next } case encoder.OpStructField: @@ -3414,7 +3414,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyInt: p := load(ctxptr, code.Idx) @@ -3423,7 +3423,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = appendInt(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldIntString: @@ -3432,7 +3432,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyIntString: p := load(ctxptr, code.Idx) @@ -3443,7 +3443,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldIntPtr: @@ -3451,11 +3451,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendInt(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyIntPtr: p := load(ctxptr, code.Idx) @@ -3463,7 +3463,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendInt(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldIntPtrString: @@ -3471,13 +3471,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyIntPtrString: p := load(ctxptr, code.Idx) @@ -3487,14 +3487,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUint: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUint: p := load(ctxptr, code.Idx) @@ -3503,7 +3503,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = appendUint(b, u64, code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUintString: @@ -3512,7 +3512,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, ptrToUint64(p+uintptr(code.Offset)), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUintString: p := load(ctxptr, code.Idx) @@ -3523,7 +3523,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, u64, code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUintPtr: @@ -3531,11 +3531,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendUint(b, ptrToUint64(p), code) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUintPtr: p := load(ctxptr, code.Idx) @@ -3543,7 +3543,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendUint(b, ptrToUint64(p), code) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldUintPtrString: @@ -3551,13 +3551,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyUintPtrString: p := load(ctxptr, code.Idx) @@ -3567,31 +3567,31 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32: p := load(ctxptr, code.Idx) v := ptrToFloat32(p + uintptr(code.Offset)) if v != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, v) - b = appendComma(b) + b = appendFloat32(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32String: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32String: p := load(ctxptr, code.Idx) @@ -3599,9 +3599,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32Ptr: @@ -3609,19 +3609,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32Ptr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p)) - b = appendComma(b) + b = appendFloat32(ctx, b, ptrToFloat32(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat32PtrString: @@ -3629,13 +3629,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat32PtrString: p := load(ctxptr, code.Idx) @@ -3643,9 +3643,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64: @@ -3655,8 +3655,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64: p := load(ctxptr, code.Idx) @@ -3666,8 +3666,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64String: @@ -3678,9 +3678,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64String: p := load(ctxptr, code.Idx) @@ -3691,9 +3691,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64Ptr: @@ -3701,8 +3701,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) - b = appendComma(b) + b = appendNull(ctx, b) + b = appendComma(ctx, b) code = code.Next break } @@ -3710,8 +3710,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64Ptr: p := load(ctxptr, code.Idx) @@ -3722,8 +3722,8 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) - b = appendComma(b) + b = appendFloat64(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldFloat64PtrString: @@ -3731,17 +3731,17 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyFloat64PtrString: p := load(ctxptr, code.Idx) @@ -3753,16 +3753,16 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldString: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyString: p := load(ctxptr, code.Idx) @@ -3770,7 +3770,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, v) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldStringString: @@ -3778,7 +3778,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b s := ptrToString(p + uintptr(code.Offset)) b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, s))) - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyStringString: p := load(ctxptr, code.Idx) @@ -3786,7 +3786,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, v))) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldStringPtr: @@ -3794,11 +3794,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, ptrToString(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyStringPtr: p := load(ctxptr, code.Idx) @@ -3806,7 +3806,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, ptrToString(p)) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldStringPtrString: @@ -3814,11 +3814,11 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyStringPtrString: p := load(ctxptr, code.Idx) @@ -3826,31 +3826,31 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBool: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBool: p := load(ctxptr, code.Idx) v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) - b = appendBool(b, v) - b = appendComma(b) + b = appendBool(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBoolString: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBoolString: p := load(ctxptr, code.Idx) @@ -3858,9 +3858,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBoolPtr: @@ -3868,19 +3868,19 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBoolPtr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p)) - b = appendComma(b) + b = appendBool(ctx, b, ptrToBool(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBoolPtrString: @@ -3888,13 +3888,13 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBoolPtrString: p := load(ctxptr, code.Idx) @@ -3902,24 +3902,24 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBytes: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p+uintptr(code.Offset))) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBytes: p := load(ctxptr, code.Idx) v := ptrToBytes(p + uintptr(code.Offset)) if len(v) > 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, v) - b = appendComma(b) + b = appendByteSlice(ctx, b, v) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldBytesPtr: @@ -3927,52 +3927,52 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyBytesPtr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p)) - b = appendComma(b) + b = appendByteSlice(ctx, b, ptrToBytes(p)) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldNumber: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructFieldOmitEmptyNumber: p := load(ctxptr, code.Idx) v := ptrToNumber(p + uintptr(code.Offset)) if v != "" { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldNumberString: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyNumberString: p := load(ctxptr, code.Idx) @@ -3980,12 +3980,12 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldNumberPtr: @@ -3993,26 +3993,26 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyNumberPtr: p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldNumberPtrString: @@ -4020,16 +4020,16 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) b = appendStructKey(ctx, code, b) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyNumberPtrString: p := load(ctxptr, code.Idx) @@ -4037,12 +4037,12 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } b = append(bb, '"') - b = appendComma(b) + b = appendComma(ctx, b) } code = code.Next case encoder.OpStructFieldMarshalJSON: @@ -4053,7 +4053,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToPtr(p) } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4061,7 +4061,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalJSON: p := load(ctxptr, code.Idx) @@ -4083,14 +4083,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructFieldMarshalJSONPtr: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalJSON(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4098,7 +4098,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalJSONPtr: p := load(ctxptr, code.Idx) @@ -4109,7 +4109,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldMarshalText: @@ -4120,7 +4120,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToPtr(p) } if p == 0 && (code.Flags&encoder.NilCheckFlags) != 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4128,7 +4128,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalText: p := load(ctxptr, code.Idx) @@ -4145,14 +4145,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) code = code.Next case encoder.OpStructFieldMarshalTextPtr: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { bb, err := appendMarshalText(ctx, code, b, ptrToInterface(code, p)) if err != nil { @@ -4160,7 +4160,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = bb } - b = appendComma(b) + b = appendComma(ctx, b) code = code.Next case encoder.OpStructFieldOmitEmptyMarshalTextPtr: p := load(ctxptr, code.Idx) @@ -4171,7 +4171,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if err != nil { return nil, err } - b = appendComma(bb) + b = appendComma(ctx, bb) } code = code.Next case encoder.OpStructFieldArray: @@ -4339,7 +4339,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendInt(b, ptrToUint64(p), code) } @@ -4361,7 +4361,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendInt(b, ptrToUint64(p), code) @@ -4427,7 +4427,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendUint(b, ptrToUint64(p), code) } @@ -4449,7 +4449,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') b = appendUint(b, ptrToUint64(p), code) @@ -4473,7 +4473,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndFloat32: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyFloat32: @@ -4481,7 +4481,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToFloat32(p + uintptr(code.Offset)) if v != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4491,7 +4491,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p+uintptr(code.Offset))) + b = appendFloat32(ctx, b, ptrToFloat32(p+uintptr(code.Offset))) b = append(b, '"') b = appendStructEnd(ctx, code, b) code = code.Next @@ -4501,7 +4501,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, v) + b = appendFloat32(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4513,9 +4513,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) } b = appendStructEnd(ctx, code, b) code = code.Next @@ -4524,7 +4524,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4535,10 +4535,10 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') } b = appendStructEnd(ctx, code, b) @@ -4549,7 +4549,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat32(b, ptrToFloat32(p)) + b = appendFloat32(ctx, b, ptrToFloat32(p)) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4563,7 +4563,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyFloat64: @@ -4574,7 +4574,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = appendStructKey(ctx, code, b) - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4588,7 +4588,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) code = code.Next @@ -4601,7 +4601,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b } b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4613,7 +4613,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) b = appendStructEnd(ctx, code, b) code = code.Next break @@ -4622,7 +4622,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyFloat64Ptr: @@ -4634,7 +4634,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4645,14 +4645,14 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') v := ptrToFloat64(p) if math.IsInf(v, 0) || math.IsNaN(v) { return nil, errUnsupportedFloat(v) } - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') } b = appendStructEnd(ctx, code, b) @@ -4667,7 +4667,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b return nil, errUnsupportedFloat(v) } b = append(b, '"') - b = appendFloat64(b, v) + b = appendFloat64(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4714,7 +4714,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, ptrToString(p)) } @@ -4736,7 +4736,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = appendString(ctx, b, string(appendString(ctx, []byte{}, ptrToString(p)))) } @@ -4756,7 +4756,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndBool: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyBool: @@ -4764,7 +4764,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToBool(p + uintptr(code.Offset)) if v { b = appendStructKey(ctx, code, b) - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4774,7 +4774,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p+uintptr(code.Offset))) + b = appendBool(ctx, b, ptrToBool(p+uintptr(code.Offset))) b = append(b, '"') b = appendStructEnd(ctx, code, b) code = code.Next @@ -4784,7 +4784,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, v) + b = appendBool(ctx, b, v) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4796,9 +4796,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) } b = appendStructEnd(ctx, code, b) code = code.Next @@ -4807,7 +4807,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4818,10 +4818,10 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') } b = appendStructEnd(ctx, code, b) @@ -4832,7 +4832,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - b = appendBool(b, ptrToBool(p)) + b = appendBool(ctx, b, ptrToBool(p)) b = append(b, '"') b = appendStructEnd(ctx, code, b) } else { @@ -4842,7 +4842,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndBytes: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p+uintptr(code.Offset))) + b = appendByteSlice(ctx, b, ptrToBytes(p+uintptr(code.Offset))) b = appendStructEnd(ctx, code, b) code = code.Next case encoder.OpStructEndOmitEmptyBytes: @@ -4850,7 +4850,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToBytes(p + uintptr(code.Offset)) if len(v) > 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, v) + b = appendByteSlice(ctx, b, v) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4861,9 +4861,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) } b = appendStructEnd(ctx, code, b) code = code.Next @@ -4872,7 +4872,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - b = appendByteSlice(b, ptrToBytes(p)) + b = appendByteSlice(ctx, b, ptrToBytes(p)) b = appendStructEnd(ctx, code, b) } else { b = appendStructEndSkipLast(ctx, code, b) @@ -4881,7 +4881,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b case encoder.OpStructEndNumber: p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } @@ -4892,7 +4892,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b v := ptrToNumber(p + uintptr(code.Offset)) if v != "" { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } @@ -4905,7 +4905,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p+uintptr(code.Offset))) + bb, err := appendNumber(ctx, b, ptrToNumber(p+uintptr(code.Offset))) if err != nil { return nil, err } @@ -4918,7 +4918,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if v != "" { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, v) + bb, err := appendNumber(ctx, b, v) if err != nil { return nil, err } @@ -4933,9 +4933,9 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } @@ -4948,7 +4948,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p != 0 { b = appendStructKey(ctx, code, b) - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } @@ -4962,10 +4962,10 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b p := load(ctxptr, code.Idx) p = ptrToNPtr(p+uintptr(code.Offset), code.PtrNum) if p == 0 { - b = appendNull(b) + b = appendNull(ctx, b) } else { b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err } @@ -4979,7 +4979,7 @@ func Run(ctx *encoder.RuntimeContext, b []byte, codeSet *encoder.OpcodeSet) ([]b if p != 0 { b = appendStructKey(ctx, code, b) b = append(b, '"') - bb, err := appendNumber(b, ptrToNumber(p)) + bb, err := appendNumber(ctx, b, ptrToNumber(p)) if err != nil { return nil, err }