Chromium Code Reviews| Index: src/compiler.cc |
| diff --git a/src/compiler.cc b/src/compiler.cc |
| index 33ed39847b50dcb52af5d92ce91da06cf562630a..839542c8020fd16559481c3a53164a872cfeaff1 100644 |
| --- a/src/compiler.cc |
| +++ b/src/compiler.cc |
| @@ -348,10 +348,8 @@ bool UseTurboFan(Handle<SharedFunctionInfo> shared) { |
| passes_turbo_filter; |
| } |
| -bool ShouldUseIgnition(CompilationInfo* info) { |
| - DCHECK(info->has_shared_info()); |
| - Handle<SharedFunctionInfo> shared = info->shared_info(); |
| - |
| +bool ShouldUseIgnition(Handle<SharedFunctionInfo> shared, |
| + bool marked_as_debug) { |
| // Code which can't be supported by the old pipeline should use Ignition. |
| if (shared->must_use_ignition_turbo()) return true; |
| @@ -370,7 +368,7 @@ bool ShouldUseIgnition(CompilationInfo* 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). |
| - if (info->is_debug() && shared->is_compiled()) { |
| + if (marked_as_debug && shared->is_compiled()) { |
| return !shared->HasBaselineCode(); |
| } |
| @@ -381,6 +379,11 @@ bool ShouldUseIgnition(CompilationInfo* info) { |
| return FLAG_ignition; |
| } |
| +bool ShouldUseIgnition(CompilationInfo* info) { |
| + DCHECK(info->has_shared_info()); |
| + return ShouldUseIgnition(info->shared_info(), info->is_debug()); |
| +} |
| + |
| bool UseAsmWasm(DeclarationScope* scope, Handle<SharedFunctionInfo> shared_info, |
| bool is_debug) { |
| return FLAG_validate_asm && scope->asm_module() && |
| @@ -843,8 +846,12 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function, |
| DCHECK(!isolate->has_pending_exception()); |
| PostponeInterruptsScope postpone(isolate); |
| bool use_turbofan = UseTurboFan(shared) || ignition_osr; |
| + bool has_script = shared->script()->IsScript(); |
| + // BUG(5946): This DCHECK is necessary to make certain that we won't tolerate |
| + // the lack of a script without bytecode. |
| + DCHECK_IMPLIES(!has_script, ShouldUseIgnition(shared, false)); |
| std::unique_ptr<CompilationJob> job( |
| - use_turbofan ? compiler::Pipeline::NewCompilationJob(function) |
| + use_turbofan ? compiler::Pipeline::NewCompilationJob(function, has_script) |
| : new HCompilationJob(function)); |
| CompilationInfo* info = job->info(); |
| ParseInfo* parse_info = info->parse_info(); |
| @@ -1067,17 +1074,6 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) { |
| switch (Compiler::NextCompilationTier(*function)) { |
| case Compiler::BASELINE: { |
|
Leszek Swirski
2017/02/15 14:58:37
Can you add a comment here stating that we don't t
mvstanton
2017/02/15 15:18:46
Yep, done.
|
| - if (FLAG_trace_opt) { |
| - PrintF("[recompiling function "); |
| - function->ShortPrint(); |
| - PrintF( |
| - " to baseline eagerly (shared function marked for tier up)]\n"); |
| - } |
| - |
| - Handle<Code> code; |
| - if (GetBaselineCode(function).ToHandle(&code)) { |
| - return code; |
| - } |
| break; |
| } |
| case Compiler::OPTIMIZED: { |