Commit b7ba63e9 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[deoptimizer] Simplify Runtime_NotifyDeoptimized a bit.

R=jarin@chromium.org

Change-Id: I0cf5eb57b0f1528f08bc47b3bfddced5cff1abf2
Reviewed-on: https://chromium-review.googlesource.com/543118Reviewed-by: 's avatarJaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46088}
parent 21701297
......@@ -175,22 +175,13 @@ RUNTIME_FUNCTION(Runtime_NotifyDeoptimized) {
Handle<Code> optimized_code = deoptimizer->compiled_code();
DCHECK(optimized_code->kind() == Code::OPTIMIZED_FUNCTION);
DCHECK(optimized_code->is_turbofanned());
DCHECK(type == deoptimizer->bailout_type());
DCHECK_NULL(isolate->context());
// TODO(turbofan): For Crankshaft we restore the context before objects are
// being materialized, because it never de-materializes the context but it
// requires a context to materialize arguments objects. This is specific to
// Crankshaft and can be removed once only TurboFan goes through here.
if (!optimized_code->is_turbofanned()) {
JavaScriptFrameIterator top_it(isolate);
JavaScriptFrame* top_frame = top_it.frame();
isolate->set_context(Context::cast(top_frame->context()));
} else {
// TODO(turbofan): We currently need the native context to materialize
// the arguments object, but only to get to its map.
isolate->set_context(function->native_context());
}
// TODO(turbofan): We currently need the native context to materialize
// the arguments object, but only to get to its map.
isolate->set_context(function->native_context());
// Make sure to materialize objects before causing any allocation.
JavaScriptFrameIterator it(isolate);
......@@ -198,11 +189,9 @@ RUNTIME_FUNCTION(Runtime_NotifyDeoptimized) {
delete deoptimizer;
// Ensure the context register is updated for materialized objects.
if (optimized_code->is_turbofanned()) {
JavaScriptFrameIterator top_it(isolate);
JavaScriptFrame* top_frame = top_it.frame();
isolate->set_context(Context::cast(top_frame->context()));
}
JavaScriptFrameIterator top_it(isolate);
JavaScriptFrame* top_frame = top_it.frame();
isolate->set_context(Context::cast(top_frame->context()));
if (type == Deoptimizer::LAZY) {
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