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

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

Issue 1750017: Port string keyed load IC improvements (r4444) to x64. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 8 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 | « src/ia32/codegen-ia32.cc ('k') | src/x64/codegen-x64.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/ic-ia32.cc
===================================================================
--- src/ia32/ic-ia32.cc (revision 4526)
+++ src/ia32/ic-ia32.cc (working copy)
@@ -496,7 +496,8 @@
// -- esp[0] : return address
// -----------------------------------
Label miss;
- Label not_positive_smi;
+ Label index_not_smi;
+ Label index_out_of_range;
Label slow_char_code;
Label got_char_code;
@@ -511,7 +512,8 @@
scratch,
code,
&miss, // When not a string.
- &not_positive_smi,
+ &index_not_smi,
+ &index_out_of_range,
&slow_char_code);
// If we didn't bail out, code register contains smi tagged char
// code.
@@ -521,14 +523,9 @@
__ Abort("Unexpected fall-through from char from code tail call");
#endif
- // Check if key is a smi or a heap number.
- __ bind(&not_positive_smi);
- ASSERT(kSmiTag == 0);
- __ test(index, Immediate(kSmiTagMask));
- __ j(zero, &slow_char_code);
- __ mov(ecx, FieldOperand(eax, HeapObject::kMapOffset));
- __ cmp(ecx, Factory::heap_number_map());
- __ j(not_equal, &miss);
+ // Check if key is a heap number.
+ __ bind(&index_not_smi);
+ __ CheckMap(index, Factory::heap_number_map(), &miss, true);
// Push receiver and key on the stack (now that we know they are a
// string and a number), and call runtime.
@@ -553,6 +550,7 @@
}
__ cmp(code, Factory::nan_value());
__ j(not_equal, &got_char_code);
+ __ bind(&index_out_of_range);
__ Set(eax, Immediate(Factory::undefined_value()));
__ ret(0);
« no previous file with comments | « src/ia32/codegen-ia32.cc ('k') | src/x64/codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698