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)); |