Index: src/ia32/ic-ia32.cc |
diff --git a/src/ia32/ic-ia32.cc b/src/ia32/ic-ia32.cc |
index 3c49e60a5920f97256b680d1da89727203c2ec68..56aa5e212157ad1fe47d0953d57a973d4070bec5 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; |
// Check that the object isn't a smi. |
__ JumpIfSmi(edx, &slow); |
@@ -810,6 +810,19 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm, |
// ecx: key (a smi) |
// edx: receiver |
// edi: FixedArray receiver->elements |
+ |
+ if (FLAG_smi_only_arrays) { |
+ // Make sure that the elements are not smi-only |
Sven Panne
2011/09/16 09:19:32
Hmmm, we make sure that the elements *are* smi-onl
danno
2011/09/21 14:32:04
Done.
|
+ __ 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 |
+ __ JumpIfNotSmi(eax, &slow); |
Jakob Kummerow
2011/09/16 16:30:34
I think all these added lines (up to and including
danno
2011/09/21 14:32:04
Done.
|
+ __ 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. |
__ mov(edx, Operand(eax)); |