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

Unified Diff: src/full-codegen/mips/full-codegen-mips.cc

Issue 2151773002: Avoid jumping to the runtime for ForInFilter (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: remove double label Created 4 years, 5 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 | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698