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

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

Issue 1644383002: PPC: [for-in] Ensure that we learn from deopts within for-in loop bodies. (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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/ppc/full-codegen-ppc.cc
diff --git a/src/full-codegen/ppc/full-codegen-ppc.cc b/src/full-codegen/ppc/full-codegen-ppc.cc
index 0abae3d6271892fc18a4ede5d3e7087740b0ca9b..a309d12fd0df4235cf7ac03663b33dc23b8417f6 100644
--- a/src/full-codegen/ppc/full-codegen-ppc.cc
+++ b/src/full-codegen/ppc/full-codegen-ppc.cc
@@ -1076,9 +1076,9 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
// We got a fixed array in register r3. Iterate through that.
__ bind(&fixed_array);
+ int const vector_index = SmiFromSlot(slot)->value();
__ EmitLoadTypeFeedbackVector(r4);
__ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
- int vector_index = SmiFromSlot(slot)->value();
__ StoreP(
r5, FieldMemOperand(r4, FixedArray::OffsetOfElementAt(vector_index)), r0);
__ LoadSmiLiteral(r4, Smi::FromInt(1)); // Smi(1) indicates slow check
@@ -1117,6 +1117,17 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
__ cmp(r7, r5);
__ beq(&update_each);
+ // We might get here from TurboFan or Crankshaft when something in the
+ // for-in loop body deopts and only now notice in fullcodegen, that we
+ // can now longer use the enum cache, i.e. left fast mode. So better record
+ // this information here, in case we later OSR back into this loop or
+ // reoptimize the whole function w/o rerunning the loop with the slow
+ // mode object in fullcodegen (which would result in a deopt loop).
+ __ EmitLoadTypeFeedbackVector(r3);
+ __ mov(r5, Operand(TypeFeedbackVector::MegamorphicSentinel(isolate())));
+ __ StoreP(
+ r5, FieldMemOperand(r3, FixedArray::OffsetOfElementAt(vector_index)), r0);
+
// 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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698