Text file src/reflect/asm_s390x.s

     1  // Copyright 2016 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  #include "textflag.h"
     6  #include "funcdata.h"
     7  
     8  // The frames of each of the two functions below contain two locals, at offsets
     9  // that are known to the runtime.
    10  //
    11  // The first local is a bool called retValid with a whole pointer-word reserved
    12  // for it on the stack. The purpose of this word is so that the runtime knows
    13  // whether the stack-allocated return space contains valid values for stack
    14  // scanning.
    15  //
    16  // The second local is an abi.RegArgs value whose offset is also known to the
    17  // runtime, so that a stack map for it can be constructed, since it contains
    18  // pointers visible to the GC.
    19  
    20  #define LOCAL_RETVALID 40
    21  #define LOCAL_REGARGS 48
    22  
    23  // The frame size of the functions below is
    24  // 32 (args of callReflect/callMethod) + 8 (bool + padding) + 264 (abi.RegArgs) = 304.
    25  
    26  // makeFuncStub is the code half of the function returned by MakeFunc.
    27  // See the comment on the declaration of makeFuncStub in makefunc.go
    28  // for more details.
    29  // No arg size here, runtime pulls arg map out of the func value.
    30  TEXT ·makeFuncStub(SB),(NOSPLIT|WRAPPER),$304
    31  	NO_LOCAL_POINTERS
    32  	ADD	$LOCAL_REGARGS, R15, R10 // spillArgs using R10
    33  	BL	runtime·spillArgs(SB)
    34  	MOVD	R12, 32(R15) // save context reg R12 > args of moveMakeFuncArgPtrs < LOCAL_REGARGS
    35  	MOVD	R12, R2
    36  	MOVD	R10, R3
    37  	BL	·moveMakeFuncArgPtrs<ABIInternal>(SB)
    38  	MOVD	32(R15), R12 // restore context reg R12
    39  	MOVD	R12, 8(R15)
    40  	MOVD	$argframe+0(FP), R1
    41  	MOVD	R1, 16(R15)
    42  	MOVB	$0, LOCAL_RETVALID(R15)
    43  	ADD	$LOCAL_RETVALID, R15, R1
    44  	MOVD	R1, 24(R15)
    45  	ADD	$LOCAL_REGARGS, R15, R1
    46  	MOVD	R1, 32(R15)
    47  	BL	·callReflect(SB)
    48  	ADD	$LOCAL_REGARGS, R15, R10 // unspillArgs using R10
    49  	BL	runtime·unspillArgs(SB)
    50  	RET
    51  
    52  // methodValueCall is the code half of the function returned by makeMethodValue.
    53  // See the comment on the declaration of methodValueCall in makefunc.go
    54  // for more details.
    55  // No arg size here; runtime pulls arg map out of the func value.
    56  TEXT ·methodValueCall(SB),(NOSPLIT|WRAPPER),$304
    57  	NO_LOCAL_POINTERS
    58  	ADD	$LOCAL_REGARGS, R15, R10 // spillArgs using R10
    59  	BL	runtime·spillArgs(SB)
    60  	MOVD	R12, 32(R15) // save context reg R12 > args of moveMakeFuncArgPtrs < LOCAL_REGARGS
    61  	MOVD	R12, R2
    62  	MOVD	R10, R3
    63  	BL	·moveMakeFuncArgPtrs<ABIInternal>(SB)
    64  	MOVD	32(R15), R12 // restore context reg R12
    65  	MOVD	R12, 8(R15)
    66  	MOVD	$argframe+0(FP), R1
    67  	MOVD	R1, 16(R15)
    68  	MOVB	$0, LOCAL_RETVALID(R15)
    69  	ADD	$LOCAL_RETVALID, R15, R1
    70  	MOVD	R1, 24(R15)
    71  	ADD	$LOCAL_REGARGS, R15, R1
    72  	MOVD	R1, 32(R15)
    73  	BL	·callMethod(SB)
    74  	ADD	$LOCAL_REGARGS, R15, R10 // unspillArgs using R10
    75  	BL	runtime·unspillArgs(SB)
    76  	RET
    77  

View as plain text