Skip to content

Commit 1d56e43

Browse files
committed
xplat-arm: implement missing arm_Thunks after xplat Debugger support
1 parent 62f9668 commit 1d56e43

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

lib/Runtime/Language/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ elseif(CC_TARGETS_X86)
8080
elseif(CC_TARGETS_ARM)
8181
set (CRL_SOURCE_FILES ${CRL_SOURCE_FILES}
8282
arm/StackFrame.cpp
83+
arm/arm_Thunks.S
8384
)
8485
endif()
8586

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// -------------------------------------------------------------------------------------------------------
2+
// Copyright (C) Microsoft. All rights reserved.
3+
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
4+
// -------------------------------------------------------------------------------------------------------
5+
6+
#include "unixasmmacros.inc"
7+
8+
.syntax unified
9+
.thumb
10+
11+
.global C_FUNC(_ZN2Js13ScriptContext31ProfileModeDeferredParsingThunkEPNS_16RecyclableObjectENS_8CallInfoEz)
12+
.global C_FUNC(_ZN2Js13ScriptContext35ProfileModeDeferredDeserializeThunkEPNS_16RecyclableObjectENS_8CallInfoEz)
13+
14+
NESTED_ENTRY _ZN2Js13ScriptContext31ProfileModeDeferredParsingThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT, NoHandler
15+
16+
PROLOG_PUSH {r0-r3}
17+
PROLOG_PUSH {r11}
18+
PROLOG_PUSH {lr} // save volatile registers
19+
20+
mov r0, sp // Pass the address of the function at the saved r0 in case it need to be boxed
21+
bl C_FUNC(_ZN2Js13ScriptContext24ProfileModeDeferredParseEPPNS_14ScriptFunctionE)
22+
mov r12, r0 // back up entry point
23+
24+
EPILOG_POP {lr}
25+
EPILOG_POP {r11}
26+
EPILOG_POP {r0-r3} // restore arguments and return address
27+
28+
bx r12 // jump (tail call) to new entryPoint
29+
NESTED_END _ZN2Js13ScriptContext31ProfileModeDeferredParsingThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT
30+
31+
32+
NESTED_ENTRY _ZN2Js13ScriptContext35ProfileModeDeferredDeserializeThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT, NoHandler
33+
PROLOG_PUSH {r0-r3}
34+
PROLOG_PUSH {r11}
35+
PROLOG_PUSH {lr} // save volatile registers
36+
37+
bl C_FUNC(_ZN2Js13ScriptContext30ProfileModeDeferredDeserializeEPNS_14ScriptFunctionE)
38+
mov r12, r0 // backup entry point
39+
40+
EPILOG_POP {lr}
41+
EPILOG_POP {r11}
42+
EPILOG_POP {r0-r3} // restore arguments and return address
43+
44+
bx r12 // jump (tail call) to new entryPoint
45+
NESTED_END _ZN2Js13ScriptContext35ProfileModeDeferredDeserializeThunkEPNS_16RecyclableObjectENS_8CallInfoEz, _TEXT

0 commit comments

Comments
 (0)