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 <kalmard@homejinni.com>. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10985 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
parent
d46d9a38da
commit
95884b7c6b
@ -1015,6 +1015,16 @@ void FullCodeGenerator::VisitForInStatement(ForInStatement* stmt) {
|
||||
// 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);
|
||||
|
Loading…
Reference in New Issue
Block a user