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

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

Issue 7992003: Porting r9392 to x64 (smi-only arrays). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: save one memory access. 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/x64/ic-x64.cc
diff --git a/src/x64/ic-x64.cc b/src/x64/ic-x64.cc
index 359b595a8dc329ad1f7b3d0137a89188ec2e2ae5..4541d23bceb1b0d4af3608d707e9431b5e73dedb 100644
--- a/src/x64/ic-x64.cc
+++ b/src/x64/ic-x64.cc
@@ -692,6 +692,20 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
// rax: value
// rbx: receiver's elements array (a FixedArray)
// rcx: index
+
+ if (FLAG_smi_only_arrays) {
William Hesse 2011/09/23 13:25:22 The JumpIfNotSmi can be moved above the guard, tog
Yang 2011/09/23 14:19:12 Done.
+ Label not_smi_only;
+ // Make sure the elements are smi-only.
+ __ movq(rdi, FieldOperand(rdx, HeapObject::kMapOffset));
+ __ CheckFastSmiOnlyElements(rdi, &not_smi_only, Label::kNear);
+ // Non-smis need to call into the runtime if the array is smi only.
+ __ JumpIfNotSmi(rax, &slow);
+ __ movq(FieldOperand(rbx, rcx, times_pointer_size, FixedArray::kHeaderSize),
+ rax);
+ __ ret(0);
+ __ bind(&not_smi_only);
+ }
+
Label non_smi_value;
__ movq(FieldOperand(rbx, rcx, times_pointer_size, FixedArray::kHeaderSize),
rax);

Powered by Google App Engine
This is Rietveld 408576698