mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[VM/runtime] - Remove DART_NO_SNAPSHOT
- Remove the define DART_NO_SNAPSHOT in all the build configs - Remove all conditional code under DART_NO_SNAPSHOT Change-Id: Ia01d09de7c4b1813a5e172a630950e637e476713 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130566 Commit-Queue: Siva Annamalai <asiva@google.com> Reviewed-by: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
a67fd37193
commit
ac4b43f0a8
|
@ -59,11 +59,6 @@ config("dart_precompiler_config") {
|
|||
defines += [ "DART_PRECOMPILER" ]
|
||||
}
|
||||
|
||||
config("dart_nosnapshot_config") {
|
||||
defines = []
|
||||
defines += [ "DART_NO_SNAPSHOT" ]
|
||||
}
|
||||
|
||||
config("dart_os_config") {
|
||||
defines = []
|
||||
|
||||
|
|
|
@ -241,8 +241,8 @@ build_gen_snapshot("gen_snapshot") {
|
|||
extra_deps = [
|
||||
":gen_snapshot_dart_io",
|
||||
":libdart_builtin",
|
||||
"../platform:libdart_platform_nosnapshot_with_precompiler",
|
||||
"..:libdart_nosnapshot_with_precompiler",
|
||||
"../platform:libdart_platform_precompiler",
|
||||
"..:libdart_precompiler",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -255,8 +255,8 @@ build_gen_snapshot("gen_snapshot_product") {
|
|||
extra_deps = [
|
||||
":gen_snapshot_dart_io_product",
|
||||
":libdart_builtin_product",
|
||||
"../platform:libdart_platform_nosnapshot_with_precompiler_product",
|
||||
"..:libdart_nosnapshot_with_precompiler_product",
|
||||
"../platform:libdart_platform_precompiler_product",
|
||||
"..:libdart_precompiler_product",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -269,8 +269,8 @@ build_gen_snapshot("gen_snapshot_fuchsia") {
|
|||
extra_deps = [
|
||||
":gen_snapshot_dart_io_fuchsia",
|
||||
":libdart_builtin_fuchsia",
|
||||
"../platform:libdart_platform_nosnapshot_with_precompiler_fuchsia",
|
||||
"..:libdart_nosnapshot_with_precompiler_fuchsia",
|
||||
"../platform:libdart_platform_precompiler_fuchsia",
|
||||
"..:libdart_precompiler_fuchsia",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -283,8 +283,8 @@ build_gen_snapshot("gen_snapshot_product_fuchsia") {
|
|||
extra_deps = [
|
||||
":gen_snapshot_dart_io_product_fuchsia",
|
||||
":libdart_builtin_product_fuchsia",
|
||||
"../platform:libdart_platform_nosnapshot_with_precompiler_product_fuchsia",
|
||||
"..:libdart_nosnapshot_with_precompiler_product_fuchsia",
|
||||
"../platform:libdart_platform_precompiler_product_fuchsia",
|
||||
"..:libdart_precompiler_product_fuchsia",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -293,8 +293,8 @@ build_gen_snapshot("gen_snapshot_host_targeting_host") {
|
|||
extra_deps = [
|
||||
":gen_snapshot_dart_io_host_targeting_host",
|
||||
":libdart_builtin_host_targeting_host",
|
||||
"../platform:libdart_platform_nosnapshot_with_precompiler_host_targeting_host",
|
||||
"..:libdart_nosnapshot_with_precompiler_host_targeting_host",
|
||||
"../platform:libdart_platform_precompiler_host_targeting_host",
|
||||
"..:libdart_precompiler_host_targeting_host",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -303,8 +303,8 @@ build_gen_snapshot("gen_snapshot_product_host_targeting_host") {
|
|||
extra_deps = [
|
||||
":gen_snapshot_dart_io_host_targeting_host",
|
||||
":libdart_builtin_host_targeting_host",
|
||||
"../platform:libdart_platform_nosnapshot_with_precompiler_host_targeting_host",
|
||||
"..:libdart_nosnapshot_with_precompiler_host_targeting_host",
|
||||
"../platform:libdart_platform_precompiler_host_targeting_host",
|
||||
"..:libdart_precompiler_host_targeting_host",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -991,7 +991,7 @@ executable("run_vm_tests") {
|
|||
":gen_kernel_bytecode_dill",
|
||||
":generate_abi_version_cc_file",
|
||||
":standalone_dart_io",
|
||||
"..:libdart_nosnapshot_with_precompiler",
|
||||
"..:libdart_precompiler",
|
||||
"//third_party/zlib",
|
||||
]
|
||||
if (defined(checkout_llvm) && checkout_llvm) {
|
||||
|
|
|
@ -85,7 +85,7 @@ DFE::DFE()
|
|||
//
|
||||
// Only on X64 do we have kernel-service.dart.snapshot available otherwise we
|
||||
// need to fall back to the built-in one (if we have it).
|
||||
#if defined(EXCLUDE_CFE_AND_KERNEL_PLATFORM) || defined(DART_NO_SNAPSHOT) || \
|
||||
#if defined(EXCLUDE_CFE_AND_KERNEL_PLATFORM) || \
|
||||
(defined(DART_PRECOMPILER) && defined(TARGET_ARCH_X64))
|
||||
kernel_service_dill_ = nullptr;
|
||||
kernel_service_dill_size_ = 0;
|
||||
|
|
|
@ -48,19 +48,12 @@ extern const uint8_t kDartCoreIsolateSnapshotInstructions[];
|
|||
namespace dart {
|
||||
namespace bin {
|
||||
|
||||
// Snapshot pieces if we link in a snapshot, otherwise initialized to NULL.
|
||||
#if defined(DART_NO_SNAPSHOT)
|
||||
const uint8_t* vm_snapshot_data = NULL;
|
||||
const uint8_t* vm_snapshot_instructions = NULL;
|
||||
const uint8_t* core_isolate_snapshot_data = NULL;
|
||||
const uint8_t* core_isolate_snapshot_instructions = NULL;
|
||||
#else
|
||||
// Snapshot pieces we link in a snapshot.
|
||||
const uint8_t* vm_snapshot_data = kDartVmSnapshotData;
|
||||
const uint8_t* vm_snapshot_instructions = kDartVmSnapshotInstructions;
|
||||
const uint8_t* core_isolate_snapshot_data = kDartCoreIsolateSnapshotData;
|
||||
const uint8_t* core_isolate_snapshot_instructions =
|
||||
kDartCoreIsolateSnapshotInstructions;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Global state used to control and store generation of application snapshots.
|
||||
|
|
|
@ -30,15 +30,11 @@ extern const uint8_t kDartCoreIsolateSnapshotInstructions[];
|
|||
namespace dart {
|
||||
|
||||
// Snapshot pieces when we link in a snapshot.
|
||||
#if defined(DART_NO_SNAPSHOT)
|
||||
#error "run_vm_tests must be built with a snapshot"
|
||||
#else
|
||||
const uint8_t* bin::vm_snapshot_data = kDartVmSnapshotData;
|
||||
const uint8_t* bin::vm_snapshot_instructions = kDartVmSnapshotInstructions;
|
||||
const uint8_t* bin::core_isolate_snapshot_data = kDartCoreIsolateSnapshotData;
|
||||
const uint8_t* bin::core_isolate_snapshot_instructions =
|
||||
kDartCoreIsolateSnapshotInstructions;
|
||||
#endif
|
||||
|
||||
// Only run tests that match the filter string. The default does not match any
|
||||
// tests.
|
||||
|
|
|
@ -42,29 +42,23 @@ _precompiled_runtime_product_config =
|
|||
"$_dart_runtime:dart_product_config",
|
||||
]
|
||||
|
||||
_nosnapshot_precompiler_base = [
|
||||
"$_dart_runtime:dart_nosnapshot_config",
|
||||
"$_dart_runtime:dart_precompiler_config",
|
||||
]
|
||||
_precompiler_base = [ "$_dart_runtime:dart_precompiler_config" ]
|
||||
|
||||
_nosnapshot_with_precompiler_config =
|
||||
_base_config + _nosnapshot_precompiler_base + _maybe_product
|
||||
_precompiler_config = _base_config + _precompiler_base + _maybe_product
|
||||
|
||||
_nosnapshot_with_precompiler_product_config =
|
||||
_base_config + _nosnapshot_precompiler_base + _product
|
||||
_precompiler_product_config = _base_config + _precompiler_base + _product
|
||||
|
||||
_nosnapshot_with_precompiler_fuchsia_config =
|
||||
_base_fuchsia_config + _nosnapshot_precompiler_base + _maybe_product
|
||||
_precompiler_fuchsia_config =
|
||||
_base_fuchsia_config + _precompiler_base + _maybe_product
|
||||
|
||||
_nosnapshot_with_precompiler_product_fuchsia_config =
|
||||
_base_fuchsia_config + _nosnapshot_precompiler_base + _product
|
||||
_precompiler_product_fuchsia_config =
|
||||
_base_fuchsia_config + _precompiler_base + _product
|
||||
|
||||
_nosnapshot_with_precompiler_host_targeting_host_config =
|
||||
_base_host_targeting_host_config + _nosnapshot_precompiler_base +
|
||||
_maybe_product
|
||||
_precompiler_host_targeting_host_config =
|
||||
_base_host_targeting_host_config + _precompiler_base + _maybe_product
|
||||
|
||||
_nosnapshot_with_precompiler_product_host_targeting_host_config =
|
||||
_base_host_targeting_host_config + _nosnapshot_precompiler_base + _product
|
||||
_precompiler_product_host_targeting_host_config =
|
||||
_base_host_targeting_host_config + _precompiler_base + _product
|
||||
|
||||
_all_configs = [
|
||||
{
|
||||
|
@ -88,33 +82,33 @@ _all_configs = [
|
|||
snapshot = true
|
||||
},
|
||||
{
|
||||
suffix = "_nosnapshot_with_precompiler"
|
||||
configs = _nosnapshot_with_precompiler_config
|
||||
suffix = "_precompiler"
|
||||
configs = _precompiler_config
|
||||
snapshot = false
|
||||
},
|
||||
{
|
||||
suffix = "_nosnapshot_with_precompiler_product"
|
||||
configs = _nosnapshot_with_precompiler_product_config
|
||||
suffix = "_precompiler_product"
|
||||
configs = _precompiler_product_config
|
||||
snapshot = false
|
||||
},
|
||||
{
|
||||
suffix = "_nosnapshot_with_precompiler_fuchsia"
|
||||
configs = _nosnapshot_with_precompiler_fuchsia_config
|
||||
suffix = "_precompiler_fuchsia"
|
||||
configs = _precompiler_fuchsia_config
|
||||
snapshot = false
|
||||
},
|
||||
{
|
||||
suffix = "_nosnapshot_with_precompiler_product_fuchsia"
|
||||
configs = _nosnapshot_with_precompiler_product_fuchsia_config
|
||||
suffix = "_precompiler_product_fuchsia"
|
||||
configs = _precompiler_product_fuchsia_config
|
||||
snapshot = false
|
||||
},
|
||||
{
|
||||
suffix = "_nosnapshot_with_precompiler_host_targeting_host"
|
||||
configs = _nosnapshot_with_precompiler_host_targeting_host_config
|
||||
suffix = "_precompiler_host_targeting_host"
|
||||
configs = _precompiler_host_targeting_host_config
|
||||
snapshot = false
|
||||
},
|
||||
{
|
||||
suffix = "_nosnapshot_with_precompiler_product_host_targeting_host"
|
||||
configs = _nosnapshot_with_precompiler_product_host_targeting_host_config
|
||||
suffix = "_precompiler_product_host_targeting_host"
|
||||
configs = _precompiler_product_host_targeting_host_config
|
||||
snapshot = false
|
||||
},
|
||||
{
|
||||
|
@ -155,12 +149,6 @@ _all_configs = [
|
|||
# snapshot_sources (optional):
|
||||
# Additional sources to include when the configuration has a snapshot.
|
||||
#
|
||||
# nosnapshot_sources (optional):
|
||||
# Additional sources to include when the configuration does not have a
|
||||
# snapshot (that is, one of the "nosnapshot" configurations above).
|
||||
#
|
||||
# nosnapshot_deps (optional):
|
||||
# Similar to nosnapshot_sources, but for deps.
|
||||
template("library_for_all_configs") {
|
||||
assert(defined(invoker.target_type))
|
||||
extra_configs = []
|
||||
|
@ -194,22 +182,10 @@ template("library_for_all_configs") {
|
|||
if (defined(snapshot_sources)) {
|
||||
sources += snapshot_sources
|
||||
}
|
||||
if (defined(nosnapshot_sources)) {
|
||||
not_needed([ "nosnapshot_sources" ])
|
||||
}
|
||||
if (defined(nosnapshot_deps)) {
|
||||
not_needed([ "nosnapshot_deps" ])
|
||||
}
|
||||
} else {
|
||||
if (defined(snapshot_sources)) {
|
||||
not_needed([ "snapshot_sources" ])
|
||||
}
|
||||
if (defined(nosnapshot_sources)) {
|
||||
sources += nosnapshot_sources
|
||||
}
|
||||
if (defined(nosnapshot_deps)) {
|
||||
deps += nosnapshot_deps
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,7 +120,6 @@ library_for_all_configs("libdart_lib") {
|
|||
ffi_runtime_cc_files + wasm_runtime_cc_files
|
||||
sources = [ "bootstrap.cc" ] + rebase_path(allsources, ".", "../lib")
|
||||
snapshot_sources = []
|
||||
nosnapshot_sources = []
|
||||
}
|
||||
|
||||
template("gen_vm_platform") {
|
||||
|
|
|
@ -330,8 +330,6 @@ char* Dart::Init(const uint8_t* vm_isolate_snapshot,
|
|||
} else {
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
return strdup("Precompiled runtime requires a precompiled snapshot");
|
||||
#elif !defined(DART_NO_SNAPSHOT)
|
||||
return strdup("Missing vm isolate snapshot");
|
||||
#else
|
||||
vm_snapshot_kind_ = Snapshot::kNone;
|
||||
StubCode::Init();
|
||||
|
|
|
@ -66,12 +66,12 @@ namespace dart {
|
|||
|
||||
DECLARE_FLAG(bool, print_class_table);
|
||||
DECLARE_FLAG(bool, verify_handles);
|
||||
#if defined(DART_NO_SNAPSHOT)
|
||||
#if defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME)
|
||||
DEFINE_FLAG(bool,
|
||||
check_function_fingerprints,
|
||||
true,
|
||||
"Check function fingerprints");
|
||||
#endif // defined(DART_NO_SNAPSHOT).
|
||||
#endif // defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME).
|
||||
DEFINE_FLAG(bool,
|
||||
verify_acquired_data,
|
||||
false,
|
||||
|
@ -1122,11 +1122,11 @@ static Dart_Isolate CreateIsolate(IsolateGroup* group,
|
|||
source->kernel_buffer,
|
||||
source->kernel_buffer_size, isolate_data));
|
||||
if (error_obj.IsNull()) {
|
||||
#if defined(DART_NO_SNAPSHOT) && !defined(PRODUCT)
|
||||
#if defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME)
|
||||
if (FLAG_check_function_fingerprints && source->kernel_buffer == NULL) {
|
||||
Library::CheckFunctionFingerprints();
|
||||
}
|
||||
#endif // defined(DART_NO_SNAPSHOT) && !defined(PRODUCT).
|
||||
#endif // defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME).
|
||||
success = true;
|
||||
} else if (error != NULL) {
|
||||
*error = strdup(error_obj.ToErrorCString());
|
||||
|
|
|
@ -1545,31 +1545,26 @@ void Object::RegisterPrivateClass(const Class& cls,
|
|||
// There are three possibilities:
|
||||
// 1. Running a Kernel binary. This function will bootstrap from the KERNEL
|
||||
// file.
|
||||
// 2. There is no snapshot. This function will bootstrap from source.
|
||||
// 3. There is a snapshot. The caller should initialize from the snapshot.
|
||||
// 2. There is no vm snapshot. This function will bootstrap from source.
|
||||
// 3. There is a vm snapshot. The caller should initialize from the snapshot.
|
||||
//
|
||||
// A non-NULL kernel argument indicates (1). A NULL kernel indicates (2) or
|
||||
// (3), depending on whether the VM is compiled with DART_NO_SNAPSHOT defined or
|
||||
// not.
|
||||
// A non-NULL kernel argument indicates (1).
|
||||
// A NULL kernel indicates (2) or (3).
|
||||
RawError* Object::Init(Isolate* isolate,
|
||||
const uint8_t* kernel_buffer,
|
||||
intptr_t kernel_buffer_size) {
|
||||
Thread* thread = Thread::Current();
|
||||
Zone* zone = thread->zone();
|
||||
ASSERT(isolate == thread->isolate());
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
const bool is_kernel = (kernel_buffer != NULL);
|
||||
#endif
|
||||
TIMELINE_DURATION(thread, Isolate, "Object::Init");
|
||||
|
||||
#if defined(DART_NO_SNAPSHOT)
|
||||
bool bootstrapping =
|
||||
(Dart::vm_snapshot_kind() == Snapshot::kNone) || is_kernel;
|
||||
#elif defined(DART_PRECOMPILED_RUNTIME)
|
||||
bool bootstrapping = false;
|
||||
#if defined(DART_PRECOMPILED_RUNTIME)
|
||||
const bool bootstrapping = false;
|
||||
#else
|
||||
bool bootstrapping = is_kernel;
|
||||
#endif
|
||||
const bool is_kernel = (kernel_buffer != NULL);
|
||||
const bool bootstrapping =
|
||||
(Dart::vm_snapshot_kind() == Snapshot::kNone) || is_kernel;
|
||||
#endif // defined(DART_PRECOMPILED_RUNTIME).
|
||||
|
||||
if (bootstrapping) {
|
||||
#if !defined(DART_PRECOMPILED_RUNTIME)
|
||||
|
@ -12607,7 +12602,7 @@ RawObject* Library::GetFunctionClosure(const String& name) const {
|
|||
return func.ImplicitStaticClosure();
|
||||
}
|
||||
|
||||
#if defined(DART_NO_SNAPSHOT) && !defined(PRODUCT)
|
||||
#if defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME)
|
||||
void Library::CheckFunctionFingerprints() {
|
||||
GrowableArray<Library*> all_libs;
|
||||
Function& func = Function::Handle();
|
||||
|
@ -12671,7 +12666,7 @@ void Library::CheckFunctionFingerprints() {
|
|||
FATAL("Fingerprint mismatch.");
|
||||
}
|
||||
}
|
||||
#endif // defined(DART_NO_SNAPSHOT) && !defined(PRODUCT).
|
||||
#endif // defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME).
|
||||
|
||||
RawInstructions* Instructions::New(intptr_t size, bool has_single_entry_point) {
|
||||
ASSERT(size >= 0);
|
||||
|
|
|
@ -4470,11 +4470,11 @@ class Library : public Object {
|
|||
static RawError* ReadAllBytecode();
|
||||
#endif
|
||||
|
||||
#if defined(DART_NO_SNAPSHOT)
|
||||
#if defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME)
|
||||
// Checks function fingerprints. Prints mismatches and aborts if
|
||||
// mismatch found.
|
||||
static void CheckFunctionFingerprints();
|
||||
#endif // defined(DART_NO_SNAPSHOT).
|
||||
#endif // defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME).
|
||||
|
||||
static bool IsPrivate(const String& name);
|
||||
|
||||
|
|
Loading…
Reference in a new issue