Index: src/ia32/ic-ia32.cc |
diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc |
index e81357c4ffd3849537b1f25ad10b77515d455f4f..2f3e681c8428300767671277f09eb8961359733f 100644 |
--- a/src/ia32/ic-ia32.cc |
+++ b/src/ia32/ic-ia32.cc |
@@ -734,7 +734,7 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
// -- edx : receiver |
// -- esp[0] : return address |
// ----------------------------------- |
- Label slow, fast, array, extra; |
+ Label slow, fast, array, extra, not_smi_only; |
Yang
2011/09/21 14:47:50
Only the if-block uses not_smi_only. Put it there
danno
2011/09/22 11:23:15
Done.
|
// Check that the object isn't a smi. |
__ JumpIfSmi(edx, &slow); |
@@ -810,6 +810,18 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
// ecx: key (a smi) |
// edx: receiver |
// edi: FixedArray receiver->elements |
+ |
+ if (FLAG_smi_only_arrays) { |
+ // Make sure the elements are smi-only. |
+ __ mov(ebx, FieldOperand(edx, HeapObject::kMapOffset)); |
+ __ CheckFastSmiOnlyElements(ebx, ¬_smi_only, Label::kNear); |
+ // Non-smis need to call into the runtime if the array is smi only |
Yang
2011/09/21 14:47:50
Nit: comment should end with a period.
danno
2011/09/22 11:23:15
Done.
|
+ __ JumpIfNotSmi(eax, &slow); |
+ __ mov(CodeGenerator::FixedArrayElementOperand(edi, ecx), eax); |
+ __ ret(0); |
+ __ bind(¬_smi_only); |
+ } |
+ |
__ mov(CodeGenerator::FixedArrayElementOperand(edi, ecx), eax); |
// Update write barrier for the elements array address. |