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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
8 #include "src/api-arguments.h" | 8 #include "src/api-arguments.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1676 // Multiplying by 2 comes for free since a2 is smi-tagged. | 1676 // Multiplying by 2 comes for free since a2 is smi-tagged. |
1677 STATIC_ASSERT(Isolate::kJSRegexpStaticOffsetsVectorSize >= 2); | 1677 STATIC_ASSERT(Isolate::kJSRegexpStaticOffsetsVectorSize >= 2); |
1678 int temp = Isolate::kJSRegexpStaticOffsetsVectorSize / 2 - 1; | 1678 int temp = Isolate::kJSRegexpStaticOffsetsVectorSize / 2 - 1; |
1679 __ Branch(&runtime, hi, a2, Operand(Smi::FromInt(temp))); | 1679 __ Branch(&runtime, hi, a2, Operand(Smi::FromInt(temp))); |
1680 | 1680 |
1681 // Reset offset for possibly sliced string. | 1681 // Reset offset for possibly sliced string. |
1682 __ mov(t0, zero_reg); | 1682 __ mov(t0, zero_reg); |
1683 __ ld(subject, MemOperand(sp, kSubjectOffset)); | 1683 __ ld(subject, MemOperand(sp, kSubjectOffset)); |
1684 __ JumpIfSmi(subject, &runtime); | 1684 __ JumpIfSmi(subject, &runtime); |
1685 __ mov(a3, subject); // Make a copy of the original subject string. | 1685 __ mov(a3, subject); // Make a copy of the original subject string. |
1686 __ ld(a0, FieldMemOperand(subject, HeapObject::kMapOffset)); | |
1687 __ lbu(a0, FieldMemOperand(a0, Map::kInstanceTypeOffset)); | |
1688 | 1686 |
1689 // subject: subject string | 1687 // subject: subject string |
1690 // a0: subject string instance type | |
1691 // a3: subject string | 1688 // a3: subject string |
1692 // regexp_data: RegExp data (FixedArray) | 1689 // regexp_data: RegExp data (FixedArray) |
1693 // Handle subject string according to its encoding and representation: | 1690 // Handle subject string according to its encoding and representation: |
1694 // (1) Sequential string? If yes, go to (4). | 1691 // (1) Sequential string? If yes, go to (4). |
1695 // (2) Sequential or cons? If not, go to (5). | 1692 // (2) Sequential or cons? If not, go to (5). |
1696 // (3) Cons string. If the string is flat, replace subject with first string | 1693 // (3) Cons string. If the string is flat, replace subject with first string |
1697 // and go to (1). Otherwise bail out to runtime. | 1694 // and go to (1). Otherwise bail out to runtime. |
1698 // (4) Sequential string. Load regexp code according to encoding. | 1695 // (4) Sequential string. Load regexp code according to encoding. |
1699 // (E) Carry on. | 1696 // (E) Carry on. |
1700 /// [...] | 1697 /// [...] |
1701 | 1698 |
1702 // Deferred code at the end of the stub: | 1699 // Deferred code at the end of the stub: |
1703 // (5) Long external string? If not, go to (7). | 1700 // (5) Long external string? If not, go to (7). |
1704 // (6) External string. Make it, offset-wise, look like a sequential string. | 1701 // (6) External string. Make it, offset-wise, look like a sequential string. |
1705 // Go to (4). | 1702 // Go to (4). |
1706 // (7) Short external string or not a string? If yes, bail out to runtime. | 1703 // (7) Short external string or not a string? If yes, bail out to runtime. |
1707 // (8) Sliced string. Replace subject with parent. Go to (1). | 1704 // (8) Sliced string. Replace subject with parent. Go to (1). |
1708 | 1705 |
1709 Label check_underlying; // (1) | 1706 Label check_underlying; // (1) |
1710 Label seq_string; // (4) | 1707 Label seq_string; // (4) |
1711 Label not_seq_nor_cons; // (5) | 1708 Label not_seq_nor_cons; // (5) |
1712 Label external_string; // (6) | 1709 Label external_string; // (6) |
1713 Label not_long_external; // (7) | 1710 Label not_long_external; // (7) |
1714 | 1711 |
1715 __ bind(&check_underlying); | 1712 __ bind(&check_underlying); |
1716 __ ld(a2, FieldMemOperand(subject, HeapObject::kMapOffset)); | 1713 __ ld(a2, FieldMemOperand(subject, HeapObject::kMapOffset)); |
1717 __ Daddu(a0, a2, Map::kInstanceTypeOffset); | 1714 __ lbu(a0, FieldMemOperand(a2, Map::kInstanceTypeOffset)); |
1718 __ lbu(a0, MemOperand(a0)); | |
1719 | 1715 |
1720 // (1) Sequential string? If yes, go to (4). | 1716 // (1) Sequential string? If yes, go to (4). |
1721 __ And(a1, | 1717 __ And(a1, |
1722 a0, | 1718 a0, |
1723 Operand(kIsNotStringMask | | 1719 Operand(kIsNotStringMask | |
1724 kStringRepresentationMask | | 1720 kStringRepresentationMask | |
1725 kShortExternalStringMask)); | 1721 kShortExternalStringMask)); |
1726 STATIC_ASSERT((kStringTag | kSeqStringTag) == 0); | 1722 STATIC_ASSERT((kStringTag | kSeqStringTag) == 0); |
1727 __ Branch(&seq_string, eq, a1, Operand(zero_reg)); // Go to (4). | 1723 __ Branch(&seq_string, eq, a1, Operand(zero_reg)); // Go to (4). |
1728 | 1724 |
(...skipping 4044 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5773 kStackUnwindSpace, kInvalidStackOffset, | 5769 kStackUnwindSpace, kInvalidStackOffset, |
5774 return_value_operand, NULL); | 5770 return_value_operand, NULL); |
5775 } | 5771 } |
5776 | 5772 |
5777 #undef __ | 5773 #undef __ |
5778 | 5774 |
5779 } // namespace internal | 5775 } // namespace internal |
5780 } // namespace v8 | 5776 } // namespace v8 |
5781 | 5777 |
5782 #endif // V8_TARGET_ARCH_MIPS64 | 5778 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |