Index: src/deoptimizer.cc |
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc |
index 98c4ac2c89141a4b0c3e54193166a72a65880b31..a825ebe5eeb777a9775a957175ba632c7764c6b2 100644 |
--- a/src/deoptimizer.cc |
+++ b/src/deoptimizer.cc |
@@ -885,8 +885,9 @@ void Deoptimizer::MaterializeHeapObjects(JavaScriptFrameIterator* it) { |
frame->SetExpression(i, *arguments); |
ASSERT_EQ(Memory::Object_at(descriptor.slot_address()), *arguments); |
if (trace_) { |
- PrintF("Materializing %sarguments object for %p: ", |
+ PrintF("Materializing %sarguments object of length %d for %p: ", |
frame->has_adapted_arguments() ? "(adapted) " : "", |
+ arguments->elements()->length(), |
reinterpret_cast<void*>(descriptor.slot_address())); |
arguments->ShortPrint(); |
PrintF("\n"); |
@@ -1180,6 +1181,7 @@ void Deoptimizer::DoTranslateCommand(TranslationIterator* iterator, |
} |
case Translation::ARGUMENTS_OBJECT: { |
+ bool args_known = iterator->Next(); |
int args_index = iterator->Next() + 1; // Skip receiver. |
int args_length = iterator->Next() - 1; // Skip receiver. |
if (trace_) { |
@@ -1187,7 +1189,7 @@ void Deoptimizer::DoTranslateCommand(TranslationIterator* iterator, |
output_[frame_index]->GetTop() + output_offset, |
output_offset); |
isolate_->heap()->arguments_marker()->ShortPrint(); |
- PrintF(" ; arguments object\n"); |
+ PrintF(" ; %sarguments object\n", args_known ? "" : "dummy "); |
} |
// Use the arguments marker value as a sentinel and fill in the arguments |
// object after the deoptimized frame is built. |
@@ -1200,7 +1202,9 @@ void Deoptimizer::DoTranslateCommand(TranslationIterator* iterator, |
// actual arguments object after the deoptimized frame is built. |
for (int i = 0; i < args_length; i++) { |
unsigned input_offset = input_->GetOffsetFromSlotIndex(args_index + i); |
- intptr_t input_value = input_->GetFrameSlot(input_offset); |
+ intptr_t input_value = args_known |
+ ? input_->GetFrameSlot(input_offset) |
+ : reinterpret_cast<intptr_t>(isolate_->heap()->the_hole_value()); |
AddArgumentsObjectValue(input_value); |
} |
return; |
@@ -1841,8 +1845,11 @@ void Translation::StoreLiteral(int literal_id) { |
} |
-void Translation::StoreArgumentsObject(int args_index, int args_length) { |
+void Translation::StoreArgumentsObject(bool args_known, |
+ int args_index, |
+ int args_length) { |
buffer_->Add(ARGUMENTS_OBJECT, zone()); |
+ buffer_->Add(args_known, zone()); |
buffer_->Add(args_index, zone()); |
buffer_->Add(args_length, zone()); |
} |
@@ -1873,9 +1880,9 @@ int Translation::NumberOfOperandsFor(Opcode opcode) { |
case BEGIN: |
case ARGUMENTS_ADAPTOR_FRAME: |
case CONSTRUCT_STUB_FRAME: |
- case ARGUMENTS_OBJECT: |
return 2; |
case JS_FRAME: |
+ case ARGUMENTS_OBJECT: |
return 3; |
} |
UNREACHABLE(); |