Chromium Code Reviews| Index: src/compiler.cc |
| diff --git a/src/compiler.cc b/src/compiler.cc |
| index d99f8d181b2e53d3407d0eb75ec005777718e749..e0b18a94ca3df2e7a835061c2ba6489d478b8ec7 100644 |
| --- a/src/compiler.cc |
| +++ b/src/compiler.cc |
| @@ -939,6 +939,13 @@ MaybeHandle<Code> GetBaselineCode(Handle<JSFunction> function) { |
| return info.code(); |
| } |
| +bool ShouldOptimizeForAsm(Isolate* isolate, Handle<JSFunction> function) { |
| + // If the debugger is active, do not compile with turbofan unless we can |
| + // deopt from turbofan code. |
| + return FLAG_turbo_asm && function->shared()->asm_function() && |
| + (FLAG_turbo_asm_deoptimization || !isolate->debug()->is_active()); |
|
Michael Starzinger
2016/05/20 11:45:10
What would you thing about guarding this by FLAG_i
rmcilroy
2016/05/20 12:42:03
Is there any particularly reason we abandoned it?
Michael Starzinger
2016/05/23 14:45:38
As discussed offline: I am afraid this will tank o
rmcilroy
2016/05/23 15:07:53
Sounds good, I've updated this CL to only do this
titzer
2016/05/23 15:48:34
It's not type feedback, it's just that TF is too h
|
| +} |
| + |
| MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) { |
| Isolate* isolate = function->GetIsolate(); |
| DCHECK(!isolate->has_pending_exception()); |
| @@ -971,7 +978,7 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) { |
| Handle<Code> result; |
| ASSIGN_RETURN_ON_EXCEPTION(isolate, result, GetUnoptimizedCode(&info), Code); |
| - if (FLAG_always_opt) { |
| + if (FLAG_always_opt || ShouldOptimizeForAsm(isolate, function)) { |
|
Michael Starzinger
2016/05/20 11:45:10
Can we keep the optimization path for production a
rmcilroy
2016/05/20 12:42:03
Done.
|
| Handle<Code> opt_code; |
| if (GetOptimizedCode(function, Compiler::NOT_CONCURRENT) |
| .ToHandle(&opt_code)) { |
| @@ -1764,9 +1771,11 @@ void Compiler::FinalizeCompilationJob(CompilationJob* raw_job) { |
| void Compiler::PostInstantiation(Handle<JSFunction> function, |
| PretenureFlag pretenure) { |
| + Isolate* isolate = function->GetIsolate(); |
| Handle<SharedFunctionInfo> shared(function->shared()); |
| - if (FLAG_always_opt && shared->allows_lazy_compilation()) { |
| + if ((FLAG_always_opt || ShouldOptimizeForAsm(isolate, function)) && |
|
Michael Starzinger
2016/05/20 11:45:10
I am not entirely sure why this is needed. For fun
rmcilroy
2016/05/20 12:42:03
This is for the eager compilation pipeline (--igni
rmcilroy
2016/05/23 09:28:16
I just realized, this would mark all new functions
Michael Starzinger
2016/05/23 14:45:38
Acknowledged. New version in patch set #5 works fo
|
| + shared->allows_lazy_compilation()) { |
| function->MarkForOptimization(); |
| } |
| @@ -1782,7 +1791,6 @@ void Compiler::PostInstantiation(Handle<JSFunction> function, |
| if (cached.literals != nullptr) { |
| function->set_literals(cached.literals); |
| } else { |
| - Isolate* isolate = function->GetIsolate(); |
| int number_of_literals = shared->num_literals(); |
| Handle<LiteralsArray> literals = |
| LiteralsArray::New(isolate, handle(shared->feedback_vector()), |