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

Unified Diff: src/full-codegen/mips64/full-codegen-mips64.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/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/mips64/full-codegen-mips64.cc
diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc
index 8096d6f87b79327054f49139aa4a0bfb79d93713..4a88bab01411148b44065b6b10fc4deb3813bf88 100644
--- a/src/full-codegen/mips64/full-codegen-mips64.cc
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc
@@ -1083,7 +1083,7 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ Daddu(a2, a2, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
__ SmiScale(a4, a0, kPointerSizeLog2);
__ daddu(a4, a2, a4); // Array base + scaled (smi) index.
- __ ld(a3, MemOperand(a4)); // Current entry.
+ __ ld(result_register(), MemOperand(a4)); // Current entry.
// Get the expected map from the stack or a smi in the
// permanent slow case into register a2.
@@ -1098,24 +1098,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())));
- __ sd(a2, FieldMemOperand(a0, FixedArray::OffsetOfElementAt(vector_index)));
+ __ sd(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/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698