From 6df38242ae86d27c1a48742a05a801e211e6b703 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Thu, 3 Mar 2016 11:18:40 -0800 Subject: [PATCH] Ignore checked mode when running from a precompilation snapshot. --- sky/build/SnapshotterInvoke | 6 ++++++ sky/engine/core/script/dart_init.cc | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sky/build/SnapshotterInvoke b/sky/build/SnapshotterInvoke index 5ab7c10fd36..0909015d6df 100755 --- a/sky/build/SnapshotterInvoke +++ b/sky/build/SnapshotterInvoke @@ -122,6 +122,11 @@ SnapshotProject() { # snapshot buffer and isolate snapshot buffer, we name the file to match # the name of the symbol the VM expects at runtime. On these binary files, # we invoke xxd. + # + # Note about "checked mode": Precompilation snapshots are never in checked + # mode. The flag is also ignored by the standalone VM. So there is no sense + # in generating the larger snapshot. For development purposes, a + # non-precompilation enabled VM is used. RunCommand ${FLUTTER_ARCH_TOOLS_PATH}/Snapshotter \ --vm_isolate_snapshot=${derived_dir}/kDartVmIsolateSnapshotBuffer \ --isolate_snapshot=${derived_dir}/kDartIsolateSnapshotBuffer \ @@ -131,6 +136,7 @@ SnapshotProject() { --url_mapping=dart:mojo.internal,${mojo_internal_path} \ --url_mapping=dart:ui,${ui_path} \ --url_mapping=dart:vmservice_sky,$vm_service_path \ + --no-checked \ $main_path if [[ $? -ne 0 ]]; then diff --git a/sky/engine/core/script/dart_init.cc b/sky/engine/core/script/dart_init.cc index 1b31b9287b4..cdfc4991d52 100644 --- a/sky/engine/core/script/dart_init.cc +++ b/sky/engine/core/script/dart_init.cc @@ -68,9 +68,6 @@ namespace { static const char* kDartArgs[] = { "--enable_mirrors=false", - // Dart assumes ARM devices are insufficiently powerful and sets the - // default profile period to 100Hz. This number is suitable for older - // Raspberry Pi devices but quite low for current smartphones. "--profile_period=1000", "--background_compilation", #if (WTF_OS_IOS || WTF_OS_MACOSX) @@ -316,6 +313,10 @@ void InitDartVM() { enable_checked_mode = true; #endif + if (IsRunningPrecompiledCode()) { + enable_checked_mode = false; + } + Vector args; args.append(kDartArgs, arraysize(kDartArgs));