Chromium Code Reviews| Index: src/ia32/full-codegen-ia32.cc |
| =================================================================== |
| --- src/ia32/full-codegen-ia32.cc (revision 6006) |
| +++ src/ia32/full-codegen-ia32.cc (working copy) |
| @@ -3108,6 +3108,13 @@ |
| __ test(temp, Immediate(kSmiTagMask)); |
| __ j(not_zero, &slow_case); |
| + // Check that both indices are valid. |
| + __ mov(temp, FieldOperand(object, JSArray::kLengthOffset)); |
| + __ cmp(temp, Operand(index_1)); |
| + __ j(less_equal, &slow_case); |
| + __ cmp(temp, Operand(index_2)); |
| + __ j(less_equal, &slow_case); |
|
Lasse Reichstein
2010/12/15 08:34:55
I just noticed that there is no test for negative
Karl Klose
2010/12/15 09:11:45
Done.
|
| + |
| // Bring addresses into index1 and index2. |
| __ lea(index_1, CodeGenerator::FixedArrayElementOperand(elements, index_1)); |
| __ lea(index_2, CodeGenerator::FixedArrayElementOperand(elements, index_2)); |