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

Unified Diff: src/deoptimizer.cc

Issue 1572293002: [turbofan] Make context deoptmizable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | src/runtime/runtime-compiler.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 c56cccd12cc9cc30744d3575d186ea837e708f82..4bdafbf1b4113639373f9a5a2ef39f690f8ffd7e 100644
--- a/src/deoptimizer.cc
+++ b/src/deoptimizer.cc
@@ -947,8 +947,6 @@ void Deoptimizer::DoComputeJSFrame(int frame_index) {
input_offset -= kPointerSize;
// Read the context from the translations.
Object* context = value_iterator->GetRawValue();
- // The context should not be a placeholder for a materialized object.
- CHECK(context != isolate_->heap()->arguments_marker());
if (context == isolate_->heap()->undefined_value()) {
// If the context was optimized away, just use the context from
// the activation. This should only apply to Crankshaft code.
@@ -963,6 +961,12 @@ void Deoptimizer::DoComputeJSFrame(int frame_index) {
if (is_topmost) output_frame->SetRegister(context_reg.code(), value);
WriteValueToOutput(context, input_index, frame_index, output_offset,
"context ");
+ if (context == isolate_->heap()->arguments_marker()) {
+ Address output_address =
+ reinterpret_cast<Address>(output_[frame_index]->GetTop()) +
+ output_offset;
+ values_to_materialize_.push_back({output_address, value_iterator});
+ }
value_iterator++;
input_index++;
@@ -3492,6 +3496,10 @@ Handle<Object> TranslatedState::MaterializeAt(int frame_index,
CHECK(lengthObject->ToInt32(&length));
Handle<FixedArray> object =
isolate_->factory()->NewFixedArray(length);
+ // We need to set the map, because the fixed array we are
+ // materializing could be a context or an arguments object,
+ // in which case we must retain that information.
+ object->set_map(*map);
slot->value_ = object;
for (int i = 0; i < length; ++i) {
Handle<Object> value = MaterializeAt(frame_index, value_index);
@@ -3500,6 +3508,7 @@ Handle<Object> TranslatedState::MaterializeAt(int frame_index,
return object;
}
case FIXED_DOUBLE_ARRAY_TYPE: {
+ DCHECK_EQ(*map, isolate_->heap()->fixed_double_array_map());
Handle<Object> lengthObject = MaterializeAt(frame_index, value_index);
int32_t length = 0;
CHECK(lengthObject->ToInt32(&length));
« no previous file with comments | « no previous file | src/runtime/runtime-compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698