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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 #include "bootstrapper.h" | 9 #include "bootstrapper.h" |
10 #include "code-stubs.h" | 10 #include "code-stubs.h" |
(...skipping 2624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2635 __ Branch(&runtime, ne, a0, Operand(a1)); | 2635 __ Branch(&runtime, ne, a0, Operand(a1)); |
2636 __ lw(subject, FieldMemOperand(subject, ConsString::kFirstOffset)); | 2636 __ lw(subject, FieldMemOperand(subject, ConsString::kFirstOffset)); |
2637 | 2637 |
2638 // (4) Is subject external? If yes, go to (7). | 2638 // (4) Is subject external? If yes, go to (7). |
2639 __ bind(&check_underlying); | 2639 __ bind(&check_underlying); |
2640 __ lw(a0, FieldMemOperand(subject, HeapObject::kMapOffset)); | 2640 __ lw(a0, FieldMemOperand(subject, HeapObject::kMapOffset)); |
2641 __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset)); | 2641 __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset)); |
2642 STATIC_ASSERT(kSeqStringTag == 0); | 2642 STATIC_ASSERT(kSeqStringTag == 0); |
2643 __ And(at, a0, Operand(kStringRepresentationMask)); | 2643 __ And(at, a0, Operand(kStringRepresentationMask)); |
2644 // The underlying external string is never a short external string. | 2644 // The underlying external string is never a short external string. |
2645 STATIC_CHECK(ExternalString::kMaxShortLength < ConsString::kMinLength); | 2645 STATIC_ASSERT(ExternalString::kMaxShortLength < ConsString::kMinLength); |
2646 STATIC_CHECK(ExternalString::kMaxShortLength < SlicedString::kMinLength); | 2646 STATIC_ASSERT(ExternalString::kMaxShortLength < SlicedString::kMinLength); |
2647 __ Branch(&external_string, ne, at, Operand(zero_reg)); // Go to (7). | 2647 __ Branch(&external_string, ne, at, Operand(zero_reg)); // Go to (7). |
2648 | 2648 |
2649 // (5) Sequential string. Load regexp code according to encoding. | 2649 // (5) Sequential string. Load regexp code according to encoding. |
2650 __ bind(&seq_string); | 2650 __ bind(&seq_string); |
2651 // subject: sequential subject string (or look-alike, external string) | 2651 // subject: sequential subject string (or look-alike, external string) |
2652 // a3: original subject string | 2652 // a3: original subject string |
2653 // Load previous index and check range before a3 is overwritten. We have to | 2653 // Load previous index and check range before a3 is overwritten. We have to |
2654 // use a3 instead of subject here because subject might have been only made | 2654 // use a3 instead of subject here because subject might have been only made |
2655 // to look like a sequential string when it actually is an external string. | 2655 // to look like a sequential string when it actually is an external string. |
2656 __ lw(a1, MemOperand(sp, kPreviousIndexOffset)); | 2656 __ lw(a1, MemOperand(sp, kPreviousIndexOffset)); |
(...skipping 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3832 // a2: length | 3832 // a2: length |
3833 // a3: adjusted start index (untagged) | 3833 // a3: adjusted start index (untagged) |
3834 Label two_byte_sequential, sequential_string, allocate_result; | 3834 Label two_byte_sequential, sequential_string, allocate_result; |
3835 STATIC_ASSERT(kExternalStringTag != 0); | 3835 STATIC_ASSERT(kExternalStringTag != 0); |
3836 STATIC_ASSERT(kSeqStringTag == 0); | 3836 STATIC_ASSERT(kSeqStringTag == 0); |
3837 __ And(t0, a1, Operand(kExternalStringTag)); | 3837 __ And(t0, a1, Operand(kExternalStringTag)); |
3838 __ Branch(&sequential_string, eq, t0, Operand(zero_reg)); | 3838 __ Branch(&sequential_string, eq, t0, Operand(zero_reg)); |
3839 | 3839 |
3840 // Handle external string. | 3840 // Handle external string. |
3841 // Rule out short external strings. | 3841 // Rule out short external strings. |
3842 STATIC_CHECK(kShortExternalStringTag != 0); | 3842 STATIC_ASSERT(kShortExternalStringTag != 0); |
3843 __ And(t0, a1, Operand(kShortExternalStringTag)); | 3843 __ And(t0, a1, Operand(kShortExternalStringTag)); |
3844 __ Branch(&runtime, ne, t0, Operand(zero_reg)); | 3844 __ Branch(&runtime, ne, t0, Operand(zero_reg)); |
3845 __ lw(t1, FieldMemOperand(t1, ExternalString::kResourceDataOffset)); | 3845 __ lw(t1, FieldMemOperand(t1, ExternalString::kResourceDataOffset)); |
3846 // t1 already points to the first character of underlying string. | 3846 // t1 already points to the first character of underlying string. |
3847 __ jmp(&allocate_result); | 3847 __ jmp(&allocate_result); |
3848 | 3848 |
3849 __ bind(&sequential_string); | 3849 __ bind(&sequential_string); |
3850 // Locate first character of underlying subject string. | 3850 // Locate first character of underlying subject string. |
3851 STATIC_ASSERT(SeqTwoByteString::kHeaderSize == SeqOneByteString::kHeaderSize); | 3851 STATIC_ASSERT(SeqTwoByteString::kHeaderSize == SeqOneByteString::kHeaderSize); |
3852 __ Addu(t1, t1, Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); | 3852 __ Addu(t1, t1, Operand(SeqOneByteString::kHeaderSize - kHeapObjectTag)); |
(...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5501 MemOperand(fp, 6 * kPointerSize), | 5501 MemOperand(fp, 6 * kPointerSize), |
5502 NULL); | 5502 NULL); |
5503 } | 5503 } |
5504 | 5504 |
5505 | 5505 |
5506 #undef __ | 5506 #undef __ |
5507 | 5507 |
5508 } } // namespace v8::internal | 5508 } } // namespace v8::internal |
5509 | 5509 |
5510 #endif // V8_TARGET_ARCH_MIPS | 5510 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |