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

Unified Diff: runtime/vm/intermediate_language.cc

Issue 2779703003: When linking natives lazily (as in AOT compilation), don't resolve them eagerly. (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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.cc
diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc
index 65c497e51a6aa9ff4bc968c25e67dae66c334f0f..04788e3d6d7b9c6475655476bbc57ad10d48a8d1 100644
--- a/runtime/vm/intermediate_language.cc
+++ b/runtime/vm/intermediate_language.cc
@@ -3972,6 +3972,15 @@ void NativeCallInstr::SetupNative() {
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);
+
+ if (link_lazily() && !is_bootstrap_native) {
+ return;
+ }
+
const int num_params =
NativeArguments::ParameterCountForResolution(function());
bool auto_setup_scope = true;
@@ -3985,9 +3994,6 @@ void NativeCallInstr::SetupNative() {
}
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 __
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698