OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3301 ASSERT(kSmiTag == 0); | 3301 ASSERT(kSmiTag == 0); |
3302 __ tst(r0, Operand(kSmiTagMask | 0x80000000u)); | 3302 __ tst(r0, Operand(kSmiTagMask | 0x80000000u)); |
3303 __ b(ne, &slow); // The index was negative or not a Smi. | 3303 __ b(ne, &slow); // The index was negative or not a Smi. |
3304 | 3304 |
3305 __ bind(&try_again_with_new_string); | 3305 __ bind(&try_again_with_new_string); |
3306 __ CompareObjectType(r1, r2, r2, FIRST_NONSTRING_TYPE); | 3306 __ CompareObjectType(r1, r2, r2, FIRST_NONSTRING_TYPE); |
3307 __ b(ge, &slow); | 3307 __ b(ge, &slow); |
3308 | 3308 |
3309 // Now r2 has the string type. | 3309 // Now r2 has the string type. |
3310 __ ldr(r3, FieldMemOperand(r1, String::kLengthOffset)); | 3310 __ ldr(r3, FieldMemOperand(r1, String::kLengthOffset)); |
3311 __ and_(r4, r2, Operand(kStringSizeMask)); | |
3312 __ add(r4, r4, Operand(String::kLongLengthShift)); | |
3313 __ mov(r3, Operand(r3, LSR, r4)); | |
3314 // Now r3 has the length of the string. Compare with the index. | 3311 // Now r3 has the length of the string. Compare with the index. |
3315 __ cmp(r3, Operand(r0, LSR, kSmiTagSize)); | 3312 __ cmp(r3, Operand(r0, LSR, kSmiTagSize)); |
3316 __ b(le, &slow); | 3313 __ b(le, &slow); |
3317 | 3314 |
3318 // Here we know the index is in range. Check that string is sequential. | 3315 // Here we know the index is in range. Check that string is sequential. |
3319 ASSERT_EQ(0, kSeqStringTag); | 3316 ASSERT_EQ(0, kSeqStringTag); |
3320 __ tst(r2, Operand(kStringRepresentationMask)); | 3317 __ tst(r2, Operand(kStringRepresentationMask)); |
3321 __ b(ne, ¬_a_flat_string); | 3318 __ b(ne, ¬_a_flat_string); |
3322 | 3319 |
3323 // Check whether it is an ASCII string. | 3320 // Check whether it is an ASCII string. |
(...skipping 3149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6473 int CompareStub::MinorKey() { | 6470 int CompareStub::MinorKey() { |
6474 // Encode the two parameters in a unique 16 bit value. | 6471 // Encode the two parameters in a unique 16 bit value. |
6475 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); | 6472 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); |
6476 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); | 6473 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); |
6477 } | 6474 } |
6478 | 6475 |
6479 | 6476 |
6480 #undef __ | 6477 #undef __ |
6481 | 6478 |
6482 } } // namespace v8::internal | 6479 } } // namespace v8::internal |
OLD | NEW |