Commit af03e40c authored by vegorov@chromium.org's avatar vegorov@chromium.org

Force lazy deoptimization and remove optimized code on deopt inside a recursively invoked function.

R=fschneider@chromium.org,sgjesse@chromium.org
BUG=
TEST=

Review URL: http://codereview.chromium.org/7890028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9285 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent e5384110
......@@ -8234,8 +8234,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) {
if (type == Deoptimizer::EAGER) {
RUNTIME_ASSERT(function->IsOptimized());
} else {
RUNTIME_ASSERT(!function->IsOptimized());
}
// Avoid doing too much work when running with --always-opt and keep
......@@ -8254,8 +8252,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) {
it.Advance();
}
// TODO(kasperl): For now, we cannot support removing the optimized
// code when we have recursive invocations of the same function.
if (activations == 0) {
if (FLAG_trace_deopt) {
PrintF("[removing optimized code for: ");
......@@ -8263,6 +8259,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NotifyDeoptimized) {
PrintF("]\n");
}
function->ReplaceCode(function->shared()->code());
} else {
Deoptimizer::DeoptimizeFunction(*function);
}
return isolate->heap()->undefined_value();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment