Index: runtime/vm/stub_code_arm64.cc |
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc |
index 9c41377eb6ce3c674de643370a550bab25c9cd46..41d454403dee717d5b2fa4a91024f899ffa1c5ec 100644 |
--- a/runtime/vm/stub_code_arm64.cc |
+++ b/runtime/vm/stub_code_arm64.cc |
@@ -214,16 +214,10 @@ void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) { |
__ mov(CSP, SP); |
__ mov(R1, R5); // Pass the function entrypoint to call. |
+ |
// Call native function invocation wrapper or redirection via simulator. |
-#if defined(USING_SIMULATOR) |
- uword entry = reinterpret_cast<uword>(NativeEntry::NativeCallWrapper); |
- entry = Simulator::RedirectExternalReference( |
- entry, Simulator::kNativeCall, NativeEntry::kNumCallWrapperArguments); |
- __ LoadImmediate(R2, entry); |
- __ blr(R2); |
-#else |
- __ BranchLink(&NativeEntry::NativeCallWrapperLabel()); |
-#endif |
+ __ ldr(LR, Address(THR, Thread::native_call_wrapper_entry_point_offset())); |
+ __ blr(LR); |
// Restore SP and CSP. |
__ mov(SP, CSP); |