Revision: 10985
Author:   [email protected]
Date:     Fri Mar  9 04:30:04 2012
Log: MIPS: Introduce basic type feedback for for-in statements to avoid deopts.

Port r10901 (a54f1a3).

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9586004
Patch from Daniel Kalmar <[email protected]>.
http://code.google.com/p/v8/source/detail?r=10985

Modified:
 /branches/bleeding_edge/src/mips/full-codegen-mips.cc

=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Wed Mar 7 05:24:44 2012 +++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Fri Mar 9 04:30:04 2012
@@ -1015,6 +1015,16 @@
   // We got a fixed array in register v0. Iterate through that.
   Label non_proxy;
   __ bind(&fixed_array);
+
+  Handle<JSGlobalPropertyCell> cell =
+      isolate()->factory()->NewJSGlobalPropertyCell(
+          Handle<Object>(
+              Smi::FromInt(TypeFeedbackCells::kForInFastCaseMarker)));
+  RecordTypeFeedbackCell(stmt->PrepareId(), cell);
+  __ LoadHeapObject(a1, cell);
+ __ li(a2, Operand(Smi::FromInt(TypeFeedbackCells::kForInSlowCaseMarker)));
+  __ sw(a2, FieldMemOperand(a1, JSGlobalPropertyCell::kValueOffset));
+
   __ li(a1, Operand(Smi::FromInt(1)));  // Smi indicates slow check
   __ lw(a2, MemOperand(sp, 0 * kPointerSize));  // Get enumerated object
   STATIC_ASSERT(FIRST_JS_PROXY_TYPE == FIRST_SPEC_OBJECT_TYPE);

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to