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 .
This commit is contained in:
Ryan Macnak
2016-02-24 18:08:01 -08:00
parent 5c9f18c6c8
commit bd85deaf4e
63 changed files with 253 additions and 172 deletions
-3
View File
@@ -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");
-9
View File
@@ -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.
+1
View File
@@ -15,6 +15,7 @@
namespace dart {
DECLARE_FLAG(bool, trace_irregexp);
DECLARE_FLAG(bool, interpret_irregexp);
DEFINE_NATIVE_ENTRY(JSSyntaxRegExp_factory, 4) {
+8 -6
View File
@@ -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;
}
+3
View File
@@ -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;
+2
View File
@@ -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)
+1
View File
@@ -18,6 +18,7 @@
namespace dart {
DEFINE_FLAG(bool, print_stop_message, true, "Print stop message.");
DECLARE_FLAG(bool, inline_alloc);
+3
View File
@@ -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));
+3
View File
@@ -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_(),
+2 -9
View File
@@ -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();
+2
View File
@@ -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.
+3 -1
View File
@@ -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);
+12 -1
View File
@@ -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);
+9 -6
View File
@@ -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
+2 -3
View File
@@ -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);
+2
View File
@@ -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())
+4 -2
View File
@@ -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);
+1 -6
View File
@@ -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);
+2 -1
View File
@@ -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();
+3
View File
@@ -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
+3 -38
View File
@@ -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_
-1
View File
@@ -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.
+1
View File
@@ -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);
+2
View File
@@ -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())
+65 -54
View File
@@ -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;
+3 -2
View File
@@ -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) {
+3 -2
View File
@@ -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) {
+3 -2
View File
@@ -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 {
+3 -2
View File
@@ -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) {
+3 -2
View File
@@ -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) {
+4 -3
View File
@@ -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;
+2 -1
View File
@@ -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_);
+1
View File
@@ -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) {
-3
View File
@@ -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");
}
}
+5
View File
@@ -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)
+7 -1
View File
@@ -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();
+7 -1
View File
@@ -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();
+4
View File
@@ -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) {
+7 -1
View File
@@ -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();
+7 -1
View File
@@ -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();
+2
View File
@@ -18,6 +18,8 @@
namespace dart {
DECLARE_FLAG(bool, interpret_irregexp);
// When entering intrinsics code:
// R4: Arguments descriptor
// LR: Return address
+2
View File
@@ -17,6 +17,8 @@
namespace dart {
DECLARE_FLAG(bool, interpret_irregexp);
// When entering intrinsics code:
// R4: Arguments descriptor
// LR: Return address
+2
View File
@@ -24,6 +24,8 @@
namespace dart {
DECLARE_FLAG(bool, interpret_irregexp);
// When entering intrinsics code:
// ECX: IC Data
// EDX: Arguments descriptor
+2
View File
@@ -17,6 +17,8 @@
namespace dart {
DECLARE_FLAG(bool, interpret_irregexp);
// When entering intrinsics code:
// S4: Arguments descriptor
// RA: Return address
+2
View File
@@ -17,6 +17,8 @@
namespace dart {
DECLARE_FLAG(bool, interpret_irregexp);
// When entering intrinsics code:
// R10: Arguments descriptor
// TOS: Return address
+1
View File
@@ -14,6 +14,7 @@
namespace dart {
DECLARE_FLAG(bool, deoptimize_alot);
DECLARE_FLAG(bool, trace_natives);
DECLARE_FLAG(bool, verify_on_transition);
+4 -1
View File
@@ -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();
+2
View File
@@ -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,
+1
View File
@@ -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);
+9
View File
@@ -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();
}
+8 -3
View File
@@ -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);
}
+1
View File
@@ -15,6 +15,7 @@ namespace dart {
#ifndef PRODUCT
DECLARE_FLAG(bool, background_compilation);
DECLARE_FLAG(bool, profile_vm);
DECLARE_FLAG(int, max_profile_depth);
+3
View File
@@ -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())
+4 -1
View File
@@ -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.
+2
View File
@@ -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;
+3
View File
@@ -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;
+4 -5
View File
@@ -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<T extends num> {"
@@ -1664,9 +1666,6 @@ UNIT_TEST_CASE(ScriptSnapshot2) {
}
#endif // !PRODUCT
TEST_CASE(IntArrayMessage) {
StackZone zone(Thread::Current());
uint8_t* buffer = NULL;
+1
View File
@@ -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.
+1
View File
@@ -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.
+1
View File
@@ -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<int32_t>(sizeof(x))
+1
View File
@@ -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.
+1
View File
@@ -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.
+3 -1
View File
@@ -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();