Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(521)

Unified Diff: runtime/vm/intermediate_language.cc

Issue 2793163002: Do not embed is_auto_setup_scope into the compilation of native calls. (Closed)
Patch Set: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 4d781eb5b752ae4f7831761efd799a0690177aad..7ee6a379b66aef24148d69f0f727acd0b7052394 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -3969,9 +3969,19 @@ intptr_t MergedMathInstr::OutputIndexOf(Token::Kind token) {
void NativeCallInstr::SetupNative() {
+ if (link_lazily()) {
+ // Resolution will happen during NativeEntry::LinkNativeCall.
+ return;
+ }
+
Zone* zone = Thread::Current()->zone();
const Class& cls = Class::Handle(zone, function().Owner());
const Library& library = Library::Handle(zone, cls.library());
+
+ Dart_NativeEntryResolver resolver = library.native_entry_resolver();
+ bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver);
+ set_is_bootstrap_native(is_bootstrap_native);
+
const int num_params =
NativeArguments::ParameterCountForResolution(function());
bool auto_setup_scope = true;
@@ -3983,11 +3993,8 @@ void NativeCallInstr::SetupNative() {
"native function '%s' (%" Pd " arguments) cannot be found",
native_name().ToCString(), function().NumParameters());
}
+ set_is_auto_scope(auto_setup_scope);
set_native_c_function(native_function);
- function().SetIsNativeAutoSetupScope(auto_setup_scope);
- Dart_NativeEntryResolver resolver = library.native_entry_resolver();
- bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver);
- set_is_bootstrap_native(is_bootstrap_native);
}
#undef __

Powered by Google App Engine
This is Rietveld 408576698