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

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

Issue 8008016: Small refactor to KeyedStoreIC::GenerateGeneric to make it slightly faster. (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
« no previous file with comments | « no previous file | src/ia32/ic-ia32.cc » ('j') | src/ia32/ic-ia32.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/ic-arm.cc
diff --git a/src/arm/ic-arm.cc b/src/arm/ic-arm.cc
index 9932125a719baedf5b1712fb22bf8e2e4099cbc2..cadddf3895da4a7679f7271616824bba69dd5273 100644
--- a/src/arm/ic-arm.cc
+++ b/src/arm/ic-arm.cc
@@ -1360,28 +1360,26 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
__ bind(&fast);
Register scratch_value = r4;
Register address = r5;
+
+ Label non_smi_value;
+ __ JumpIfNotSmi(value, &non_smi_value);
+ // It's irrelevant whether array is smi-only or not when writing a smi.
+ __ add(address, elements,
Rico 2011/09/24 18:40:36 fits on one line
+ Operand(FixedArray::kHeaderSize - kHeapObjectTag));
+ __ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize));
+ __ str(value, MemOperand(address));
+ __ Ret();
+
+ __ bind(&non_smi_value);
if (FLAG_smi_only_arrays) {
- Label not_smi_only;
// Make sure the elements are smi-only.
Rico 2011/09/24 18:40:36 Comment seems wrong now, that is not what we check
__ 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);
+ __ CheckFastObjectElements(scratch_value, scratch_value, &slow);
}
- // Fast case, store the value to the elements backing store.
+ // Fast elements array, store the value to the elements backing store.
__ add(address, elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag));
__ add(address, address, Operand(key, LSL, kPointerSizeLog2 - kSmiTagSize));
__ str(value, MemOperand(address));
- // Skip write barrier if the written value is a smi.
- __ tst(value, Operand(kSmiTagMask));
- __ Ret(eq);
-
// Update write barrier for the elements array address.
__ mov(scratch_value, value); // Preserve the value which is returned.
__ RecordWrite(elements,
@@ -1391,7 +1389,6 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
kDontSaveFPRegs,
EMIT_REMEMBERED_SET,
OMIT_SMI_CHECK);
-
__ Ret();
}
« no previous file with comments | « no previous file | src/ia32/ic-ia32.cc » ('j') | src/ia32/ic-ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698