diff options
Diffstat (limited to 'src/pkg/reflect')
-rw-r--r-- | src/pkg/reflect/asm_386.s | 4 | ||||
-rw-r--r-- | src/pkg/reflect/asm_amd64.s | 4 | ||||
-rw-r--r-- | src/pkg/reflect/asm_arm.s | 4 | ||||
-rw-r--r-- | src/pkg/reflect/value.go | 8 |
4 files changed, 14 insertions, 6 deletions
diff --git a/src/pkg/reflect/asm_386.s b/src/pkg/reflect/asm_386.s index ef814966e..75413c752 100644 --- a/src/pkg/reflect/asm_386.s +++ b/src/pkg/reflect/asm_386.s @@ -8,7 +8,7 @@ // See the comment on the declaration of makeFuncStub in makefunc.go // for more details. // No argsize here, gc generates argsize info at call site. -TEXT ·makeFuncStub(SB),NOSPLIT,$8 +TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$8 MOVL DX, 0(SP) LEAL argframe+0(FP), CX MOVL CX, 4(SP) @@ -19,7 +19,7 @@ TEXT ·makeFuncStub(SB),NOSPLIT,$8 // See the comment on the declaration of methodValueCall in makefunc.go // for more details. // No argsize here, gc generates argsize info at call site. -TEXT ·methodValueCall(SB),NOSPLIT,$8 +TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$8 MOVL DX, 0(SP) LEAL argframe+0(FP), CX MOVL CX, 4(SP) diff --git a/src/pkg/reflect/asm_amd64.s b/src/pkg/reflect/asm_amd64.s index 1aa10440c..712959843 100644 --- a/src/pkg/reflect/asm_amd64.s +++ b/src/pkg/reflect/asm_amd64.s @@ -8,7 +8,7 @@ // See the comment on the declaration of makeFuncStub in makefunc.go // for more details. // No argsize here, gc generates argsize info at call site. -TEXT ·makeFuncStub(SB),NOSPLIT,$16 +TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$16 MOVQ DX, 0(SP) LEAQ argframe+0(FP), CX MOVQ CX, 8(SP) @@ -19,7 +19,7 @@ TEXT ·makeFuncStub(SB),NOSPLIT,$16 // See the comment on the declaration of methodValueCall in makefunc.go // for more details. // No argsize here, gc generates argsize info at call site. -TEXT ·methodValueCall(SB),NOSPLIT,$16 +TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$16 MOVQ DX, 0(SP) LEAQ argframe+0(FP), CX MOVQ CX, 8(SP) diff --git a/src/pkg/reflect/asm_arm.s b/src/pkg/reflect/asm_arm.s index 5e456ea2c..68ded4ac6 100644 --- a/src/pkg/reflect/asm_arm.s +++ b/src/pkg/reflect/asm_arm.s @@ -8,7 +8,7 @@ // See the comment on the declaration of makeFuncStub in makefunc.go // for more details. // No argsize here, gc generates argsize info at call site. -TEXT ·makeFuncStub(SB),NOSPLIT,$8 +TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$8 MOVW R7, 4(R13) MOVW $argframe+0(FP), R1 MOVW R1, 8(R13) @@ -19,7 +19,7 @@ TEXT ·makeFuncStub(SB),NOSPLIT,$8 // See the comment on the declaration of methodValueCall in makefunc.go // for more details. // No argsize here, gc generates argsize info at call site. -TEXT ·methodValueCall(SB),NOSPLIT,$8 +TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$8 MOVW R7, 4(R13) MOVW $argframe+0(FP), R1 MOVW R1, 8(R13) diff --git a/src/pkg/reflect/value.go b/src/pkg/reflect/value.go index dbecc59da..20fc459e5 100644 --- a/src/pkg/reflect/value.go +++ b/src/pkg/reflect/value.go @@ -497,6 +497,10 @@ func (v Value) call(op string, in []Value) []Value { // frame into a call using Values. // It is in this file so that it can be next to the call method above. // The remainder of the MakeFunc implementation is in makefunc.go. +// +// NOTE: This function must be marked as a "wrapper" in the generated code, +// so that the linker can make it work correctly for panic and recover. +// The gc compilers know to do that for the name "reflect.callReflect". func callReflect(ctxt *makeFuncImpl, frame unsafe.Pointer) { ftyp := ctxt.typ f := ctxt.fn @@ -650,6 +654,10 @@ func frameSize(t *rtype, rcvr bool) (total, in, outOffset, out uintptr) { // to deal with individual Values for each argument. // It is in this file so that it can be next to the two similar functions above. // The remainder of the makeMethodValue implementation is in makefunc.go. +// +// NOTE: This function must be marked as a "wrapper" in the generated code, +// so that the linker can make it work correctly for panic and recover. +// The gc compilers know to do that for the name "reflect.callMethod". func callMethod(ctxt *methodValue, frame unsafe.Pointer) { t, fn, rcvr := methodReceiver("call", ctxt.rcvr, ctxt.method) total, in, outOffset, out := frameSize(t, true) |