mirror of
https://github.com/dart-lang/sdk
synced 2024-10-06 14:49:43 +00:00
AOT compiler changes for dart_content_handler:
- Move some misplaced entry points from the vm list to the standalone embedder list. - Add missing libdart_with_precompiler to GN. - Add ability to reference the root library in treeshaking roots without knowing its URI (as ::). R=zra@google.com Review-Url: https://codereview.chromium.org/2786483002 .
This commit is contained in:
parent
1944172f47
commit
9575657668
|
@ -278,6 +278,14 @@ libdart_library("libdart_nosnapshot_with_precompiler") {
|
|||
]
|
||||
}
|
||||
|
||||
libdart_library("libdart_with_precompiler") {
|
||||
extra_configs = [ ":dart_precompiler_config" ]
|
||||
extra_deps = [
|
||||
"vm:libdart_lib_with_precompiler",
|
||||
"vm:libdart_vm_with_precompiler",
|
||||
]
|
||||
}
|
||||
|
||||
action("generate_version_cc_file") {
|
||||
deps = [
|
||||
":libdart_dependency_helper",
|
||||
|
|
|
@ -1323,15 +1323,16 @@ bool RunMainIsolate(const char* script_name, CommandLineOptions* dart_options) {
|
|||
{"dart:_builtin", "::", "_getMainClosure"},
|
||||
{"dart:_builtin", "::", "_getPrintClosure"},
|
||||
{"dart:_builtin", "::", "_getUriBaseClosure"},
|
||||
{"dart:_builtin", "::", "_libraryFilePath"},
|
||||
{"dart:_builtin", "::", "_resolveInWorkingDirectory"},
|
||||
{"dart:_builtin", "::", "_setWorkingDirectory"},
|
||||
{"dart:_builtin", "::", "_setPackageRoot"},
|
||||
{"dart:_builtin", "::", "_setPackagesMap"},
|
||||
{"dart:_builtin", "::", "_libraryFilePath"},
|
||||
{"dart:io", "::", "_makeUint8ListView"},
|
||||
{"dart:io", "::", "_makeDatagram"},
|
||||
{"dart:io", "::", "_setupHooks"},
|
||||
{"dart:_builtin", "::", "_setWorkingDirectory"},
|
||||
{"dart:async", "::", "_setScheduleImmediateClosure"},
|
||||
{"dart:io", "::", "_getWatchSignalInternal"},
|
||||
{"dart:io", "::", "_makeDatagram"},
|
||||
{"dart:io", "::", "_makeUint8ListView"},
|
||||
{"dart:io", "::", "_setupHooks"},
|
||||
{"dart:io", "CertificateException", "CertificateException."},
|
||||
{"dart:io", "Directory", "Directory."},
|
||||
{"dart:io", "File", "File."},
|
||||
|
@ -1341,17 +1342,20 @@ bool RunMainIsolate(const char* script_name, CommandLineOptions* dart_options) {
|
|||
{"dart:io", "OSError", "OSError."},
|
||||
{"dart:io", "TlsException", "TlsException."},
|
||||
{"dart:io", "X509Certificate", "X509Certificate._"},
|
||||
{"dart:io", "_ExternalBuffer", "set:data"},
|
||||
{"dart:io", "_ExternalBuffer", "get:start"},
|
||||
{"dart:io", "_ExternalBuffer", "set:start"},
|
||||
{"dart:io", "_ExternalBuffer", "get:end"},
|
||||
{"dart:io", "_ExternalBuffer", "get:start"},
|
||||
{"dart:io", "_ExternalBuffer", "set:data"},
|
||||
{"dart:io", "_ExternalBuffer", "set:end"},
|
||||
{"dart:io", "_ExternalBuffer", "set:start"},
|
||||
{"dart:io", "_Platform", "set:_nativeScript"},
|
||||
{"dart:io", "_ProcessStartStatus", "set:_errorCode"},
|
||||
{"dart:io", "_ProcessStartStatus", "set:_errorMessage"},
|
||||
{"dart:io", "_SecureFilterImpl", "get:buffers"},
|
||||
{"dart:io", "_SecureFilterImpl", "get:ENCRYPTED_SIZE"},
|
||||
{"dart:io", "_SecureFilterImpl", "get:SIZE"},
|
||||
{"dart:io", "_SecureFilterImpl", "get:buffers"},
|
||||
{"dart:isolate", "::", "_getIsolateScheduleImmediateClosure"},
|
||||
{"dart:isolate", "::", "_setupHooks"},
|
||||
{"dart:isolate", "::", "_startMainIsolate"},
|
||||
{"dart:vmservice_io", "::", "main"},
|
||||
{NULL, NULL, NULL} // Must be terminated with NULL entries.
|
||||
};
|
||||
|
|
|
@ -102,6 +102,21 @@ static_library("libdart_vm_nosnapshot_with_precompiler") {
|
|||
include_dirs = [ ".." ]
|
||||
}
|
||||
|
||||
static_library("libdart_vm_with_precompiler") {
|
||||
configs += [
|
||||
"..:dart_config",
|
||||
"..:dart_maybe_product_config",
|
||||
"..:dart_precompiler_config",
|
||||
]
|
||||
public_configs = [ ":libdart_vm_config" ]
|
||||
set_sources_assignment_filter([
|
||||
"*_test.cc",
|
||||
"*_test.h",
|
||||
])
|
||||
sources = vm_sources_list
|
||||
include_dirs = [ ".." ]
|
||||
}
|
||||
|
||||
template("process_library_source") {
|
||||
assert(defined(invoker.libsources), "Need libsources in $target_name")
|
||||
assert(defined(invoker.output), "Need output in $target_name")
|
||||
|
@ -217,6 +232,16 @@ template("generate_core_libraries") {
|
|||
sources = all_libsources + [ "bootstrap.cc" ] + liboutputs
|
||||
include_dirs = [ ".." ]
|
||||
}
|
||||
static_library("libdart_lib_with_precompiler") {
|
||||
configs += [
|
||||
"..:dart_config",
|
||||
"..:dart_maybe_product_config",
|
||||
"..:dart_precompiler_config",
|
||||
]
|
||||
deps = libdeps
|
||||
sources = all_libsources + [ "bootstrap_nocore.cc" ]
|
||||
include_dirs = [ ".." ]
|
||||
}
|
||||
static_library("libdart_lib") {
|
||||
configs += [
|
||||
"..:dart_config",
|
||||
|
|
|
@ -653,7 +653,6 @@ void Precompiler::AddRoots(Dart_QualifiedFunctionName embedder_entry_points[]) {
|
|||
|
||||
Dart_QualifiedFunctionName vm_entry_points[] = {
|
||||
// Functions
|
||||
{"dart:async", "::", "_setScheduleImmediateClosure"},
|
||||
{"dart:core", "::", "_completeDeferredLoads"},
|
||||
{"dart:core", "AbstractClassInstantiationError",
|
||||
"AbstractClassInstantiationError._create"},
|
||||
|
@ -674,9 +673,6 @@ void Precompiler::AddRoots(Dart_QualifiedFunctionName embedder_entry_points[]) {
|
|||
{"dart:core", "_InvocationMirror", "_allocateInvocationMirror"},
|
||||
{"dart:core", "_TypeError", "_TypeError._create"},
|
||||
{"dart:isolate", "IsolateSpawnException", "IsolateSpawnException."},
|
||||
{"dart:isolate", "::", "_getIsolateScheduleImmediateClosure"},
|
||||
{"dart:isolate", "::", "_setupHooks"},
|
||||
{"dart:isolate", "::", "_startMainIsolate"},
|
||||
{"dart:isolate", "::", "_startIsolate"},
|
||||
{"dart:isolate", "_RawReceivePortImpl", "_handleMessage"},
|
||||
{"dart:isolate", "_RawReceivePortImpl", "_lookupHandler"},
|
||||
|
@ -716,7 +712,11 @@ void Precompiler::AddEntryPoints(Dart_QualifiedFunctionName entry_points[]) {
|
|||
class_name = Symbols::New(thread(), entry_points[i].class_name);
|
||||
function_name = Symbols::New(thread(), entry_points[i].function_name);
|
||||
|
||||
lib = Library::LookupLibrary(T, library_uri);
|
||||
if (library_uri.raw() == Symbols::TopLevel().raw()) {
|
||||
lib = I->object_store()->root_library();
|
||||
} else {
|
||||
lib = Library::LookupLibrary(T, library_uri);
|
||||
}
|
||||
if (lib.IsNull()) {
|
||||
String& msg =
|
||||
String::Handle(Z, String::NewFormatted("Cannot find entry point %s\n",
|
||||
|
|
Loading…
Reference in a new issue