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 3310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3321 __ b(ne, ¬_a_flat_string); | 3321 __ b(ne, ¬_a_flat_string); |
3322 | 3322 |
3323 // Check whether it is an ASCII string. | 3323 // Check whether it is an ASCII string. |
3324 ASSERT_EQ(0, kTwoByteStringTag); | 3324 ASSERT_EQ(0, kTwoByteStringTag); |
3325 __ tst(r2, Operand(kStringEncodingMask)); | 3325 __ tst(r2, Operand(kStringEncodingMask)); |
3326 __ b(ne, &ascii_string); | 3326 __ b(ne, &ascii_string); |
3327 | 3327 |
3328 // 2-byte string. We can add without shifting since the Smi tag size is the | 3328 // 2-byte string. We can add without shifting since the Smi tag size is the |
3329 // log2 of the number of bytes in a two-byte character. | 3329 // log2 of the number of bytes in a two-byte character. |
3330 ASSERT_EQ(1, kSmiTagSize); | 3330 ASSERT_EQ(1, kSmiTagSize); |
3331 ASSERT_EQ(1, kSmiShiftSize); | 3331 ASSERT_EQ(0, kSmiShiftSize); |
3332 __ add(r1, r1, Operand(r0)); | 3332 __ add(r1, r1, Operand(r0)); |
3333 __ ldrh(r0, FieldMemOperand(r1, SeqTwoByteString::kHeaderSize)); | 3333 __ ldrh(r0, FieldMemOperand(r1, SeqTwoByteString::kHeaderSize)); |
3334 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); | 3334 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
3335 __ jmp(&end); | 3335 __ jmp(&end); |
3336 | 3336 |
3337 __ bind(&ascii_string); | 3337 __ bind(&ascii_string); |
3338 __ add(r1, r1, Operand(r0, LSR, kSmiTagSize)); | 3338 __ add(r1, r1, Operand(r0, LSR, kSmiTagSize)); |
3339 __ ldrb(r0, FieldMemOperand(r1, SeqAsciiString::kHeaderSize)); | 3339 __ ldrb(r0, FieldMemOperand(r1, SeqAsciiString::kHeaderSize)); |
3340 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); | 3340 __ mov(r0, Operand(r0, LSL, kSmiTagSize)); |
3341 __ jmp(&end); | 3341 __ jmp(&end); |
(...skipping 3086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6428 int CompareStub::MinorKey() { | 6428 int CompareStub::MinorKey() { |
6429 // Encode the two parameters in a unique 16 bit value. | 6429 // Encode the two parameters in a unique 16 bit value. |
6430 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); | 6430 ASSERT(static_cast<unsigned>(cc_) >> 28 < (1 << 15)); |
6431 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); | 6431 return (static_cast<unsigned>(cc_) >> 27) | (strict_ ? 1 : 0); |
6432 } | 6432 } |
6433 | 6433 |
6434 | 6434 |
6435 #undef __ | 6435 #undef __ |
6436 | 6436 |
6437 } } // namespace v8::internal | 6437 } } // namespace v8::internal |
OLD | NEW |