Index: src/compiler.cc |
diff --git a/src/compiler.cc b/src/compiler.cc |
index 10179819bca20f7ab51b7ae80076d9cc21e71d02..e6927c6e7ef9b6bcaa9f54532e008887caebb7a9 100644 |
--- a/src/compiler.cc |
+++ b/src/compiler.cc |
@@ -947,26 +947,27 @@ MaybeHandle<Code> GetBaselineCode(Handle<JSFunction> function) { |
} |
// TODO(4280): For now we disable switching to baseline code in the presence |
- // of interpreter activations of the given function. The reasons are: |
- // 1) The debugger assumes each function is either full-code or bytecode. |
- // 2) The underlying bytecode is cleared below, breaking stack unwinding. |
- InterpreterActivationsFinder activations_finder(function->shared()); |
- if (HasInterpreterActivations(isolate, &activations_finder)) { |
- if (FLAG_trace_opt) { |
- OFStream os(stdout); |
- os << "[unable to switch " << Brief(*function) << " due to activations]" |
- << std::endl; |
- } |
- |
- if (activations_finder.MarkActivationsForBaselineOnReturn(isolate)) { |
+ // of interpreter activations of the given function. The reasons is that the |
+ // underlying bytecode is cleared below. |
rmcilroy
2016/08/22 15:33:03
nit - could you update the comment to mention we o
Michael Starzinger
2016/08/22 15:44:22
Done.
|
+ if (!FLAG_ignition_preserve_bytecode) { |
+ InterpreterActivationsFinder activations_finder(function->shared()); |
+ if (HasInterpreterActivations(isolate, &activations_finder)) { |
if (FLAG_trace_opt) { |
OFStream os(stdout); |
- os << "[marking " << Brief(function->shared()) |
- << " for baseline recompilation on return]" << std::endl; |
+ os << "[unable to switch " << Brief(*function) << " due to activations]" |
+ << std::endl; |
} |
- } |
- return MaybeHandle<Code>(); |
+ if (activations_finder.MarkActivationsForBaselineOnReturn(isolate)) { |
+ if (FLAG_trace_opt) { |
+ OFStream os(stdout); |
+ os << "[marking " << Brief(function->shared()) |
+ << " for baseline recompilation on return]" << std::endl; |
+ } |
+ } |
+ |
+ return MaybeHandle<Code>(); |
+ } |
} |
if (FLAG_trace_opt) { |
@@ -1414,12 +1415,11 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) { |
if (shared->is_resumable()) return false; |
// TODO(4280): For now we disable switching to baseline code in the presence |
- // of interpreter activations of the given function. The reasons are: |
- // 1) The debugger assumes each function is either full-code or bytecode. |
- // 2) The underlying bytecode is cleared below, breaking stack unwinding. |
- // The expensive check for activations only needs to be done when the given |
- // function has bytecode, otherwise we can be sure there are no activations. |
- if (shared->HasBytecodeArray()) { |
+ // of interpreter activations of the given function. The reasons is that the |
+ // underlying bytecode is cleared below. The expensive check for activations |
+ // only needs to be done when the given function has bytecode, otherwise we |
+ // can be sure there are no activations. |
rmcilroy
2016/08/22 15:33:03
And here
Michael Starzinger
2016/08/22 15:44:22
Done.
|
+ if (!FLAG_ignition_preserve_bytecode && shared->HasBytecodeArray()) { |
InterpreterActivationsFinder activations_finder(*shared); |
if (HasInterpreterActivations(info->isolate(), &activations_finder)) { |
return false; |
@@ -1439,8 +1439,8 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) { |
// TODO(4280): For now we play it safe and remove the bytecode array when we |
// switch to baseline code. We might consider keeping around the bytecode so |
// that it can be used as the "source of truth" eventually. |
rmcilroy
2016/08/22 15:33:03
nit - could you update the comment
Michael Starzinger
2016/08/22 15:44:23
Done.
|
- if (shared->HasBytecodeArray()) { |
- if (!FLAG_ignition_preserve_bytecode) shared->ClearBytecodeArray(); |
+ if (!FLAG_ignition_preserve_bytecode && shared->HasBytecodeArray()) { |
+ shared->ClearBytecodeArray(); |
} |
// The scope info might not have been set if a lazily compiled |