| Index: src/full-codegen/mips/full-codegen-mips.cc
|
| diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc
|
| index 83bc1ae91d7fcfe99fff316def388f097ec09968..293a32dcaf3e7055f02290e88855165427d0cdc7 100644
|
| --- a/src/full-codegen/mips/full-codegen-mips.cc
|
| +++ b/src/full-codegen/mips/full-codegen-mips.cc
|
| @@ -1078,11 +1078,11 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
| __ lw(a1, MemOperand(sp, 1 * kPointerSize));
|
| __ Branch(loop_statement.break_label(), hs, a0, Operand(a1));
|
|
|
| - // Get the current entry of the array into register a3.
|
| + // Get the current entry of the array into result_register.
|
| __ lw(a2, MemOperand(sp, 2 * kPointerSize));
|
| __ Addu(a2, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
|
| __ Lsa(t0, a2, a0, kPointerSizeLog2 - kSmiTagSize);
|
| - __ lw(a3, MemOperand(t0)); // Current entry.
|
| + __ lw(result_register(), MemOperand(t0)); // Current entry.
|
|
|
| // Get the expected map from the stack or a smi in the
|
| // permanent slow case into register a2.
|
| @@ -1097,24 +1097,25 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
|
|
| // We need to filter the key, record slow-path here.
|
| int const vector_index = SmiFromSlot(slot)->value();
|
| - __ EmitLoadTypeFeedbackVector(a0);
|
| + __ EmitLoadTypeFeedbackVector(a3);
|
| __ li(a2, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
|
| - __ sw(a2, FieldMemOperand(a0, FixedArray::OffsetOfElementAt(vector_index)));
|
| + __ sw(a2, FieldMemOperand(a3, FixedArray::OffsetOfElementAt(vector_index)));
|
|
|
| - // Convert the entry to a string or (smi) 0 if it isn't a property
|
| - // any more. If the property has been removed while iterating, we
|
| - // just skip it.
|
| - __ Push(a1, a3); // Enumerable and current entry.
|
| - __ CallRuntime(Runtime::kForInFilter);
|
| + __ mov(a0, result_register());
|
| + // a0 contains the key. The receiver in a1 is the second argument to the
|
| + // ForInFilterStub. ForInFilter returns undefined if the receiver doesn't
|
| + // have the key or returns the name-converted key.
|
| + ForInFilterStub filter_stub(isolate());
|
| + __ CallStub(&filter_stub);
|
| + RestoreContext();
|
| PrepareForBailoutForId(stmt->FilterId(), BailoutState::TOS_REGISTER);
|
| - __ mov(a3, result_register());
|
| __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
|
| - __ Branch(loop_statement.continue_label(), eq, a3, Operand(at));
|
| + __ Branch(loop_statement.continue_label(), eq, result_register(),
|
| + Operand(at));
|
|
|
| // Update the 'each' property or variable from the possibly filtered
|
| - // entry in register a3.
|
| + // entry in the result_register.
|
| __ bind(&update_each);
|
| - __ mov(result_register(), a3);
|
| // Perform the assignment as if via '='.
|
| { EffectContext context(this);
|
| EmitAssignment(stmt->each(), stmt->EachFeedbackSlot());
|
|
|