From 9f165610d692d5785ab4596d7769421ae18ad4a3 Mon Sep 17 00:00:00 2001 From: Igor Klopov Date: Sun, 25 Sep 2016 18:46:33 +0300 Subject: use ignition+turbofan for sourceless code diff --git a/deps/v8/src/compiler.cc b/deps/v8/src/compiler.cc index 9a5afe9..bf612c6 100644 --- a/deps/v8/src/compiler.cc +++ b/deps/v8/src/compiler.cc @@ -439,11 +439,15 @@ void EnsureFeedbackMetadata(CompilationInfo* info) { CHECK(!info->shared_info()->feedback_metadata()->SpecDiffersFrom( info->literal()->feedback_vector_spec())); } bool ShouldUseIgnition(CompilationInfo* info) { - if (!FLAG_ignition) return false; + ParseInfo* parse_info = info->parse_info(); + Isolate* isolate = parse_info->isolate(); + bool flag = FLAG_ignition || !FLAG_lazy || + parse_info->script()->source()->IsUndefined(isolate); + if (!flag) return false; DCHECK(info->has_shared_info()); // When requesting debug code as a replacement for existing code, we provide // the same kind as the existing code (to prevent implicit tier-change). @@ -648,12 +652,18 @@ bool UseTurboFan(Handle shared) { !optimization_disabled; // 3. Explicitly enabled by the command-line filter. bool passes_turbo_filter = shared->PassesFilter(FLAG_turbo_filter); + // 4. Same option as in ShouldUseIgnition. + Isolate* isolate = shared->GetIsolate(); + Script* script = Script::cast(shared->script()); + bool sourceless_ignition = !FLAG_lazy || + script->source()->IsUndefined(isolate); + return is_turbofanable_asm || is_unsupported_by_crankshaft_but_turbofanable || - passes_turbo_filter; + passes_turbo_filter || sourceless_ignition; } bool GetOptimizedCodeNow(CompilationJob* job) { CompilationInfo* info = job->info(); Isolate* isolate = info->isolate(); diff --git a/deps/v8/src/flag-definitions.h b/deps/v8/src/flag-definitions.h index e5ddbad..a3fb95c 100644 --- a/deps/v8/src/flag-definitions.h +++ b/deps/v8/src/flag-definitions.h @@ -425,11 +425,11 @@ DEFINE_BOOL(omit_map_checks_for_leaf_maps, true, // Flags for TurboFan. DEFINE_BOOL(turbo, false, "enable TurboFan compiler") DEFINE_IMPLICATION(turbo, turbo_asm_deoptimization) DEFINE_IMPLICATION(turbo, turbo_loop_peeling) -DEFINE_BOOL(turbo_from_bytecode, false, "enable building graphs from bytecode") +DEFINE_BOOL(turbo_from_bytecode, true, "enable building graphs from bytecode") DEFINE_BOOL(turbo_sp_frame_access, false, "use stack pointer-relative access to frame wherever possible") DEFINE_BOOL(turbo_preprocess_ranges, true, "run pre-register allocation heuristics") DEFINE_BOOL(turbo_loop_stackcheck, true, "enable stack checks in loops")