Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index 54e9eaf1d60969a65cd0ac17dd852e1a3bcf411e..c4c1e87a23d63375d64beb43d206e52ca8909e0c 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -342,7 +342,7 @@ void FullCodeGenerator::EmitBackEdgeBookkeeping(IterationStatement* stmt, |
ASSERT(back_edge_target->is_bound()); |
int distance = masm_->SizeOfCodeGeneratedSince(back_edge_target); |
weight = Min(kMaxBackEdgeWeight, |
- Max(1, distance / kCodeSizeMultiplier)); |
+ Max(1, distance / kBackEdgeDistanceUnit)); |
} |
EmitProfilingCounterDecrement(weight); |
__ j(positive, &ok, Label::kNear); |
@@ -384,7 +384,7 @@ void FullCodeGenerator::EmitReturnSequence() { |
} else if (FLAG_weighted_back_edges) { |
int distance = masm_->pc_offset(); |
weight = Min(kMaxBackEdgeWeight, |
- Max(1, distance / kCodeSizeMultiplier)); |
+ Max(1, distance / kBackEdgeDistanceUnit)); |
} |
EmitProfilingCounterDecrement(weight); |
Label ok; |
@@ -1788,8 +1788,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
} |
if (!result_saved) { |
- __ push(eax); // array literal. |
- __ push(Immediate(Smi::FromInt(expr->literal_index()))); |
+ __ push(eax); |
result_saved = true; |
} |
VisitForAccumulatorValue(subexpr); |
@@ -1798,7 +1797,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
// Fast-case array literal with ElementsKind of FAST_*_ELEMENTS, they |
// cannot transition and don't need to call the runtime stub. |
int offset = FixedArray::kHeaderSize + (i * kPointerSize); |
- __ mov(ebx, Operand(esp, kPointerSize)); // Copy of array literal. |
+ __ mov(ebx, Operand(esp, 0)); // Copy of array literal. |
__ mov(ebx, FieldOperand(ebx, JSObject::kElementsOffset)); |
// Store the subexpression value in the array's elements. |
__ mov(FieldOperand(ebx, offset), result_register()); |
@@ -1809,7 +1808,10 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
INLINE_SMI_CHECK); |
} else { |
// Store the subexpression value in the array's elements. |
+ __ mov(ebx, Operand(esp, 0)); // Copy of array literal. |
+ __ mov(edi, FieldOperand(ebx, JSObject::kMapOffset)); |
__ mov(ecx, Immediate(Smi::FromInt(i))); |
+ __ mov(edx, Immediate(Smi::FromInt(expr->literal_index()))); |
StoreArrayLiteralElementStub stub; |
__ CallStub(&stub); |
} |
@@ -1818,7 +1820,6 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
} |
if (result_saved) { |
- __ add(esp, Immediate(kPointerSize)); // literal index |
context()->PlugTOS(); |
} else { |
context()->Plug(eax); |