[deoptimizer] Simplify Runtime_NotifyDeoptimized a bit.

R=jarin@chromium.org

Change-Id: I0cf5eb57b0f1528f08bc47b3bfddced5cff1abf2
Reviewed-on: https://chromium-review.googlesource.com/543118
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46088}
This commit is contained in:
Michael Starzinger 2017-06-21 12:57:31 +02:00 committed by Commit Bot
parent 217012973c
commit b7ba63e931

View File

@ -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();