Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Unified Diff: src/arm/ic-arm.cc

Issue 7995002: Porting r9392 to arm (smi-only arrays). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/arm/ic-arm.cc
diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc
index 145d668d76c83238d98f8f173ad965c9d5686588..9932125a719baedf5b1712fb22bf8e2e4099cbc2 100644
--- a/src/arm/ic-arm.cc
+++ b/src/arm/ic-arm.cc
@@ -1360,6 +1360,20 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
__ bind(&fast);
Register scratch_value = r4;
Register address = r5;
+ if (FLAG_smi_only_arrays) {
+ Label not_smi_only;
+ // Make sure the elements are smi-only.
+ __ ldr(scratch_value, FieldMemOperand(receiver, HeapObject::kMapOffset));
+ __ CheckFastSmiOnlyElements(scratch_value, scratch_value, &not_smi_only);
+ // Non-smis need to call into the runtime if the array is smi only.
+ __ JumpIfNotSmi(value, &slow);
+ __ add(address, elements,
+ Operand(FixedArray::kHeaderSize - kHeapObjectTag));
+ __ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize));
+ __ str(value, MemOperand(address));
+ __ Ret();
+ __ bind(&not_smi_only);
+ }
// Fast case, store the value to the elements backing store.
__ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
__ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize));

Powered by Google App Engine
This is Rietveld 408576698