Index: runtime/vm/native_entry.cc |
diff --git a/runtime/vm/native_entry.cc b/runtime/vm/native_entry.cc |
index 51c4a463e454cf05d8f1a5f3e3b53b46bb3719b6..29cb8d7145b9d8f89ca9eb40747cdc8071bbd104 100644 |
--- a/runtime/vm/native_entry.cc |
+++ b/runtime/vm/native_entry.cc |
@@ -23,14 +23,6 @@ DEFINE_FLAG(bool, trace_natives, false, |
"Trace invocation of natives (debug mode only)"); |
-static ExternalLabel native_call_label( |
- reinterpret_cast<uword>(&NativeEntry::NativeCallWrapper)); |
- |
- |
-static ExternalLabel link_native_call_label( |
- reinterpret_cast<uword>(&NativeEntry::LinkNativeCall)); |
- |
- |
NativeFunction NativeEntry::ResolveNative(const Library& library, |
const String& function_name, |
int number_of_arguments, |
@@ -84,8 +76,13 @@ const uint8_t* NativeEntry::ResolveSymbol(uword pc) { |
} |
-const ExternalLabel& NativeEntry::NativeCallWrapperLabel() { |
- return native_call_label; |
+uword NativeEntry::NativeCallWrapperEntry() { |
+ uword entry = reinterpret_cast<uword>(NativeEntry::NativeCallWrapper); |
+#if defined(USING_SIMULATOR) |
+ entry = Simulator::RedirectExternalReference( |
+ entry, Simulator::kNativeCall, NativeEntry::kNumCallWrapperArguments); |
+#endif |
+ return entry; |
} |
@@ -167,8 +164,13 @@ static NativeFunction ResolveNativeFunction(Isolate *isolate, |
} |
-const ExternalLabel& NativeEntry::LinkNativeCallLabel() { |
- return link_native_call_label; |
+uword NativeEntry::LinkNativeCallEntry() { |
+ uword entry = reinterpret_cast<uword>(NativeEntry::LinkNativeCall); |
+#if defined(USING_SIMULATOR) |
+ entry = Simulator::RedirectExternalReference( |
+ entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments); |
+#endif |
+ return entry; |
} |