Index: runtime/vm/stub_code_arm64.cc |
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc |
index 4e2293b73c8b2b89d4779052f089518984d79042..93b92179224593fc99a0dc2e4d3a7134d06b1d6e 100644 |
--- a/runtime/vm/stub_code_arm64.cc |
+++ b/runtime/vm/stub_code_arm64.cc |
@@ -142,7 +142,8 @@ void StubCode::GeneratePrintStopMessageStub(Assembler* assembler) { |
// R5 : address of the native function to call. |
// R2 : address of first argument in argument array. |
// R1 : argc_tag including number of arguments and function kind. |
-void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) { |
+static void GenerateCallNativeWithWrapperStub(Assembler* assembler, |
+ Address wrapper) { |
const intptr_t thread_offset = NativeArguments::thread_offset(); |
const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset(); |
const intptr_t argv_offset = NativeArguments::argv_offset(); |
@@ -211,7 +212,7 @@ void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) { |
__ mov(R1, R5); // Pass the function entrypoint to call. |
// Call native function invocation wrapper or redirection via simulator. |
- __ ldr(LR, Address(THR, Thread::native_call_wrapper_entry_point_offset())); |
+ __ ldr(LR, wrapper); |
__ blr(LR); |
// Restore SP and CSP. |
@@ -230,13 +231,27 @@ void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) { |
} |
+void StubCode::GenerateCallNoScopeNativeStub(Assembler* assembler) { |
+ GenerateCallNativeWithWrapperStub( |
+ assembler, |
+ Address(THR, Thread::no_scope_native_wrapper_entry_point_offset())); |
+} |
+ |
+ |
+void StubCode::GenerateCallAutoScopeNativeStub(Assembler* assembler) { |
+ GenerateCallNativeWithWrapperStub( |
+ assembler, |
+ Address(THR, Thread::auto_scope_native_wrapper_entry_point_offset())); |
+} |
+ |
+ |
// Input parameters: |
// LR : return address. |
// SP : address of return value. |
// R5 : address of the native function to call. |
// R2 : address of first argument in argument array. |
// R1 : argc_tag including number of arguments and function kind. |
-void StubCode::GenerateCallBootstrapCFunctionStub(Assembler* assembler) { |
+void StubCode::GenerateCallBootstrapNativeStub(Assembler* assembler) { |
const intptr_t thread_offset = NativeArguments::thread_offset(); |
const intptr_t argc_tag_offset = NativeArguments::argc_tag_offset(); |
const intptr_t argv_offset = NativeArguments::argv_offset(); |