Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: src/deoptimizer.cc

Issue 542613002: Fix deoptimization of context. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/compiler/test-codegen-deopt.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimizer.cc
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc
index 6b381dade9f84080493b10b15efdb5bbf8da8ebc..e874122e133703715d1e5d7af654def060a2775a 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -1067,6 +1067,18 @@ void Deoptimizer::DoComputeJSFrame(TranslationIterator* iterator,
// The context should not be a placeholder for a materialized object.
CHECK(value !=
reinterpret_cast<intptr_t>(isolate_->heap()->arguments_marker()));
+ if (value ==
+ reinterpret_cast<intptr_t>(isolate_->heap()->undefined_value())) {
+ // If the context was optimized away, just use the context from
+ // the activation. This should only apply to Crankshaft code.
+ CHECK(!compiled_code_->is_turbofanned());
+ if (is_bottommost) {
+ value = input_->GetFrameSlot(input_offset);
+ } else {
+ value = reinterpret_cast<intptr_t>(function->context());
+ }
+ output_frame->SetFrameSlot(output_offset, value);
+ }
output_frame->SetContext(value);
if (is_topmost) output_frame->SetRegister(context_reg.code(), value);
if (trace_scope_ != NULL) {
« no previous file with comments | « no previous file | test/cctest/compiler/test-codegen-deopt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698