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

Unified Diff: src/ia32/codegen-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.h ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/codegen-ia32.cc
===================================================================
--- src/ia32/codegen-ia32.cc (revision 4526)
+++ src/ia32/codegen-ia32.cc (working copy)
@@ -5950,6 +5950,7 @@
result.reg(),
&slow_case,
&slow_case,
+ &slow_case,
&slow_case);
__ jmp(&exit);
@@ -12051,7 +12052,8 @@
Register scratch,
Register result,
Label* receiver_not_string,
- Label* index_not_positive_smi,
+ Label* index_not_smi,
+ Label* index_out_of_range,
Label* slow_case) {
Label not_a_flat_string;
Label try_again_with_new_string;
@@ -12070,11 +12072,10 @@
__ test(result, Immediate(kIsNotStringMask));
__ j(not_zero, receiver_not_string);
- // If the index is negative or non-smi trigger the non-positive-smi
- // case.
+ // If the index is non-smi trigger the non-smi case.
ASSERT(kSmiTag == 0);
- __ test(index, Immediate(kSmiTagMask | kSmiSignMask));
- __ j(not_zero, index_not_positive_smi);
+ __ test(index, Immediate(kSmiTagMask));
+ __ j(not_zero, index_not_smi);
// Put untagged index into scratch register.
__ mov(scratch, index);
@@ -12082,13 +12083,13 @@
// Check for index out of range.
__ cmp(scratch, FieldOperand(object, String::kLengthOffset));
- __ j(greater_equal, slow_case);
+ __ j(above_equal, index_out_of_range);
__ bind(&try_again_with_new_string);
// ----------- S t a t e -------------
// -- object : string to access
// -- result : instance type of the string
- // -- scratch : positive smi index < length
+ // -- scratch : non-negative index < length
// -----------------------------------
// We need special handling for non-flat strings.
@@ -12102,7 +12103,7 @@
__ j(not_zero, &ascii_string);
// 2-byte string.
- // Load the 2-byte character code into the temp register.
+ // Load the 2-byte character code into the result register.
__ movzx_w(result, FieldOperand(object,
scratch, times_2,
SeqTwoByteString::kHeaderSize));
@@ -12130,7 +12131,7 @@
// ASCII string.
__ bind(&ascii_string);
- // Load the byte into the temp register.
+ // Load the byte into the result register.
__ movzx_b(result, FieldOperand(object,
scratch, times_1,
SeqAsciiString::kHeaderSize));
« no previous file with comments | « src/ia32/codegen-ia32.h ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698