OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM | 7 #if V8_TARGET_ARCH_ARM |
8 | 8 |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
(...skipping 2479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2490 __ b(ne, &runtime); | 2490 __ b(ne, &runtime); |
2491 __ ldr(subject, FieldMemOperand(subject, ConsString::kFirstOffset)); | 2491 __ ldr(subject, FieldMemOperand(subject, ConsString::kFirstOffset)); |
2492 | 2492 |
2493 // (4) Is subject external? If yes, go to (7). | 2493 // (4) Is subject external? If yes, go to (7). |
2494 __ bind(&check_underlying); | 2494 __ bind(&check_underlying); |
2495 __ ldr(r0, FieldMemOperand(subject, HeapObject::kMapOffset)); | 2495 __ ldr(r0, FieldMemOperand(subject, HeapObject::kMapOffset)); |
2496 __ ldrb(r0, FieldMemOperand(r0, Map::kInstanceTypeOffset)); | 2496 __ ldrb(r0, FieldMemOperand(r0, Map::kInstanceTypeOffset)); |
2497 STATIC_ASSERT(kSeqStringTag == 0); | 2497 STATIC_ASSERT(kSeqStringTag == 0); |
2498 __ tst(r0, Operand(kStringRepresentationMask)); | 2498 __ tst(r0, Operand(kStringRepresentationMask)); |
2499 // The underlying external string is never a short external string. | 2499 // The underlying external string is never a short external string. |
2500 STATIC_CHECK(ExternalString::kMaxShortLength < ConsString::kMinLength); | 2500 STATIC_ASSERT(ExternalString::kMaxShortLength < ConsString::kMinLength); |
2501 STATIC_CHECK(ExternalString::kMaxShortLength < SlicedString::kMinLength); | 2501 STATIC_ASSERT(ExternalString::kMaxShortLength < SlicedString::kMinLength); |
2502 __ b(ne, &external_string); // Go to (7). | 2502 __ b(ne, &external_string); // Go to (7). |
2503 | 2503 |
2504 // (5) Sequential string. Load regexp code according to encoding. | 2504 // (5) Sequential string. Load regexp code according to encoding. |
2505 __ bind(&seq_string); | 2505 __ bind(&seq_string); |
2506 // subject: sequential subject string (or look-alike, external string) | 2506 // subject: sequential subject string (or look-alike, external string) |
2507 // r3: original subject string | 2507 // r3: original subject string |
2508 // Load previous index and check range before r3 is overwritten. We have to | 2508 // Load previous index and check range before r3 is overwritten. We have to |
2509 // use r3 instead of subject here because subject might have been only made | 2509 // use r3 instead of subject here because subject might have been only made |
2510 // to look like a sequential string when it actually is an external string. | 2510 // to look like a sequential string when it actually is an external string. |
2511 __ ldr(r1, MemOperand(sp, kPreviousIndexOffset)); | 2511 __ ldr(r1, MemOperand(sp, kPreviousIndexOffset)); |
(...skipping 1158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3670 // r2: length | 3670 // r2: length |
3671 // r3: adjusted start index (untagged) | 3671 // r3: adjusted start index (untagged) |
3672 Label two_byte_sequential, sequential_string, allocate_result; | 3672 Label two_byte_sequential, sequential_string, allocate_result; |
3673 STATIC_ASSERT(kExternalStringTag != 0); | 3673 STATIC_ASSERT(kExternalStringTag != 0); |
3674 STATIC_ASSERT(kSeqStringTag == 0); | 3674 STATIC_ASSERT(kSeqStringTag == 0); |
3675 __ tst(r1, Operand(kExternalStringTag)); | 3675 __ tst(r1, Operand(kExternalStringTag)); |
3676 __ b(eq, &sequential_string); | 3676 __ b(eq, &sequential_string); |
3677 | 3677 |
3678 // Handle external string. | 3678 // Handle external string. |
3679 // Rule out short external strings. | 3679 // Rule out short external strings. |
3680 STATIC_CHECK(kShortExternalStringTag != 0); | 3680 STATIC_ASSERT(kShortExternalStringTag != 0); |
3681 __ tst(r1, Operand(kShortExternalStringTag)); | 3681 __ tst(r1, Operand(kShortExternalStringTag)); |
3682 __ b(ne, &runtime); | 3682 __ b(ne, &runtime); |
3683 __ ldr(r5, FieldMemOperand(r5, ExternalString::kResourceDataOffset)); | 3683 __ ldr(r5, FieldMemOperand(r5, ExternalString::kResourceDataOffset)); |
3684 // r5 already points to the first character of underlying string. | 3684 // r5 already points to the first character of underlying string. |
3685 __ jmp(&allocate_result); | 3685 __ jmp(&allocate_result); |
3686 | 3686 |
3687 __ bind(&sequential_string); | 3687 __ bind(&sequential_string); |
3688 // Locate first character of underlying subject string. | 3688 // Locate first character of underlying subject string. |
3689 STATIC_ASSERT(SeqTwoByteString::kHeaderSize == SeqOneByteString::kHeaderSize); | 3689 STATIC_ASSERT(SeqTwoByteString::kHeaderSize == SeqOneByteString::kHeaderSize); |
3690 __ add(r5, r5, Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); | 3690 __ add(r5, r5, Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); |
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5299 MemOperand(fp, 6 * kPointerSize), | 5299 MemOperand(fp, 6 * kPointerSize), |
5300 NULL); | 5300 NULL); |
5301 } | 5301 } |
5302 | 5302 |
5303 | 5303 |
5304 #undef __ | 5304 #undef __ |
5305 | 5305 |
5306 } } // namespace v8::internal | 5306 } } // namespace v8::internal |
5307 | 5307 |
5308 #endif // V8_TARGET_ARCH_ARM | 5308 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |