Skip to content

Commit 552ca6f

Browse files
committed
Wrap all the asm helpers in #ifdef FEATURE_INTERPRETER
1 parent d2fe6e7 commit 552ca6f

File tree

4 files changed

+65
-58
lines changed

4 files changed

+65
-58
lines changed

src/coreclr/vm/amd64/AsmHelpers.asm

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -482,23 +482,6 @@ JIT_PollGCRarePath:
482482
TAILJMP_RAX
483483
LEAF_END JIT_PollGC, _TEXT
484484

485-
ifdef FEATURE_INTERPRETER
486-
NESTED_ENTRY InterpreterStub, _TEXT
487-
488-
PROLOG_WITH_TRANSITION_BLOCK
489-
490-
;
491-
; call ExecuteInterpretedMethod
492-
;
493-
lea rcx, [rsp + __PWTB_TransitionBlock] ; pTransitionBlock*
494-
mov rdx, METHODDESC_REGISTER
495-
call ExecuteInterpretedMethod
496-
497-
EPILOG_WITH_TRANSITION_BLOCK_RETURN
498-
499-
NESTED_END InterpreterStub, _TEXT
500-
endif ; FEATURE_INTERPRETER
501-
502485
; rcx -This pointer
503486
; rdx -ReturnBuffer
504487
LEAF_ENTRY ThisPtrRetBufPrecodeWorker, _TEXT
@@ -629,6 +612,23 @@ NESTED_ENTRY CallEHFilterFunclet, _TEXT
629612
ret
630613
NESTED_END CallEHFilterFunclet, _TEXT
631614

615+
ifdef FEATURE_INTERPRETER
616+
617+
NESTED_ENTRY InterpreterStub, _TEXT
618+
619+
PROLOG_WITH_TRANSITION_BLOCK
620+
621+
;
622+
; call ExecuteInterpretedMethod
623+
;
624+
lea rcx, [rsp + __PWTB_TransitionBlock] ; pTransitionBlock*
625+
mov rdx, METHODDESC_REGISTER
626+
call ExecuteInterpretedMethod
627+
628+
EPILOG_WITH_TRANSITION_BLOCK_RETURN
629+
630+
NESTED_END InterpreterStub, _TEXT
631+
632632
; Copy arguments from the interpreter stack to the processor stack.
633633
; The CPU stack slots are aligned to pointer size.
634634
LEAF_ENTRY Load_Stack, _TEXT
@@ -911,4 +911,6 @@ END_PROLOGUE
911911
ret
912912
NESTED_END CallJittedMethodRetI8, _TEXT
913913

914+
endif ; FEATURE_INTERPRETER
915+
914916
end

src/coreclr/vm/amd64/asmhelpers.S

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -334,25 +334,6 @@ LOCAL_LABEL(JIT_PollGCRarePath):
334334
jmp rax
335335
LEAF_END JIT_PollGC, _TEXT
336336

337-
#ifdef FEATURE_INTERPRETER
338-
NESTED_ENTRY InterpreterStub, _TEXT, NoHandler
339-
340-
PROLOG_WITH_TRANSITION_BLOCK 8, 0, 0, 0, 0
341-
mov [rsp], rax // Return buffer in Swift calling convention
342-
343-
#
344-
# call ExecuteInterpretedMethod
345-
#
346-
lea rdi, [rsp + __PWTB_TransitionBlock] // pTransitionBlock*
347-
mov rsi, METHODDESC_REGISTER
348-
call C_FUNC(ExecuteInterpretedMethod)
349-
350-
mov rax, [rsp]
351-
EPILOG_WITH_TRANSITION_BLOCK_RETURN
352-
353-
NESTED_END InterpreterStub, _TEXT
354-
#endif // FEATURE_INTERPRETER
355-
356337
//rdi -This pointer
357338
//rsi -ReturnBuffer
358339
LEAF_ENTRY ThisPtrRetBufPrecodeWorker, _TEXT
@@ -453,6 +434,25 @@ NESTED_ENTRY CallEHFilterFunclet, _TEXT, NoHandler
453434
ret
454435
NESTED_END CallEHFilterFunclet, _TEXT
455436

437+
#ifdef FEATURE_INTERPRETER
438+
439+
NESTED_ENTRY InterpreterStub, _TEXT, NoHandler
440+
441+
PROLOG_WITH_TRANSITION_BLOCK 8, 0, 0, 0, 0
442+
mov [rsp], rax // Return buffer in Swift calling convention
443+
444+
#
445+
# call ExecuteInterpretedMethod
446+
#
447+
lea rdi, [rsp + __PWTB_TransitionBlock] // pTransitionBlock*
448+
mov rsi, METHODDESC_REGISTER
449+
call C_FUNC(ExecuteInterpretedMethod)
450+
451+
mov rax, [rsp]
452+
EPILOG_WITH_TRANSITION_BLOCK_RETURN
453+
454+
NESTED_END InterpreterStub, _TEXT
455+
456456
// Copy arguments from the interpreter stack to the processor stack.
457457
// The CPU stack slots are aligned to pointer size.
458458
LEAF_ENTRY Load_Stack, _TEXT
@@ -1153,3 +1153,5 @@ END_PROLOGUE
11531153
pop rbp
11541154
ret
11551155
NESTED_END CallJittedMethodRetDoubleDouble, _TEXT
1156+
1157+
#endif // FEATURE_INTERPRETER

src/coreclr/vm/arm64/asmhelpers.S

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,16 @@ LOCAL_LABEL(JIT_PollGCRarePath):
845845
br x9
846846
LEAF_END JIT_PollGC, _TEXT
847847

848+
//x0 -This pointer
849+
//x1 -ReturnBuffer
850+
LEAF_ENTRY ThisPtrRetBufPrecodeWorker, _TEXT
851+
ldr x12, [METHODDESC_REGISTER, #ThisPtrRetBufPrecodeData__Target]
852+
mov x11, x0 // Move first arg pointer to temp register
853+
mov x0, x1 // Move ret buf arg pointer from location in ABI for return buffer for instance method to location in ABI for return buffer for static method
854+
mov x1, x11 // Move temp register to first arg register for static method with return buffer
855+
EPILOG_BRANCH_REG x12
856+
LEAF_END ThisPtrRetBufPrecodeWorker, _TEXT
857+
848858
#ifdef FEATURE_INTERPRETER
849859
NESTED_ENTRY InterpreterStub, _TEXT, NoHandler
850860

@@ -858,17 +868,6 @@ NESTED_ENTRY InterpreterStub, _TEXT, NoHandler
858868
EPILOG_WITH_TRANSITION_BLOCK_RETURN
859869

860870
NESTED_END InterpreterStub, _TEXT
861-
#endif // FEATURE_INTERPRETER
862-
863-
//x0 -This pointer
864-
//x1 -ReturnBuffer
865-
LEAF_ENTRY ThisPtrRetBufPrecodeWorker, _TEXT
866-
ldr x12, [METHODDESC_REGISTER, #ThisPtrRetBufPrecodeData__Target]
867-
mov x11, x0 // Move first arg pointer to temp register
868-
mov x0, x1 // Move ret buf arg pointer from location in ABI for return buffer for instance method to location in ABI for return buffer for static method
869-
mov x1, x11 // Move temp register to first arg register for static method with return buffer
870-
EPILOG_BRANCH_REG x12
871-
LEAF_END ThisPtrRetBufPrecodeWorker, _TEXT
872871

873872
// Copy arguments from the interpreter stack to the processor stack
874873
// The CPU stack slots are aligned to pointer size.
@@ -1463,3 +1462,5 @@ NESTED_ENTRY CallJittedMethodRet4Float, _TEXT, NoHandler
14631462
EPILOG_RESTORE_REG_PAIR_INDEXED fp, lr, 32
14641463
EPILOG_RETURN
14651464
NESTED_END CallJittedMethodRet4Float, _TEXT
1465+
1466+
#endif // FEATURE_INTERPRETER

src/coreclr/vm/arm64/asmhelpers.asm

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,18 @@ JIT_PollGCRarePath
12281228
br x9
12291229
LEAF_END
12301230

1231+
;x0 -This pointer
1232+
;x1 -ReturnBuffer
1233+
LEAF_ENTRY ThisPtrRetBufPrecodeWorker
1234+
ldr x12, [METHODDESC_REGISTER, #ThisPtrRetBufPrecodeData__Target]
1235+
mov x11, x0 ; Move first arg pointer to temp register
1236+
mov x0, x1 ; Move ret buf arg pointer from location in ABI for return buffer for instance method to location in ABI for return buffer for static method
1237+
mov x1, x11 ; Move temp register to first arg register for static method with return buffer
1238+
EPILOG_BRANCH_REG x12
1239+
LEAF_END
1240+
12311241
#ifdef FEATURE_INTERPRETER
1242+
12321243
NESTED_ENTRY InterpreterStub
12331244

12341245
PROLOG_WITH_TRANSITION_BLOCK
@@ -1241,17 +1252,6 @@ JIT_PollGCRarePath
12411252
EPILOG_WITH_TRANSITION_BLOCK_RETURN
12421253

12431254
NESTED_END
1244-
#endif // FEATURE_INTERPRETER
1245-
1246-
;x0 -This pointer
1247-
;x1 -ReturnBuffer
1248-
LEAF_ENTRY ThisPtrRetBufPrecodeWorker
1249-
ldr x12, [METHODDESC_REGISTER, #ThisPtrRetBufPrecodeData__Target]
1250-
mov x11, x0 ; Move first arg pointer to temp register
1251-
mov x0, x1 ; Move ret buf arg pointer from location in ABI for return buffer for instance method to location in ABI for return buffer for static method
1252-
mov x1, x11 ; Move temp register to first arg register for static method with return buffer
1253-
EPILOG_BRANCH_REG x12
1254-
LEAF_END
12551255

12561256
; Copy arguments from the interpreter stack to the processor stack
12571257
; The CPU stack slots are aligned to pointer size.
@@ -1808,5 +1808,7 @@ CopyLoop
18081808
EPILOG_RETURN
18091809
NESTED_END CallJittedMethodRet4Float
18101810

1811+
#endif // FEATURE_INTERPRETER
1812+
18111813
; Must be at very end of file
18121814
END

0 commit comments

Comments
 (0)