From bd85deaf4eabdb83f0adf242432ffd49535b6b59 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Wed, 24 Feb 2016 18:08:01 -0800 Subject: [PATCH] Revert "Move precompilation-related flags to flags list." The default value of print_stop_message was architecture specific. TBR=fschneider@google.com Review URL: https://codereview.chromium.org/1739593002 . --- runtime/bin/gen_snapshot.cc | 3 - runtime/bin/main.cc | 9 -- runtime/lib/regexp.cc | 1 + runtime/vm/aot_optimizer.cc | 14 +-- runtime/vm/assembler_arm.cc | 3 + runtime/vm/assembler_arm64.cc | 2 + runtime/vm/assembler_ia32.cc | 1 + runtime/vm/assembler_mips.cc | 3 + runtime/vm/assembler_x64.cc | 3 + runtime/vm/benchmark_test.cc | 11 +- runtime/vm/block_scheduler.cc | 2 + runtime/vm/code_descriptors.cc | 4 +- runtime/vm/code_generator.cc | 13 ++- runtime/vm/compiler.cc | 15 +-- runtime/vm/compiler_test.cc | 5 +- runtime/vm/constant_propagator.cc | 2 + runtime/vm/dart_api_impl.cc | 6 +- runtime/vm/dart_api_impl_test.cc | 7 +- runtime/vm/debugger.cc | 3 +- runtime/vm/debugger_api_impl_test.cc | 3 + runtime/vm/flag_list.h | 41 +------- runtime/vm/flags.cc | 1 - runtime/vm/flow_graph.cc | 1 + runtime/vm/flow_graph_builder.cc | 2 + runtime/vm/flow_graph_compiler.cc | 119 ++++++++++++---------- runtime/vm/flow_graph_compiler_arm.cc | 5 +- runtime/vm/flow_graph_compiler_arm64.cc | 5 +- runtime/vm/flow_graph_compiler_ia32.cc | 5 +- runtime/vm/flow_graph_compiler_mips.cc | 5 +- runtime/vm/flow_graph_compiler_x64.cc | 5 +- runtime/vm/flow_graph_inliner.cc | 7 +- runtime/vm/flow_graph_range_analysis.cc | 3 +- runtime/vm/flow_graph_type_propagator.cc | 1 + runtime/vm/il_printer.cc | 3 - runtime/vm/intermediate_language.cc | 5 + runtime/vm/intermediate_language_arm.cc | 8 +- runtime/vm/intermediate_language_arm64.cc | 8 +- runtime/vm/intermediate_language_ia32.cc | 4 + runtime/vm/intermediate_language_mips.cc | 8 +- runtime/vm/intermediate_language_x64.cc | 8 +- runtime/vm/intrinsifier_arm.cc | 2 + runtime/vm/intrinsifier_arm64.cc | 2 + runtime/vm/intrinsifier_ia32.cc | 2 + runtime/vm/intrinsifier_mips.cc | 2 + runtime/vm/intrinsifier_x64.cc | 2 + runtime/vm/native_arguments.h | 1 + runtime/vm/object.cc | 5 +- runtime/vm/pages.cc | 2 + runtime/vm/pages.h | 1 + runtime/vm/parser.cc | 9 ++ runtime/vm/precompiler.cc | 11 +- runtime/vm/profiler_test.cc | 1 + runtime/vm/raw_object_snapshot.cc | 3 + runtime/vm/redundancy_elimination.cc | 5 +- runtime/vm/regexp.cc | 2 + runtime/vm/snapshot.cc | 3 + runtime/vm/snapshot_test.cc | 9 +- runtime/vm/stub_code_arm.cc | 1 + runtime/vm/stub_code_arm64.cc | 1 + runtime/vm/stub_code_ia32.cc | 1 + runtime/vm/stub_code_mips.cc | 1 + runtime/vm/stub_code_x64.cc | 1 + runtime/vm/weak_code.cc | 4 +- 63 files changed, 253 insertions(+), 172 deletions(-) diff --git a/runtime/bin/gen_snapshot.cc b/runtime/bin/gen_snapshot.cc index ea9f3d7bf0a..f1f7e2ccce5 100644 --- a/runtime/bin/gen_snapshot.cc +++ b/runtime/bin/gen_snapshot.cc @@ -1014,10 +1014,7 @@ int main(int argc, char** argv) { TimerUtils::InitOnce(); EventHandler::Start(); -#if !defined(PRODUCT) - // Constant true in PRODUCT mode. vm_options.AddArgument("--load_deferred_eagerly"); -#endif if (IsSnapshottingForPrecompilation()) { vm_options.AddArgument("--precompilation"); diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc index bb21b9f3cee..46424869368 100644 --- a/runtime/bin/main.cc +++ b/runtime/bin/main.cc @@ -340,10 +340,7 @@ static bool ProcessGenPrecompiledSnapshotOption( precompiled_snapshot_directory = arg; } gen_precompiled_snapshot = true; -#if !defined(DART_PRECOMPILED_RUNTIME) - // The precompiled runtime has FLAG_precompilation set as const. vm_options->AddArgument("--precompilation"); -#endif return true; } @@ -358,10 +355,7 @@ static bool ProcessRunPrecompiledSnapshotOption( precompiled_snapshot_directory = &precompiled_snapshot_directory[1]; } run_precompiled_snapshot = true; -#if !defined(DART_PRECOMPILED_RUNTIME) - // The precompiled runtime has FLAG_precompilation set as const. vm_options->AddArgument("--precompilation"); -#endif return true; } @@ -1562,14 +1556,11 @@ void main(int argc, char** argv) { Platform::Exit(kErrorExitCode); } -#if !defined(PRODUCT) - // Constant true in PRODUCT mode. if (generate_script_snapshot || generate_full_snapshot_after_run || run_full_snapshot) { vm_options.AddArgument("--load_deferred_eagerly"); } -#endif #if defined(DART_PRECOMPILER) && !defined(DART_NO_SNAPSHOT) // Always set --precompilation with dart_noopt. diff --git a/runtime/lib/regexp.cc b/runtime/lib/regexp.cc index 47b42451af2..14bf14f4eba 100644 --- a/runtime/lib/regexp.cc +++ b/runtime/lib/regexp.cc @@ -15,6 +15,7 @@ namespace dart { DECLARE_FLAG(bool, trace_irregexp); +DECLARE_FLAG(bool, interpret_irregexp); DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_factory, 4) { diff --git a/runtime/vm/aot_optimizer.cc b/runtime/vm/aot_optimizer.cc index 09582888ce4..f9f9c243f22 100644 --- a/runtime/vm/aot_optimizer.cc +++ b/runtime/vm/aot_optimizer.cc @@ -29,6 +29,8 @@ namespace dart { +DECLARE_FLAG(bool, precompilation); + // Quick access to the current isolate and zone. #define I (isolate()) #define Z (zone()) @@ -2032,7 +2034,7 @@ bool AotOptimizer::TryInlineFloat32x4Constructor( StaticCallInstr* call, MethodRecognizer::Kind recognized_kind) { // Cannot handle unboxed instructions. - ASSERT(FLAG_precompiled_mode); + ASSERT(FLAG_precompilation); return false; } @@ -2041,7 +2043,7 @@ bool AotOptimizer::TryInlineFloat64x2Constructor( StaticCallInstr* call, MethodRecognizer::Kind recognized_kind) { // Cannot handle unboxed instructions. - ASSERT(FLAG_precompiled_mode); + ASSERT(FLAG_precompilation); return false; } @@ -2050,7 +2052,7 @@ bool AotOptimizer::TryInlineInt32x4Constructor( StaticCallInstr* call, MethodRecognizer::Kind recognized_kind) { // Cannot handle unboxed instructions. - ASSERT(FLAG_precompiled_mode); + ASSERT(FLAG_precompilation); return false; } @@ -2547,7 +2549,7 @@ void AotOptimizer::InstanceCallNoopt(InstanceCallInstr* instr) { // Tries to optimize instance call by replacing it with a faster instruction // (e.g, binary op, field load, ..). void AotOptimizer::VisitInstanceCall(InstanceCallInstr* instr) { - ASSERT(FLAG_precompiled_mode); + ASSERT(FLAG_precompilation); InstanceCallNoopt(instr); } @@ -2574,7 +2576,7 @@ void AotOptimizer::VisitStaticCall(StaticCallInstr* call) { break; } if (unary_kind != MathUnaryInstr::kIllegal) { - ASSERT(FLAG_precompiled_mode); + ASSERT(FLAG_precompilation); // TODO(srdjan): Adapt MathUnaryInstr to allow tagged inputs as well. return; } @@ -2654,7 +2656,7 @@ void AotOptimizer::VisitStaticCall(StaticCallInstr* call) { case MethodRecognizer::kMathAcos: case MethodRecognizer::kMathAtan: case MethodRecognizer::kMathAtan2: { - ASSERT(FLAG_precompiled_mode); + ASSERT(FLAG_precompilation); // No UnboxDouble instructions allowed. return; } diff --git a/runtime/vm/assembler_arm.cc b/runtime/vm/assembler_arm.cc index 16f266215e2..aa673d95e2b 100644 --- a/runtime/vm/assembler_arm.cc +++ b/runtime/vm/assembler_arm.cc @@ -21,9 +21,12 @@ namespace dart { +DECLARE_FLAG(bool, allow_absolute_addresses); DECLARE_FLAG(bool, check_code_pointer); DECLARE_FLAG(bool, inline_alloc); +DEFINE_FLAG(bool, print_stop_message, true, "Print stop message."); + uint32_t Address::encoding3() const { if (kind_ == Immediate) { uint32_t offset = encoding_ & kOffset12Mask; diff --git a/runtime/vm/assembler_arm64.cc b/runtime/vm/assembler_arm64.cc index 1d34d5b6f1f..3f1e6207591 100644 --- a/runtime/vm/assembler_arm64.cc +++ b/runtime/vm/assembler_arm64.cc @@ -21,10 +21,12 @@ namespace dart { +DECLARE_FLAG(bool, allow_absolute_addresses); DECLARE_FLAG(bool, check_code_pointer); DECLARE_FLAG(bool, inline_alloc); DEFINE_FLAG(bool, use_far_branches, false, "Always use far branches"); +DEFINE_FLAG(bool, print_stop_message, false, "Print stop message."); Assembler::Assembler(bool use_far_branches) diff --git a/runtime/vm/assembler_ia32.cc b/runtime/vm/assembler_ia32.cc index 1a41e68a3c7..8d3fb099651 100644 --- a/runtime/vm/assembler_ia32.cc +++ b/runtime/vm/assembler_ia32.cc @@ -18,6 +18,7 @@ namespace dart { +DEFINE_FLAG(bool, print_stop_message, true, "Print stop message."); DECLARE_FLAG(bool, inline_alloc); diff --git a/runtime/vm/assembler_mips.cc b/runtime/vm/assembler_mips.cc index bb83b8d9d3f..0bf5ece7c22 100644 --- a/runtime/vm/assembler_mips.cc +++ b/runtime/vm/assembler_mips.cc @@ -14,12 +14,15 @@ namespace dart { +DECLARE_FLAG(bool, allow_absolute_addresses); DECLARE_FLAG(bool, check_code_pointer); DECLARE_FLAG(bool, inline_alloc); #if defined(USING_SIMULATOR) DECLARE_FLAG(int, trace_sim_after); #endif +DEFINE_FLAG(bool, print_stop_message, false, "Print stop message."); + void Assembler::InitializeMemoryWithBreakpoints(uword data, intptr_t length) { ASSERT(Utils::IsAligned(data, 4)); ASSERT(Utils::IsAligned(length, 4)); diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc index 28697644f13..cd930271ce4 100644 --- a/runtime/vm/assembler_x64.cc +++ b/runtime/vm/assembler_x64.cc @@ -17,9 +17,12 @@ namespace dart { +DECLARE_FLAG(bool, allow_absolute_addresses); DECLARE_FLAG(bool, check_code_pointer); DECLARE_FLAG(bool, inline_alloc); +DEFINE_FLAG(bool, print_stop_message, true, "Print stop message."); + Assembler::Assembler(bool use_far_branches) : buffer_(), diff --git a/runtime/vm/benchmark_test.cc b/runtime/vm/benchmark_test.cc index 1c59f8dbea5..488a2d918da 100644 --- a/runtime/vm/benchmark_test.cc +++ b/runtime/vm/benchmark_test.cc @@ -20,6 +20,8 @@ using dart::bin::File; namespace dart { +DECLARE_FLAG(bool, background_compilation); + Benchmark* Benchmark::first_ = NULL; Benchmark* Benchmark::tail_ = NULL; const char* Benchmark::executable_ = NULL; @@ -179,15 +181,10 @@ BENCHMARK(Dart2JSCompilerStats) { stats->EnableBenchmark(); Timer timer(true, "Compile all of dart2js benchmark"); timer.Start(); -#if !defined(PRODUCT) - // Constant in product mode. const bool old_flag = FLAG_background_compilation; FLAG_background_compilation = false; -#endif Dart_Handle result = Dart_CompileAll(); -#if !defined(PRODUCT) FLAG_background_compilation = old_flag; -#endif EXPECT_VALID(result); timer.Stop(); int64_t elapsed_time = timer.TotalElapsedTime(); @@ -390,14 +387,10 @@ BENCHMARK(Dart2JSCompileAll) { } Timer timer(true, "Compile all of dart2js benchmark"); timer.Start(); -#if !defined(PRODUCT) const bool old_flag = FLAG_background_compilation; FLAG_background_compilation = false; -#endif Dart_Handle result = Dart_CompileAll(); -#if !defined(PRODUCT) FLAG_background_compilation = old_flag; -#endif EXPECT_VALID(result); timer.Stop(); int64_t elapsed_time = timer.TotalElapsedTime(); diff --git a/runtime/vm/block_scheduler.cc b/runtime/vm/block_scheduler.cc index 5b3d78d8f59..1288d0b1947 100644 --- a/runtime/vm/block_scheduler.cc +++ b/runtime/vm/block_scheduler.cc @@ -11,6 +11,8 @@ namespace dart { +DEFINE_FLAG(bool, emit_edge_counters, true, "Emit edge counters at targets."); + static intptr_t GetEdgeCount(const Array& edge_counters, intptr_t edge_id) { if (!FLAG_emit_edge_counters) { // Assume everything was visited once. diff --git a/runtime/vm/code_descriptors.cc b/runtime/vm/code_descriptors.cc index e5fa106746c..a286a044cca 100644 --- a/runtime/vm/code_descriptors.cc +++ b/runtime/vm/code_descriptors.cc @@ -6,6 +6,8 @@ namespace dart { +DECLARE_FLAG(bool, precompilation); + void DescriptorList::AddDescriptor(RawPcDescriptors::Kind kind, intptr_t pc_offset, intptr_t deopt_id, @@ -16,7 +18,7 @@ void DescriptorList::AddDescriptor(RawPcDescriptors::Kind kind, (deopt_id != Thread::kNoDeoptId)); // When precompiling, we only use pc descriptors for exceptions. - if (!FLAG_precompiled_mode || try_index != -1) { + if (!FLAG_precompilation || try_index != -1) { intptr_t merged_kind_try = RawPcDescriptors::MergedKindTry::Encode(kind, try_index); diff --git a/runtime/vm/code_generator.cc b/runtime/vm/code_generator.cc index 37188b64b9a..f0c4b6698e4 100644 --- a/runtime/vm/code_generator.cc +++ b/runtime/vm/code_generator.cc @@ -27,8 +27,15 @@ namespace dart { +DEFINE_FLAG(bool, deoptimize_alot, false, + "Deoptimizes all live frames when we are about to return to Dart code from" + " native entries."); +DEFINE_FLAG(bool, background_compilation, false, + "Run optimizing compilation in background"); DEFINE_FLAG(int, max_subtype_cache_entries, 100, "Maximum number of subtype cache entries (number of checks cached)."); +DEFINE_FLAG(int, optimization_counter_threshold, 30000, + "Function's usage-counter value before it is optimized, -1 means never"); DEFINE_FLAG(int, regexp_optimization_counter_threshold, 1000, "RegExp's usage-counter value before it is optimized, -1 means never"); DEFINE_FLAG(charp, optimization_filter, NULL, "Optimize only named function"); @@ -59,13 +66,17 @@ DECLARE_FLAG(bool, enable_inlining_annotations); DECLARE_FLAG(bool, trace_compiler); DECLARE_FLAG(bool, trace_optimizing_compiler); DECLARE_FLAG(int, max_polymorphic_checks); +DECLARE_FLAG(bool, precompilation); +DEFINE_FLAG(bool, use_osr, true, "Use on-stack replacement."); DEFINE_FLAG(bool, trace_osr, false, "Trace attempts at on-stack replacement."); DEFINE_FLAG(int, stacktrace_every, 0, "Compute debugger stacktrace on every N stack overflow checks"); DEFINE_FLAG(charp, stacktrace_filter, NULL, "Compute stacktrace in named function on stack overflow checks"); +DEFINE_FLAG(int, deoptimize_every, 0, + "Deoptimize on every N stack overflow checks"); DEFINE_FLAG(charp, deoptimize_filter, NULL, "Deoptimize in named function on stack overflow checks"); @@ -1373,7 +1384,7 @@ DEFINE_RUNTIME_ENTRY(StackOverflow, 0) { ActivationFrame* frame = stack->FrameAt(i); // Variable locations and number are unknown when precompiling. const int num_vars = - FLAG_precompiled_mode ? 0 : frame->NumLocalVariables(); + FLAG_precompilation ? 0 : frame->NumLocalVariables(); TokenPosition unused = TokenPosition::kNoSource; for (intptr_t v = 0; v < num_vars; v++) { frame->VariableAt(v, &var_name, &unused, &unused, &var_value); diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc index 8ccf60eb4d4..006e8128485 100644 --- a/runtime/vm/compiler.cc +++ b/runtime/vm/compiler.cc @@ -69,9 +69,12 @@ DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining"); DEFINE_FLAG(bool, verify_compiler, false, "Enable compiler verification assertions"); +DECLARE_FLAG(bool, background_compilation); DECLARE_FLAG(bool, huge_method_cutoff_in_code_size); +DECLARE_FLAG(bool, load_deferred_eagerly); DECLARE_FLAG(bool, trace_failed_optimization_attempts); DECLARE_FLAG(bool, trace_irregexp); +DECLARE_FLAG(bool, precompilation); #ifndef DART_PRECOMPILED_RUNTIME @@ -417,7 +420,7 @@ void CompileParsedFunctionHelper::FinalizeCompilation( Assembler* assembler, FlowGraphCompiler* graph_compiler, FlowGraph* flow_graph) { - ASSERT(!FLAG_precompiled_mode); + ASSERT(!FLAG_precompilation); const Function& function = parsed_function()->function(); Zone* const zone = thread()->zone(); @@ -553,7 +556,7 @@ void CompileParsedFunctionHelper::FinalizeCompilation( // If optimized_result_code is not NULL then it is caller's responsibility // to install code. bool CompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) { - ASSERT(!FLAG_precompiled_mode); + ASSERT(!FLAG_precompilation); const Function& function = parsed_function()->function(); if (optimized() && !function.IsOptimizable()) { return false; @@ -1083,7 +1086,7 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline, const Function& function, bool optimized, intptr_t osr_id) { - ASSERT(!FLAG_precompiled_mode); + ASSERT(!FLAG_precompilation); LongJumpScope jump; if (setjmp(*jump.Set()) == 0) { Thread* const thread = Thread::Current(); @@ -1197,7 +1200,7 @@ static RawError* CompileFunctionHelper(CompilationPipeline* pipeline, RawError* Compiler::CompileFunction(Thread* thread, const Function& function) { #ifdef DART_PRECOMPILER - if (FLAG_precompiled_mode) { + if (FLAG_precompilation) { return Precompiler::CompileFunction(thread, function); } #endif @@ -1357,7 +1360,7 @@ RawError* Compiler::CompileAllFunctions(const Class& cls) { RawObject* Compiler::EvaluateStaticInitializer(const Field& field) { #ifdef DART_PRECOMPILER - if (FLAG_precompiled_mode) { + if (FLAG_precompilation) { return Precompiler::EvaluateStaticInitializer(field); } #endif @@ -1401,7 +1404,7 @@ RawObject* Compiler::EvaluateStaticInitializer(const Field& field) { RawObject* Compiler::ExecuteOnce(SequenceNode* fragment) { #ifdef DART_PRECOMPILER - if (FLAG_precompiled_mode) { + if (FLAG_precompilation) { return Precompiler::ExecuteOnce(fragment); } #endif diff --git a/runtime/vm/compiler_test.cc b/runtime/vm/compiler_test.cc index f76720a1279..f1b916c87ee 100644 --- a/runtime/vm/compiler_test.cc +++ b/runtime/vm/compiler_test.cc @@ -15,6 +15,8 @@ namespace dart { +DECLARE_FLAG(bool, background_compilation); + VM_TEST_CASE(CompileScript) { const char* kScriptChars = "class A {\n" @@ -96,10 +98,7 @@ VM_TEST_CASE(CompileFunctionOnHelperThread) { CompilerTest::TestCompileFunction(func); EXPECT(func.HasCode()); EXPECT(!func.HasOptimizedCode()); -#if !defined(PRODUCT) - // Constant in product mode. FLAG_background_compilation = true; -#endif BackgroundCompiler::EnsureInit(thread); Isolate* isolate = thread->isolate(); ASSERT(isolate->background_compiler() != NULL); diff --git a/runtime/vm/constant_propagator.cc b/runtime/vm/constant_propagator.cc index fa21b0fc9e3..695c23cbe8f 100644 --- a/runtime/vm/constant_propagator.cc +++ b/runtime/vm/constant_propagator.cc @@ -19,6 +19,8 @@ DEFINE_FLAG(bool, remove_redundant_phis, true, "Remove redundant phis."); DEFINE_FLAG(bool, trace_constant_propagation, false, "Print constant propagation and useless code elimination."); +DECLARE_FLAG(bool, fields_may_be_reset); + // Quick access to the current zone and isolate. #define I (isolate()) #define Z (graph_->zone()) diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index 1cff0aa27a6..4c270910708 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -51,6 +51,8 @@ namespace dart { #define Z (T->zone()) +DECLARE_FLAG(bool, load_deferred_eagerly); +DECLARE_FLAG(bool, precompilation); DECLARE_FLAG(bool, print_class_table); DECLARE_FLAG(bool, verify_handles); #if defined(DART_NO_SNAPSHOT) @@ -1145,7 +1147,7 @@ DART_EXPORT char* Dart_Initialize( Dart_FileCloseCallback file_close, Dart_EntropySource entropy_source, Dart_GetVMServiceAssetsArchive get_service_assets) { - if ((instructions_snapshot != NULL) && !FLAG_precompiled_mode) { + if ((instructions_snapshot != NULL) && !FLAG_precompilation) { return strdup("Flag --precompilation was not specified."); } if (interrupt != NULL) { @@ -6098,7 +6100,7 @@ DART_EXPORT Dart_Handle Dart_Precompile( bool reset_fields) { API_TIMELINE_BEGIN_END; DARTSCOPE(Thread::Current()); - if (!FLAG_precompiled_mode) { + if (!FLAG_precompilation) { return Dart_NewApiError("Flag --precompilation was not specified."); } Dart_Handle result = Api::CheckAndFinalizePendingClasses(T); diff --git a/runtime/vm/dart_api_impl_test.cc b/runtime/vm/dart_api_impl_test.cc index 91043ed161f..8e7d69805ca 100644 --- a/runtime/vm/dart_api_impl_test.cc +++ b/runtime/vm/dart_api_impl_test.cc @@ -19,6 +19,7 @@ namespace dart { +DECLARE_FLAG(int, optimization_counter_threshold); DECLARE_FLAG(bool, verify_acquired_data); DECLARE_FLAG(bool, ignore_patch_signature_mismatch); @@ -1905,9 +1906,6 @@ TEST_CASE(ExternalByteDataAccess) { } -#ifndef PRODUCT - - static const intptr_t kOptExtLength = 16; static int8_t opt_data[kOptExtLength] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, @@ -1976,9 +1974,6 @@ TEST_CASE(OptimizedExternalByteDataAccess) { } -#endif // !PRODUCT - - static void TestTypedDataDirectAccess() { Dart_Handle str = Dart_NewStringFromCString("junk"); Dart_Handle byte_array = Dart_NewTypedData(Dart_TypedData_kUint8, 10); diff --git a/runtime/vm/debugger.cc b/runtime/vm/debugger.cc index efe12b77154..06e78802678 100644 --- a/runtime/vm/debugger.cc +++ b/runtime/vm/debugger.cc @@ -46,6 +46,7 @@ DEFINE_FLAG(bool, steal_breakpoints, false, DECLARE_FLAG(bool, trace_isolates); DECLARE_FLAG(bool, warn_on_pause_with_no_debugger); +DECLARE_FLAG(bool, precompilation); #ifndef PRODUCT @@ -1517,7 +1518,7 @@ DebuggerStackTrace* Debugger::CollectStackTrace() { } if (frame->IsDartFrame()) { code = frame->LookupDartCode(); - if (code.is_optimized() && !FLAG_precompiled_mode) { + if (code.is_optimized() && !FLAG_precompilation) { deopt_frame = DeoptimizeToArray(thread, frame, code); for (InlinedFunctionsIterator it(code, frame->pc()); !it.Done(); diff --git a/runtime/vm/debugger_api_impl_test.cc b/runtime/vm/debugger_api_impl_test.cc index 0be2d29e1dc..85faf110a56 100644 --- a/runtime/vm/debugger_api_impl_test.cc +++ b/runtime/vm/debugger_api_impl_test.cc @@ -11,6 +11,9 @@ namespace dart { +DECLARE_FLAG(bool, background_compilation); +DECLARE_FLAG(int, optimization_counter_threshold); +DECLARE_FLAG(bool, use_osr); DECLARE_FLAG(bool, trace_shutdown); #ifndef PRODUCT diff --git a/runtime/vm/flag_list.h b/runtime/vm/flag_list.h index be809aaea16..4fdfb7b4941 100644 --- a/runtime/vm/flag_list.h +++ b/runtime/vm/flag_list.h @@ -21,22 +21,8 @@ // R(name, product_value, type, default_value, comment) // C(name, precompiled_value, product_value, type, default_value, comment) #define FLAG_LIST(P, R, D, C) \ -C(allow_absolute_addresses, false, true, bool, true, \ - "Allow embedding absolute addresses in generated code.") \ -C(always_megamorphic_calls, true, false, bool, false, \ - "Instance call always as megamorphic.") \ -C(background_compilation, false, false, bool, false, \ - "Run optimizing compilation in background") \ -C(collect_code, false, true, bool, true, \ - "Attempt to GC infrequently used code.") \ -C(collect_dynamic_function_names, true, false, bool, false, \ - "Collects all dynamic function names to identify unique targets") \ R(dedup_instructions, true, bool, false, \ "Canonicalize instructions when precompiling.") \ -C(deoptimize_alot, false, false, bool, false, \ - "Deoptimizes we are about to return to Dart code from native entries.") \ -C(deoptimize_every, 0, 0, int, 0, \ - "Deoptimize on every N stack overflow checks") \ R(disable_alloc_stubs_after_gc, false, bool, false, \ "Stress testing flag.") \ R(disassemble, false, bool, false, \ @@ -45,28 +31,16 @@ R(disassemble_optimized, false, bool, false, \ "Disassemble optimized code.") \ R(dump_symbol_stats, false, bool, false, \ "Dump symbol table statistics") \ -C(emit_edge_counters, false, true, bool, true, \ - "Emit edge counters") \ -C(enable_mirrors, false, false, bool, true, \ +R(enable_mirrors, false, bool, true, \ "Disable to make importing dart:mirrors an error.") \ -C(fields_may_be_reset, true, false, bool, false, \ - "Don't optimize away static field initialization") \ R(gc_at_alloc, false, bool, false, \ "GC at every allocation.") \ P(getter_setter_ratio, int, 13, \ "Ratio of getter/setter usage used for double field unboxing heuristics") \ P(guess_icdata_cid, bool, true, \ "Artificially create type feedback for arithmetic etc. operations") \ -C(ic_range_profiling, false, true, bool, true, \ - "Generate special IC stubs collecting range information ") \ -C(interpret_irregexp, true, false, bool, false, \ - "Use irregexp bytecode interpreter") \ C(lazy_dispatchers, false, true, bool, true, \ "Generate dispatchers lazily") \ -C(link_natives_lazily, true, false, bool, false, \ - "Link native calls lazily") \ -C(load_deferred_eagerly, true, true, bool, false, \ - "Load deferred libraries eagerly.") \ P(max_polymorphic_checks, int, 4, \ "Maximum number of polymorphic check, otherwise it is megamorphic.") \ P(max_equality_polymorphic_checks, int, 32, \ @@ -75,20 +49,14 @@ P(merge_sin_cos, bool, false, \ "Merge sin/cos into sincos") \ P(new_gen_ext_limit, int, 64, \ "maximum total external size (MB) in new gen before triggering GC") \ -C(optimization_counter_threshold, -1, 30000, int, 30000, \ - "Function's usage-counter value before it is optimized, -1 means never") \ C(polymorphic_with_deopt, false, true, bool, true, \ - "Polymorphic calls with deoptimization / megamorphic call") \ -C(precompiled_mode, true, false, bool, false, \ - "Precompilation compiler/runtime mode") \ + "Polymorphic calls with deoptimization / megamorphic call") \ R(pretenure_all, false, bool, false, \ "Global pretenuring (for testing).") \ P(pretenure_interval, int, 10, \ "Back off pretenuring after this many cycles.") \ P(pretenure_threshold, int, 98, \ "Trigger pretenuring when this many percent are promoted.") \ -C(print_stop_message, false, true, bool, true, \ - "Print stop message.") \ R(profiler, false, bool, true, \ "Enable the profiler.") \ R(support_ast_printer, false, bool, true, \ @@ -121,10 +89,6 @@ P(truncating_left_shift, bool, true, \ "Optimize left shift to truncate if possible") \ C(use_cha_deopt, false, true, bool, true, \ "Use class hierarchy analysis even if it can cause deoptimization.") \ -C(use_field_guards, false, true, bool, true, \ - "Use field guards and track field types") \ -C(use_osr, false, true, bool, true, \ - "Use OSR") \ P(verbose_gc, bool, false, \ "Enables verbose GC.") \ P(verbose_gc_hdr, int, 40, \ @@ -134,4 +98,5 @@ R(verify_after_gc, false, bool, false, \ R(verify_before_gc, false, bool, false, \ "Enables heap verification before GC.") \ + #endif // VM_FLAG_LIST_H_ diff --git a/runtime/vm/flags.cc b/runtime/vm/flags.cc index cb76c914b3e..ee7d7020bf6 100644 --- a/runtime/vm/flags.cc +++ b/runtime/vm/flags.cc @@ -80,7 +80,6 @@ FLAG_LIST(PRODUCT_FLAG_MARCO, #undef PRODUCT_FLAG_MARCO #undef PRECOMPILE_FLAG_MARCO - bool Flags::initialized_ = false; // List of registered flags. diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc index 3296e096dc1..b7b59cdc538 100644 --- a/runtime/vm/flow_graph.cc +++ b/runtime/vm/flow_graph.cc @@ -19,6 +19,7 @@ namespace dart { DEFINE_FLAG(bool, trace_smi_widening, false, "Trace Smi->Int32 widening pass."); #endif DEFINE_FLAG(bool, prune_dead_locals, true, "optimize dead locals away"); +DECLARE_FLAG(bool, emit_edge_counters); DECLARE_FLAG(bool, reorder_basic_blocks); DECLARE_FLAG(bool, verify_compiler); diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc index 680ea93f436..736efc6f16a 100644 --- a/runtime/vm/flow_graph_builder.cc +++ b/runtime/vm/flow_graph_builder.cc @@ -39,7 +39,9 @@ DEFINE_FLAG(bool, print_scopes, false, "Print scopes of local variables."); DEFINE_FLAG(bool, trace_type_check_elimination, false, "Trace type check elimination at compile time."); +DECLARE_FLAG(int, optimization_counter_threshold); DECLARE_FLAG(bool, profile_vm); +DECLARE_FLAG(bool, use_field_guards); // Quick access to the locally defined zone() method. #define Z (zone()) diff --git a/runtime/vm/flow_graph_compiler.cc b/runtime/vm/flow_graph_compiler.cc index 96649898ec6..d6469093796 100644 --- a/runtime/vm/flow_graph_compiler.cc +++ b/runtime/vm/flow_graph_compiler.cc @@ -30,6 +30,10 @@ namespace dart { +DEFINE_FLAG(bool, allow_absolute_addresses, true, + "Allow embedding absolute addresses in generated code."); +DEFINE_FLAG(bool, always_megamorphic_calls, false, + "Instance call always as megamorphic."); DEFINE_FLAG(bool, enable_simd_inline, true, "Enable inlining of SIMD related method calls."); DEFINE_FLAG(int, min_optimization_counter_threshold, 5000, @@ -41,14 +45,28 @@ DEFINE_FLAG(bool, trace_inlining_intervals, false, "Inlining interval diagnostics"); DEFINE_FLAG(bool, use_megamorphic_stub, true, "Out of line megamorphic lookup"); +DECLARE_FLAG(bool, background_compilation); DECLARE_FLAG(bool, code_comments); +DECLARE_FLAG(bool, collect_dynamic_function_names); +DECLARE_FLAG(bool, deoptimize_alot); +DECLARE_FLAG(int, deoptimize_every); DECLARE_FLAG(charp, deoptimize_filter); +DECLARE_FLAG(bool, emit_edge_counters); +DECLARE_FLAG(bool, fields_may_be_reset); +DECLARE_FLAG(bool, ic_range_profiling); DECLARE_FLAG(bool, intrinsify); +DECLARE_FLAG(bool, load_deferred_eagerly); +DECLARE_FLAG(int, optimization_counter_threshold); DECLARE_FLAG(bool, propagate_ic_data); DECLARE_FLAG(int, regexp_optimization_counter_threshold); DECLARE_FLAG(int, reoptimization_counter_threshold); DECLARE_FLAG(int, stacktrace_every); DECLARE_FLAG(charp, stacktrace_filter); +DECLARE_FLAG(bool, use_field_guards); +DECLARE_FLAG(bool, use_osr); +DECLARE_FLAG(bool, print_stop_message); +DECLARE_FLAG(bool, interpret_irregexp); +DECLARE_FLAG(bool, link_natives_lazily); DECLARE_FLAG(bool, trace_compiler); DECLARE_FLAG(int, inlining_hotness); DECLARE_FLAG(int, inlining_size_threshold); @@ -59,19 +77,39 @@ DECLARE_FLAG(int, inlining_caller_size_threshold); DECLARE_FLAG(int, inlining_constant_arguments_max_size_threshold); DECLARE_FLAG(int, inlining_constant_arguments_min_size_threshold); -#if !defined(DART_PRECOMPILED_RUNTIME) +bool FLAG_precompilation = false; static void PrecompilationModeHandler(bool value) { if (value) { #if defined(TARGET_ARCH_IA32) FATAL("Precompilation not supported on IA32"); #endif + FLAG_precompilation = true; -#if defined(PRODUCT) - FATAL("dart_noopt not supported in product mode"); -#else + FLAG_always_megamorphic_calls = true; + FLAG_optimization_counter_threshold = -1; + FLAG_use_field_guards = false; + FLAG_use_osr = false; + FLAG_emit_edge_counters = false; +#ifndef PRODUCT FLAG_support_debugger = false; +#endif // !PRODUCT + FLAG_ic_range_profiling = false; + FLAG_collect_code = false; + FLAG_load_deferred_eagerly = true; + FLAG_deoptimize_alot = false; // Used in some tests. + FLAG_deoptimize_every = 0; // Used in some tests. + // Calling the PrintStopMessage stub is not supported in precompiled code + // since it is done at places where no pool pointer is loaded. + FLAG_print_stop_message = false; + + FLAG_interpret_irregexp = true; +#ifndef PRODUCT + FLAG_enable_mirrors = false; +#endif // !PRODUCT + FLAG_link_natives_lazily = true; + FLAG_fields_may_be_reset = true; + FLAG_allow_absolute_addresses = false; - // Flags affecting compilation only: // There is no counter feedback in precompilation, so ignore the counter // when making inlining decisions. FLAG_inlining_hotness = 0; @@ -82,66 +120,39 @@ static void PrecompilationModeHandler(bool value) { FLAG_inlining_callee_size_threshold = 20; FLAG_inlining_depth_threshold = 2; FLAG_inlining_caller_size_threshold = 1000; + FLAG_inlining_constant_arguments_max_size_threshold = 100; FLAG_inlining_constant_arguments_min_size_threshold = 30; - FLAG_allow_absolute_addresses = false; - FLAG_always_megamorphic_calls = true; + // Background compilation relies on two-stage compilation pipeline, + // while precompilation has only one. FLAG_background_compilation = false; - FLAG_collect_code = false; FLAG_collect_dynamic_function_names = true; - FLAG_deoptimize_alot = false; // Used in some tests. - FLAG_deoptimize_every = 0; // Used in some tests. - FLAG_emit_edge_counters = false; - FLAG_enable_mirrors = false; - FLAG_fields_may_be_reset = true; - FLAG_ic_range_profiling = false; - FLAG_interpret_irregexp = true; +#if !defined(DART_PRECOMPILED_RUNTIME) && !defined(PRODUCT) FLAG_lazy_dispatchers = false; - FLAG_link_natives_lazily = true; - FLAG_load_deferred_eagerly = true; - FLAG_optimization_counter_threshold = -1; FLAG_polymorphic_with_deopt = false; - FLAG_precompiled_mode = true; - FLAG_print_stop_message = false; + // Precompilation finalizes all classes and thus allows CHA optimizations. + // Do not require CHA triggered deoptimization. FLAG_use_cha_deopt = false; - FLAG_use_field_guards = false; - FLAG_use_osr = false; -#endif // PRODUCT +#elif defined(DART_PRECOMPILED_RUNTIME) + // Precompiled product and release mode. + COMPILE_ASSERT(!FLAG_lazy_dispatchers); + COMPILE_ASSERT(!FLAG_polymorphic_with_deopt); + COMPILE_ASSERT(!FLAG_use_cha_deopt); +#elif defined(PRODUCT) + // Jit product and release mode. + COMPILE_ASSERT(FLAG_lazy_dispatchers); + COMPILE_ASSERT(FLAG_polymorphic_with_deopt); + COMPILE_ASSERT(FLAG_use_cha_deopt); +#endif } } + DEFINE_FLAG_HANDLER(PrecompilationModeHandler, precompilation, "Precompilation mode"); -#else // DART_PRECOMPILED_RUNTIME - -COMPILE_ASSERT(!FLAG_allow_absolute_addresses); -COMPILE_ASSERT(!FLAG_background_compilation); -COMPILE_ASSERT(!FLAG_collect_code); -COMPILE_ASSERT(!FLAG_deoptimize_alot); // Used in some tests. -COMPILE_ASSERT(!FLAG_emit_edge_counters); -COMPILE_ASSERT(!FLAG_enable_mirrors); -COMPILE_ASSERT(!FLAG_ic_range_profiling); -COMPILE_ASSERT(!FLAG_lazy_dispatchers); -COMPILE_ASSERT(!FLAG_polymorphic_with_deopt); -COMPILE_ASSERT(!FLAG_print_stop_message); -COMPILE_ASSERT(!FLAG_use_cha_deopt); -COMPILE_ASSERT(!FLAG_use_field_guards); -COMPILE_ASSERT(!FLAG_use_osr); -COMPILE_ASSERT(FLAG_always_megamorphic_calls); -COMPILE_ASSERT(FLAG_collect_dynamic_function_names); -COMPILE_ASSERT(FLAG_deoptimize_every == 0); // Used in some tests. -COMPILE_ASSERT(FLAG_fields_may_be_reset); -COMPILE_ASSERT(FLAG_interpret_irregexp); -COMPILE_ASSERT(FLAG_link_natives_lazily); -COMPILE_ASSERT(FLAG_load_deferred_eagerly); -COMPILE_ASSERT(FLAG_optimization_counter_threshold == -1); -COMPILE_ASSERT(FLAG_precompiled_mode); - -#endif // DART_PRECOMPILED_RUNTIME - // Assign locations to incoming arguments, i.e., values pushed above spill slots // with PushArgument. Recursively allocates from outermost to innermost @@ -931,8 +942,8 @@ Label* FlowGraphCompiler::AddDeoptStub(intptr_t deopt_id, return &intrinsic_slow_path_label_; } - // No deoptimization allowed when 'FLAG_precompiled_mode' is set. - if (FLAG_precompiled_mode) { + // No deoptimization allowed when 'FLAG_precompilation' is set. + if (FLAG_precompilation) { if (FLAG_trace_compiler) { THR_Print( "Retrying compilation %s, suppressing inlining of deopt_id:%" Pd "\n", @@ -980,7 +991,7 @@ void FlowGraphCompiler::FinalizePcDescriptors(const Code& code) { RawArray* FlowGraphCompiler::CreateDeoptInfo(Assembler* assembler) { // No deopt information if we precompile (no deoptimization allowed). - if (FLAG_precompiled_mode) { + if (FLAG_precompilation) { return Array::empty_array().raw(); } // For functions with optional arguments, all incoming arguments are copied @@ -1137,7 +1148,7 @@ void FlowGraphCompiler::GenerateInstanceCall( LocationSummary* locs, const ICData& ic_data_in) { const ICData& ic_data = ICData::ZoneHandle(ic_data_in.Original()); - if (FLAG_precompiled_mode) { + if (FLAG_precompilation) { EmitSwitchableInstanceCall(ic_data, argument_count, deopt_id, token_pos, locs); return; diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc index 759eacdcfbd..7f78e0a66ca 100644 --- a/runtime/vm/flow_graph_compiler_arm.cc +++ b/runtime/vm/flow_graph_compiler_arm.cc @@ -29,6 +29,7 @@ DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); DEFINE_FLAG(bool, unbox_doubles, true, "Optimize double arithmetic."); DECLARE_FLAG(bool, enable_simd_inline); DECLARE_FLAG(bool, use_megamorphic_stub); +DECLARE_FLAG(bool, precompilation); void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) { @@ -1133,7 +1134,7 @@ void FlowGraphCompiler::CompileGraph() { ASSERT(assembler()->constant_pool_allowed()); GenerateDeferredCode(); - if (is_optimizing() && !FLAG_precompiled_mode) { + if (is_optimizing() && !FLAG_precompilation) { // Leave enough space for patching in case of lazy deoptimization from // deferred code. for (intptr_t i = 0; @@ -1326,7 +1327,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( RecordSafepoint(locs); const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); - if (FLAG_precompiled_mode) { + if (FLAG_precompilation) { // Megamorphic calls may occur in slow path stubs. // If valid use try_index argument. if (try_index == CatchClauseNode::kInvalidTryIndex) { diff --git a/runtime/vm/flow_graph_compiler_arm64.cc b/runtime/vm/flow_graph_compiler_arm64.cc index 5d7f917c2d0..2e814ffb4e6 100644 --- a/runtime/vm/flow_graph_compiler_arm64.cc +++ b/runtime/vm/flow_graph_compiler_arm64.cc @@ -26,6 +26,7 @@ namespace dart { DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); DECLARE_FLAG(bool, enable_simd_inline); DECLARE_FLAG(bool, use_megamorphic_stub); +DECLARE_FLAG(bool, precompilation); void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) { @@ -1126,7 +1127,7 @@ void FlowGraphCompiler::CompileGraph() { ASSERT(assembler()->constant_pool_allowed()); GenerateDeferredCode(); - if (is_optimizing() && !FLAG_precompiled_mode) { + if (is_optimizing() && !FLAG_precompilation) { // Leave enough space for patching in case of lazy deoptimization from // deferred code. for (intptr_t i = 0; @@ -1307,7 +1308,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( RecordSafepoint(locs); const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); - if (FLAG_precompiled_mode) { + if (FLAG_precompilation) { // Megamorphic calls may occur in slow path stubs. // If valid use try_index argument. if (try_index == CatchClauseNode::kInvalidTryIndex) { diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc index 6625a9f28ea..3ae8998ea01 100644 --- a/runtime/vm/flow_graph_compiler_ia32.cc +++ b/runtime/vm/flow_graph_compiler_ia32.cc @@ -31,6 +31,7 @@ DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); DECLARE_FLAG(bool, enable_simd_inline); DECLARE_FLAG(bool, use_megamorphic_stub); +DECLARE_FLAG(bool, precompilation); void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) { @@ -1144,7 +1145,7 @@ void FlowGraphCompiler::CompileGraph() { __ int3(); GenerateDeferredCode(); - if (is_optimizing() && !FLAG_precompiled_mode) { + if (is_optimizing() && !FLAG_precompilation) { // Leave enough space for patching in case of lazy deoptimization from // deferred code. __ nop(CallPattern::pattern_length_in_bytes()); @@ -1310,7 +1311,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( RecordSafepoint(locs); const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); // Precompilation not implemented on ia32 platform. - ASSERT(!FLAG_precompiled_mode); + ASSERT(!FLAG_precompilation); if (is_optimizing()) { AddDeoptIndexAtCall(deopt_id_after, token_pos); } else { diff --git a/runtime/vm/flow_graph_compiler_mips.cc b/runtime/vm/flow_graph_compiler_mips.cc index d1381c792ac..ee6c0ec3046 100644 --- a/runtime/vm/flow_graph_compiler_mips.cc +++ b/runtime/vm/flow_graph_compiler_mips.cc @@ -24,6 +24,7 @@ namespace dart { DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); DECLARE_FLAG(bool, use_megamorphic_stub); +DECLARE_FLAG(bool, precompilation); void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) { @@ -1146,7 +1147,7 @@ void FlowGraphCompiler::CompileGraph() { __ break_(0); GenerateDeferredCode(); - if (is_optimizing() && !FLAG_precompiled_mode) { + if (is_optimizing() && !FLAG_precompilation) { // Leave enough space for patching in case of lazy deoptimization from // deferred code. for (intptr_t i = 0; @@ -1334,7 +1335,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( RecordSafepoint(locs); const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); - if (FLAG_precompiled_mode) { + if (FLAG_precompilation) { // Megamorphic calls may occur in slow path stubs. // If valid use try_index argument. if (try_index == CatchClauseNode::kInvalidTryIndex) { diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc index 275e87331f9..26c19fe26fa 100644 --- a/runtime/vm/flow_graph_compiler_x64.cc +++ b/runtime/vm/flow_graph_compiler_x64.cc @@ -27,6 +27,7 @@ DEFINE_FLAG(bool, trap_on_deoptimization, false, "Trap on deoptimization."); DEFINE_FLAG(bool, unbox_mints, true, "Optimize 64-bit integer arithmetic."); DECLARE_FLAG(bool, enable_simd_inline); DECLARE_FLAG(bool, use_megamorphic_stub); +DECLARE_FLAG(bool, precompilation); void MegamorphicSlowPath::EmitNativeCode(FlowGraphCompiler* compiler) { Assembler* assembler = compiler->assembler(); @@ -1145,7 +1146,7 @@ void FlowGraphCompiler::CompileGraph() { // Emit function patching code. This will be swapped with the first 13 bytes // at entry point. - if (is_optimizing() && !FLAG_precompiled_mode) { + if (is_optimizing() && !FLAG_precompilation) { // Leave enough space for patching in case of lazy deoptimization from // deferred code. __ nop(ShortCallPattern::pattern_length_in_bytes()); @@ -1337,7 +1338,7 @@ void FlowGraphCompiler::EmitMegamorphicInstanceCall( RecordSafepoint(locs); const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); - if (FLAG_precompiled_mode) { + if (FLAG_precompilation) { // Megamorphic calls may occur in slow path stubs. // If valid use try_index argument. if (try_index == CatchClauseNode::kInvalidTryIndex) { diff --git a/runtime/vm/flow_graph_inliner.cc b/runtime/vm/flow_graph_inliner.cc index 9c720a37813..1f2393f6eaa 100644 --- a/runtime/vm/flow_graph_inliner.cc +++ b/runtime/vm/flow_graph_inliner.cc @@ -62,6 +62,7 @@ DEFINE_FLAG(bool, enable_inlining_annotations, false, DECLARE_FLAG(bool, compiler_stats); DECLARE_FLAG(int, max_deoptimization_counter_threshold); +DECLARE_FLAG(bool, precompilation); DECLARE_FLAG(bool, print_flow_graph); DECLARE_FLAG(bool, print_flow_graph_optimized); DECLARE_FLAG(bool, verify_compiler); @@ -631,7 +632,7 @@ class CallSiteInliner : public ValueObject { // Function has no type feedback. With precompilation we don't rely on // type feedback. - if (!FLAG_precompiled_mode && + if (!FLAG_precompilation && function.ic_data_array() == Object::null()) { TRACE_INLINING(THR_Print(" Bailout: not compiled yet\n")); PRINT_INLINING_TREE("Not compiled", @@ -789,7 +790,7 @@ class CallSiteInliner : public ValueObject { CSTAT_TIMER_SCOPE(thread(), graphinliner_opt_timer); // TODO(fschneider): Improve suppression of speculative inlining. // Deopt-ids overlap between caller and callee. - if (FLAG_precompiled_mode) { + if (FLAG_precompilation) { AotOptimizer optimizer(callee_graph, inliner_->use_speculative_inlining_, inliner_->inlining_black_list_); @@ -929,7 +930,7 @@ class CallSiteInliner : public ValueObject { // Propagate a compile-time error. Only in precompilation do we attempt to // inline functions that have never been compiled before; when JITing we // should only see compile-time errors in unoptimized compilation. - ASSERT(FLAG_precompiled_mode); + ASSERT(FLAG_precompilation); Thread::Current()->long_jump_base()->Jump(1, error); UNREACHABLE(); return false; diff --git a/runtime/vm/flow_graph_range_analysis.cc b/runtime/vm/flow_graph_range_analysis.cc index 18eaa36036a..f9840c60393 100644 --- a/runtime/vm/flow_graph_range_analysis.cc +++ b/runtime/vm/flow_graph_range_analysis.cc @@ -14,6 +14,7 @@ DEFINE_FLAG(bool, array_bounds_check_elimination, true, DEFINE_FLAG(bool, trace_range_analysis, false, "Trace range analysis progress"); DEFINE_FLAG(bool, trace_integer_ir_selection, false, "Print integer IR selection optimization pass."); +DECLARE_FLAG(bool, precompilation); DECLARE_FLAG(bool, trace_constant_propagation); // Quick access to the locally defined isolate() and zone() methods. @@ -1533,7 +1534,7 @@ void RangeAnalysis::EliminateRedundantBoundsChecks() { // optimistic hoisting of checks possible) const bool try_generalization = function.allows_bounds_check_generalization() && - !FLAG_precompiled_mode; + !FLAG_precompilation; BoundsCheckGeneralizer generalizer(this, flow_graph_); diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc index 2ca20742ce6..9807bcf1014 100644 --- a/runtime/vm/flow_graph_type_propagator.cc +++ b/runtime/vm/flow_graph_type_propagator.cc @@ -15,6 +15,7 @@ DEFINE_FLAG(bool, trace_type_propagation, false, "Trace flow graph type propagation"); DECLARE_FLAG(bool, propagate_types); +DECLARE_FLAG(bool, fields_may_be_reset); void FlowGraphTypePropagator::Propagate(FlowGraph* flow_graph) { diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc index 4ccb260b796..207167cb25a 100644 --- a/runtime/vm/il_printer.cc +++ b/runtime/vm/il_printer.cc @@ -447,9 +447,6 @@ void PolymorphicInstanceCallInstr::PrintOperandsTo(BufferFormatter* f) const { PushArgumentAt(i)->value()->PrintTo(f); } PrintICDataHelper(f, ic_data()); - if (with_checks()) { - f->Print(" WITH CHECKS"); - } } diff --git a/runtime/vm/intermediate_language.cc b/runtime/vm/intermediate_language.cc index 0a67661e707..61123f73639 100644 --- a/runtime/vm/intermediate_language.cc +++ b/runtime/vm/intermediate_language.cc @@ -29,12 +29,17 @@ namespace dart { +DEFINE_FLAG(bool, ic_range_profiling, true, + "Generate special IC stubs collecting range information " + "for binary and unary arithmetic operations"); DEFINE_FLAG(bool, propagate_ic_data, true, "Propagate IC data from unoptimized to optimized IC calls."); DEFINE_FLAG(bool, two_args_smi_icd, true, "Generate special IC stubs for two args Smi operations"); DEFINE_FLAG(bool, unbox_numeric_fields, true, "Support unboxed double and float32x4 fields."); +DEFINE_FLAG(bool, fields_may_be_reset, false, + "Don't optimize away static field initialization"); DECLARE_FLAG(bool, eliminate_type_checks); Definition::Definition(intptr_t deopt_id) diff --git a/runtime/vm/intermediate_language_arm.cc b/runtime/vm/intermediate_language_arm.cc index 801073275bf..93619bcf446 100644 --- a/runtime/vm/intermediate_language_arm.cc +++ b/runtime/vm/intermediate_language_arm.cc @@ -25,6 +25,12 @@ namespace dart { +DECLARE_FLAG(bool, allow_absolute_addresses); +DECLARE_FLAG(bool, emit_edge_counters); +DECLARE_FLAG(int, optimization_counter_threshold); +DECLARE_FLAG(bool, precompilation); +DECLARE_FLAG(bool, use_osr); + // Generic summary for call instructions that have all arguments pushed // on the stack and return the result in a fixed register R0. LocationSummary* Instruction::MakeCallSummary(Zone* zone) { @@ -2372,7 +2378,7 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { ASSERT(locs()->in(kLengthPos).reg() == kLengthReg); if (compiler->is_optimizing() && - !FLAG_precompiled_mode && + !FLAG_precompilation && num_elements()->BindsToConstant() && num_elements()->BoundConstant().IsSmi()) { const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); diff --git a/runtime/vm/intermediate_language_arm64.cc b/runtime/vm/intermediate_language_arm64.cc index bd30f168ac0..0627f74954b 100644 --- a/runtime/vm/intermediate_language_arm64.cc +++ b/runtime/vm/intermediate_language_arm64.cc @@ -24,6 +24,12 @@ namespace dart { +DECLARE_FLAG(bool, allow_absolute_addresses); +DECLARE_FLAG(bool, emit_edge_counters); +DECLARE_FLAG(int, optimization_counter_threshold); +DECLARE_FLAG(bool, precompilation); +DECLARE_FLAG(bool, use_osr); + // Generic summary for call instructions that have all arguments pushed // on the stack and return the result in a fixed register R0. LocationSummary* Instruction::MakeCallSummary(Zone* zone) { @@ -2095,7 +2101,7 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { ASSERT(locs()->in(kLengthPos).reg() == kLengthReg); if (compiler->is_optimizing() && - !FLAG_precompiled_mode && + !FLAG_precompilation && num_elements()->BindsToConstant() && num_elements()->BoundConstant().IsSmi()) { const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); diff --git a/runtime/vm/intermediate_language_ia32.cc b/runtime/vm/intermediate_language_ia32.cc index 2630d01d4ce..8933848c37d 100644 --- a/runtime/vm/intermediate_language_ia32.cc +++ b/runtime/vm/intermediate_language_ia32.cc @@ -23,6 +23,10 @@ namespace dart { +DECLARE_FLAG(bool, emit_edge_counters); +DECLARE_FLAG(int, optimization_counter_threshold); +DECLARE_FLAG(bool, use_osr); + // Generic summary for call instructions that have all arguments pushed // on the stack and return the result in a fixed register EAX. LocationSummary* Instruction::MakeCallSummary(Zone* zone) { diff --git a/runtime/vm/intermediate_language_mips.cc b/runtime/vm/intermediate_language_mips.cc index f4de24ccd3a..93e720ccadb 100644 --- a/runtime/vm/intermediate_language_mips.cc +++ b/runtime/vm/intermediate_language_mips.cc @@ -24,6 +24,12 @@ namespace dart { +DECLARE_FLAG(bool, allow_absolute_addresses); +DECLARE_FLAG(bool, emit_edge_counters); +DECLARE_FLAG(int, optimization_counter_threshold); +DECLARE_FLAG(bool, precompilation); +DECLARE_FLAG(bool, use_osr); + // Generic summary for call instructions that have all arguments pushed // on the stack and return the result in a fixed register V0. LocationSummary* Instruction::MakeCallSummary(Zone* zone) { @@ -2226,7 +2232,7 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { Label slow_path, done; if (compiler->is_optimizing() && - !FLAG_precompiled_mode && + !FLAG_precompilation && num_elements()->BindsToConstant() && num_elements()->BoundConstant().IsSmi()) { const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc index 35d73a2053b..2fdf93eabb7 100644 --- a/runtime/vm/intermediate_language_x64.cc +++ b/runtime/vm/intermediate_language_x64.cc @@ -23,6 +23,12 @@ namespace dart { +DECLARE_FLAG(bool, allow_absolute_addresses); +DECLARE_FLAG(bool, emit_edge_counters); +DECLARE_FLAG(int, optimization_counter_threshold); +DECLARE_FLAG(bool, use_osr); +DECLARE_FLAG(bool, precompilation); + // Generic summary for call instructions that have all arguments pushed // on the stack and return the result in a fixed register RAX. LocationSummary* Instruction::MakeCallSummary(Zone* zone) { @@ -2115,7 +2121,7 @@ void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { Label slow_path, done; if (compiler->is_optimizing() && - !FLAG_precompiled_mode && + !FLAG_precompilation && num_elements()->BindsToConstant() && num_elements()->BoundConstant().IsSmi()) { const intptr_t length = Smi::Cast(num_elements()->BoundConstant()).Value(); diff --git a/runtime/vm/intrinsifier_arm.cc b/runtime/vm/intrinsifier_arm.cc index 377c75a1b29..1b4916949d6 100644 --- a/runtime/vm/intrinsifier_arm.cc +++ b/runtime/vm/intrinsifier_arm.cc @@ -18,6 +18,8 @@ namespace dart { +DECLARE_FLAG(bool, interpret_irregexp); + // When entering intrinsics code: // R4: Arguments descriptor // LR: Return address diff --git a/runtime/vm/intrinsifier_arm64.cc b/runtime/vm/intrinsifier_arm64.cc index 5358741ba3a..3c28ec109af 100644 --- a/runtime/vm/intrinsifier_arm64.cc +++ b/runtime/vm/intrinsifier_arm64.cc @@ -17,6 +17,8 @@ namespace dart { +DECLARE_FLAG(bool, interpret_irregexp); + // When entering intrinsics code: // R4: Arguments descriptor // LR: Return address diff --git a/runtime/vm/intrinsifier_ia32.cc b/runtime/vm/intrinsifier_ia32.cc index b6dcba0a3f6..9f4c622f7c5 100644 --- a/runtime/vm/intrinsifier_ia32.cc +++ b/runtime/vm/intrinsifier_ia32.cc @@ -24,6 +24,8 @@ namespace dart { +DECLARE_FLAG(bool, interpret_irregexp); + // When entering intrinsics code: // ECX: IC Data // EDX: Arguments descriptor diff --git a/runtime/vm/intrinsifier_mips.cc b/runtime/vm/intrinsifier_mips.cc index cf543d86131..1e289cc6cf3 100644 --- a/runtime/vm/intrinsifier_mips.cc +++ b/runtime/vm/intrinsifier_mips.cc @@ -17,6 +17,8 @@ namespace dart { +DECLARE_FLAG(bool, interpret_irregexp); + // When entering intrinsics code: // S4: Arguments descriptor // RA: Return address diff --git a/runtime/vm/intrinsifier_x64.cc b/runtime/vm/intrinsifier_x64.cc index 2b8cb36f7e6..d9eb08baa99 100644 --- a/runtime/vm/intrinsifier_x64.cc +++ b/runtime/vm/intrinsifier_x64.cc @@ -17,6 +17,8 @@ namespace dart { +DECLARE_FLAG(bool, interpret_irregexp); + // When entering intrinsics code: // R10: Arguments descriptor // TOS: Return address diff --git a/runtime/vm/native_arguments.h b/runtime/vm/native_arguments.h index af27a37e0e4..1763c8c67ee 100644 --- a/runtime/vm/native_arguments.h +++ b/runtime/vm/native_arguments.h @@ -14,6 +14,7 @@ namespace dart { +DECLARE_FLAG(bool, deoptimize_alot); DECLARE_FLAG(bool, trace_natives); DECLARE_FLAG(bool, verify_on_transition); diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index 1c06c77cc26..aea7d1f6e31 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -55,11 +55,14 @@ DEFINE_FLAG(bool, overlap_type_arguments, true, DEFINE_FLAG(bool, show_internal_names, false, "Show names of internal classes (e.g. \"OneByteString\") in error messages " "instead of showing the corresponding interface names (e.g. \"String\")"); +DEFINE_FLAG(bool, use_field_guards, true, "Guard field cids."); DEFINE_FLAG(bool, use_lib_cache, true, "Use library name cache"); DEFINE_FLAG(bool, ignore_patch_signature_mismatch, false, "Ignore patch file member signature mismatch."); DECLARE_FLAG(charp, coverage_dir); +DECLARE_FLAG(bool, load_deferred_eagerly); +DECLARE_FLAG(bool, precompilation); DECLARE_FLAG(bool, show_invisible_frames); DECLARE_FLAG(bool, trace_deoptimization); DECLARE_FLAG(bool, trace_deoptimization_verbose); @@ -21102,7 +21105,7 @@ const char* Stacktrace::ToCStringInternal(intptr_t* frame_index, uword pc = code.EntryPoint() + Smi::Value(PcOffsetAtFrame(i)); if (code.is_optimized() && expand_inlined()) { // Traverse inlined frames. - if (!FLAG_precompiled_mode) { + if (!FLAG_precompilation) { for (InlinedFunctionsIterator it(code, pc); !it.Done() && (*frame_index < max_frames); it.Advance()) { function = it.function(); diff --git a/runtime/vm/pages.cc b/runtime/vm/pages.cc index aa375fa65bb..ff0fa5385a3 100644 --- a/runtime/vm/pages.cc +++ b/runtime/vm/pages.cc @@ -29,6 +29,8 @@ DEFINE_FLAG(bool, print_free_list_before_gc, false, "Print free list statistics before a GC"); DEFINE_FLAG(bool, print_free_list_after_gc, false, "Print free list statistics after a GC"); +DEFINE_FLAG(bool, collect_code, true, + "Attempt to GC infrequently used code."); DEFINE_FLAG(int, code_collection_interval_in_us, 30000000, "Time between attempts to collect unused code."); DEFINE_FLAG(bool, log_code_drop, false, diff --git a/runtime/vm/pages.h b/runtime/vm/pages.h index 12b193f64a0..008b7cdc29b 100644 --- a/runtime/vm/pages.h +++ b/runtime/vm/pages.h @@ -15,6 +15,7 @@ namespace dart { +DECLARE_FLAG(bool, collect_code); DECLARE_FLAG(bool, log_code_drop); DECLARE_FLAG(bool, always_drop_code); DECLARE_FLAG(bool, write_protect_code); diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc index afa81fc053a..9571669c0e2 100644 --- a/runtime/vm/parser.cc +++ b/runtime/vm/parser.cc @@ -41,8 +41,11 @@ namespace dart { DEFINE_FLAG(bool, enable_debug_break, false, "Allow use of break \"message\"."); +DEFINE_FLAG(bool, load_deferred_eagerly, false, + "Load deferred libraries eagerly."); DEFINE_FLAG(bool, trace_parser, false, "Trace parser operations."); DEFINE_FLAG(bool, warn_mixin_typedef, true, "Warning on legacy mixin typedef."); +DEFINE_FLAG(bool, link_natives_lazily, false, "Link native calls lazily"); DEFINE_FLAG(bool, conditional_directives, false, "Enable conditional directives"); DEFINE_FLAG(bool, warn_super, false, @@ -50,6 +53,7 @@ DEFINE_FLAG(bool, warn_super, false, DEFINE_FLAG(bool, await_is_keyword, false, "await and yield are treated as proper keywords in synchronous code."); +DECLARE_FLAG(bool, load_deferred_eagerly); DECLARE_FLAG(bool, profile_vm); // Quick access to the current thread, isolate and zone. @@ -14341,6 +14345,11 @@ void Parser::SkipQualIdent() { namespace dart { +DEFINE_FLAG(bool, load_deferred_eagerly, false, + "Load deferred libraries eagerly."); +DEFINE_FLAG(bool, link_natives_lazily, false, "Link native calls lazily"); + + void ParsedFunction::AddToGuardedFields(const Field* field) const { UNREACHABLE(); } diff --git a/runtime/vm/precompiler.cc b/runtime/vm/precompiler.cc index fb4768a236b..ce5ca5ee90c 100644 --- a/runtime/vm/precompiler.cc +++ b/runtime/vm/precompiler.cc @@ -49,6 +49,9 @@ namespace dart { #define Z (zone()) +DEFINE_FLAG(bool, collect_dynamic_function_names, false, + "In precompilation collects all dynamic function names in order to" + " identify unique targets"); DEFINE_FLAG(bool, print_unique_targets, false, "Print unique dynaic targets"); DEFINE_FLAG(bool, trace_precompiler, false, "Trace precompiler."); DEFINE_FLAG(int, max_speculative_inlining_attempts, 1, @@ -66,7 +69,9 @@ DECLARE_FLAG(bool, trace_optimizing_compiler); DECLARE_FLAG(bool, trace_bailout); DECLARE_FLAG(bool, use_inlining); DECLARE_FLAG(bool, verify_compiler); +DECLARE_FLAG(bool, precompilation); DECLARE_FLAG(bool, huge_method_cutoff_in_code_size); +DECLARE_FLAG(bool, load_deferred_eagerly); DECLARE_FLAG(bool, trace_failed_optimization_attempts); DECLARE_FLAG(bool, trace_inlining_intervals); DECLARE_FLAG(bool, trace_irregexp); @@ -1884,7 +1889,7 @@ void PrecompileParsedFunctionHelper::FinalizeCompilation( // If optimized_result_code is not NULL then it is caller's responsibility // to install code. bool PrecompileParsedFunctionHelper::Compile(CompilationPipeline* pipeline) { - ASSERT(FLAG_precompiled_mode); + ASSERT(FLAG_precompilation); const Function& function = parsed_function()->function(); if (optimized() && !function.IsOptimizable()) { return false; @@ -2399,7 +2404,7 @@ static RawError* PrecompileFunctionHelper(CompilationPipeline* pipeline, const Function& function, bool optimized) { // Check that we optimize, except if the function is not optimizable. - ASSERT(FLAG_precompiled_mode); + ASSERT(FLAG_precompilation); ASSERT(!function.IsOptimizable() || optimized); ASSERT(!function.HasCode()); LongJumpScope jump; @@ -2496,7 +2501,7 @@ RawError* Precompiler::CompileFunction(Thread* thread, CompilationPipeline* pipeline = CompilationPipeline::New(thread->zone(), function); - ASSERT(FLAG_precompiled_mode); + ASSERT(FLAG_precompilation); const bool optimized = function.IsOptimizable(); // False for natives. return PrecompileFunctionHelper(pipeline, function, optimized); } diff --git a/runtime/vm/profiler_test.cc b/runtime/vm/profiler_test.cc index f9ae241957c..55149b2bd04 100644 --- a/runtime/vm/profiler_test.cc +++ b/runtime/vm/profiler_test.cc @@ -15,6 +15,7 @@ namespace dart { #ifndef PRODUCT +DECLARE_FLAG(bool, background_compilation); DECLARE_FLAG(bool, profile_vm); DECLARE_FLAG(int, max_profile_depth); diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc index ed22fa28780..6b9d72802f8 100644 --- a/runtime/vm/raw_object_snapshot.cc +++ b/runtime/vm/raw_object_snapshot.cc @@ -12,6 +12,9 @@ namespace dart { +DECLARE_FLAG(int, optimization_counter_threshold); +DECLARE_FLAG(bool, use_field_guards); + #define NEW_OBJECT(type) \ ((kind == Snapshot::kFull) ? reader->New##type() : type::New()) diff --git a/runtime/vm/redundancy_elimination.cc b/runtime/vm/redundancy_elimination.cc index 01a6ce46b01..266abdf5938 100644 --- a/runtime/vm/redundancy_elimination.cc +++ b/runtime/vm/redundancy_elimination.cc @@ -19,6 +19,9 @@ DEFINE_FLAG(bool, load_cse, true, "Use redundant load elimination."); DEFINE_FLAG(bool, trace_load_optimization, false, "Print live sets for load optimization pass."); +DECLARE_FLAG(bool, fields_may_be_reset); +DECLARE_FLAG(bool, precompilation); + // Quick access to the current zone. #define Z (zone()) @@ -1427,7 +1430,7 @@ void LICM::TrySpecializeSmiPhi(PhiInstr* phi, void LICM::OptimisticallySpecializeSmiPhis() { if (!flow_graph()->function().allows_hoisting_check_class() || - FLAG_precompiled_mode) { + FLAG_precompilation) { // Do not hoist any: Either deoptimized on a hoisted check, // or compiling precompiled code where we can't do optimistic // hoisting of checks. diff --git a/runtime/vm/regexp.cc b/runtime/vm/regexp.cc index e49c3d8253c..7cf9710864a 100644 --- a/runtime/vm/regexp.cc +++ b/runtime/vm/regexp.cc @@ -19,6 +19,8 @@ namespace dart { DECLARE_FLAG(bool, trace_irregexp); +DEFINE_FLAG(bool, interpret_irregexp, false, + "Use irregexp bytecode interpreter"); // Default to generating optimized regexp code. static const bool kRegexpOptimization = true; diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc index 294a90b7d4b..bf02cbaa6c6 100644 --- a/runtime/vm/snapshot.cc +++ b/runtime/vm/snapshot.cc @@ -28,6 +28,9 @@ namespace dart { +DECLARE_FLAG(bool, use_field_guards); + + static const int kNumVmIsolateSnapshotReferences = 32 * KB; static const int kNumInitialReferencesInFullSnapshot = 160 * KB; static const int kNumInitialReferences = 64; diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc index ad05ebaf3a7..35d372881c4 100644 --- a/runtime/vm/snapshot_test.cc +++ b/runtime/vm/snapshot_test.cc @@ -19,6 +19,7 @@ namespace dart { DECLARE_FLAG(bool, enable_type_checks); +DECLARE_FLAG(bool, load_deferred_eagerly); DECLARE_FLAG(bool, concurrent_sweep); // Check if serialized and deserialized objects are equal. @@ -1000,7 +1001,6 @@ TEST_CASE(SerializeScript) { } -#if !defined(PRODUCT) // Uses deferred loading. UNIT_TEST_CASE(CanonicalizationInScriptSnapshots) { const char* kScriptChars = "\n" @@ -1106,7 +1106,6 @@ UNIT_TEST_CASE(CanonicalizationInScriptSnapshots) { free(script_snapshot); free(full_snapshot); } -#endif static void IterateScripts(const Library& lib) { @@ -1470,6 +1469,9 @@ UNIT_TEST_CASE(ScriptSnapshot) { } +#endif // !PRODUCT + + UNIT_TEST_CASE(ScriptSnapshot1) { const char* kScriptChars = "class _SimpleNumEnumerable {" @@ -1664,9 +1666,6 @@ UNIT_TEST_CASE(ScriptSnapshot2) { } -#endif // !PRODUCT - - TEST_CASE(IntArrayMessage) { StackZone zone(Thread::Current()); uint8_t* buffer = NULL; diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc index 6b8812e3a5b..77b6685c2f2 100644 --- a/runtime/vm/stub_code_arm.cc +++ b/runtime/vm/stub_code_arm.cc @@ -26,6 +26,7 @@ DEFINE_FLAG(bool, inline_alloc, true, "Inline allocation of objects."); DEFINE_FLAG(bool, use_slow_path, false, "Set to true for debugging & verifying the slow paths."); DECLARE_FLAG(bool, trace_optimized_ic_calls); +DECLARE_FLAG(int, optimization_counter_threshold); // Input parameters: // LR : return address. diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc index e7d7f4f3eb8..c0648d464a2 100644 --- a/runtime/vm/stub_code_arm64.cc +++ b/runtime/vm/stub_code_arm64.cc @@ -25,6 +25,7 @@ DEFINE_FLAG(bool, inline_alloc, true, "Inline allocation of objects."); DEFINE_FLAG(bool, use_slow_path, false, "Set to true for debugging & verifying the slow paths."); DECLARE_FLAG(bool, trace_optimized_ic_calls); +DECLARE_FLAG(int, optimization_counter_threshold); // Input parameters: // LR : return address. diff --git a/runtime/vm/stub_code_ia32.cc b/runtime/vm/stub_code_ia32.cc index 640f0ec152b..e79efba48e5 100644 --- a/runtime/vm/stub_code_ia32.cc +++ b/runtime/vm/stub_code_ia32.cc @@ -27,6 +27,7 @@ DEFINE_FLAG(bool, inline_alloc, true, "Inline allocation of objects."); DEFINE_FLAG(bool, use_slow_path, false, "Set to true for debugging & verifying the slow paths."); DECLARE_FLAG(bool, trace_optimized_ic_calls); +DECLARE_FLAG(int, optimization_counter_threshold); #define INT32_SIZEOF(x) static_cast(sizeof(x)) diff --git a/runtime/vm/stub_code_mips.cc b/runtime/vm/stub_code_mips.cc index bc529678ceb..8d1b252e99f 100644 --- a/runtime/vm/stub_code_mips.cc +++ b/runtime/vm/stub_code_mips.cc @@ -25,6 +25,7 @@ DEFINE_FLAG(bool, inline_alloc, true, "Inline allocation of objects."); DEFINE_FLAG(bool, use_slow_path, false, "Set to true for debugging & verifying the slow paths."); DECLARE_FLAG(bool, trace_optimized_ic_calls); +DECLARE_FLAG(int, optimization_counter_threshold); // Input parameters: // RA : return address. diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc index b33ee0198bf..ace6744f77c 100644 --- a/runtime/vm/stub_code_x64.cc +++ b/runtime/vm/stub_code_x64.cc @@ -26,6 +26,7 @@ DEFINE_FLAG(bool, inline_alloc, true, "Inline allocation of objects."); DEFINE_FLAG(bool, use_slow_path, false, "Set to true for debugging & verifying the slow paths."); DECLARE_FLAG(bool, trace_optimized_ic_calls); +DECLARE_FLAG(int, optimization_counter_threshold); // Input parameters: // RSP : points to return address. diff --git a/runtime/vm/weak_code.cc b/runtime/vm/weak_code.cc index eb04d1f339b..0c5cca214ea 100644 --- a/runtime/vm/weak_code.cc +++ b/runtime/vm/weak_code.cc @@ -13,6 +13,8 @@ namespace dart { +DECLARE_FLAG(bool, precompilation); + bool WeakCodeReferences::HasCodes() const { return !array_.IsNull() && (array_.Length() > 0); } @@ -66,7 +68,7 @@ void WeakCodeReferences::DisableCode() { if (code_objects.IsNull()) { return; } - ASSERT(!FLAG_precompiled_mode); + ASSERT(!FLAG_precompilation); UpdateArrayTo(Object::null_array()); // Disable all code on stack. Code& code = Code::Handle();