mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 15:17:07 +00:00
When linking natives lazily (as in AOT compilation), don't resolve them eagerly.
Avoids requiring an embedder to setup native stubs for functions that aren't called just to run Dart_Precompile. Issue #24686 R=fschneider@google.com Review-Url: https://codereview.chromium.org/2779703003 .
This commit is contained in:
parent
483066a697
commit
8df8025f2a
1 changed files with 9 additions and 3 deletions
|
@ -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 __
|
||||
|
|
Loading…
Reference in a new issue