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 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 // and go to (1). Otherwise bail out to runtime. | 1410 // and go to (1). Otherwise bail out to runtime. |
1411 // (4) Sequential string. Load regexp code according to encoding. | 1411 // (4) Sequential string. Load regexp code according to encoding. |
1412 // (E) Carry on. | 1412 // (E) Carry on. |
1413 /// [...] | 1413 /// [...] |
1414 | 1414 |
1415 // Deferred code at the end of the stub: | 1415 // Deferred code at the end of the stub: |
1416 // (5) Long external string? If not, go to (7). | 1416 // (5) Long external string? If not, go to (7). |
1417 // (6) External string. Make it, offset-wise, look like a sequential string. | 1417 // (6) External string. Make it, offset-wise, look like a sequential string. |
1418 // Go to (4). | 1418 // Go to (4). |
1419 // (7) Short external string or not a string? If yes, bail out to runtime. | 1419 // (7) Short external string or not a string? If yes, bail out to runtime. |
1420 // (8) Sliced string. Replace subject with parent. Go to (1). | 1420 // (8) Sliced or thin string. Replace subject with parent. Go to (1). |
1421 | 1421 |
1422 Label check_underlying; // (1) | 1422 Label check_underlying; // (1) |
1423 Label seq_string; // (4) | 1423 Label seq_string; // (4) |
1424 Label not_seq_nor_cons; // (5) | 1424 Label not_seq_nor_cons; // (5) |
1425 Label external_string; // (6) | 1425 Label external_string; // (6) |
1426 Label not_long_external; // (7) | 1426 Label not_long_external; // (7) |
1427 | 1427 |
1428 __ bind(&check_underlying); | 1428 __ bind(&check_underlying); |
1429 __ ld(a2, FieldMemOperand(subject, HeapObject::kMapOffset)); | 1429 __ ld(a2, FieldMemOperand(subject, HeapObject::kMapOffset)); |
1430 __ lbu(a0, FieldMemOperand(a2, Map::kInstanceTypeOffset)); | 1430 __ lbu(a0, FieldMemOperand(a2, Map::kInstanceTypeOffset)); |
(...skipping 29 matching lines...) Expand all Loading... |
1460 // a3: original subject string | 1460 // a3: original subject string |
1461 // Load previous index and check range before a3 is overwritten. We have to | 1461 // Load previous index and check range before a3 is overwritten. We have to |
1462 // use a3 instead of subject here because subject might have been only made | 1462 // use a3 instead of subject here because subject might have been only made |
1463 // to look like a sequential string when it actually is an external string. | 1463 // to look like a sequential string when it actually is an external string. |
1464 __ ld(a1, MemOperand(sp, kPreviousIndexOffset)); | 1464 __ ld(a1, MemOperand(sp, kPreviousIndexOffset)); |
1465 __ JumpIfNotSmi(a1, &runtime); | 1465 __ JumpIfNotSmi(a1, &runtime); |
1466 __ ld(a3, FieldMemOperand(a3, String::kLengthOffset)); | 1466 __ ld(a3, FieldMemOperand(a3, String::kLengthOffset)); |
1467 __ Branch(&runtime, ls, a3, Operand(a1)); | 1467 __ Branch(&runtime, ls, a3, Operand(a1)); |
1468 __ SmiUntag(a1); | 1468 __ SmiUntag(a1); |
1469 | 1469 |
1470 STATIC_ASSERT(kStringEncodingMask == 4); | 1470 STATIC_ASSERT(kStringEncodingMask == 8); |
1471 STATIC_ASSERT(kOneByteStringTag == 4); | 1471 STATIC_ASSERT(kOneByteStringTag == 8); |
1472 STATIC_ASSERT(kTwoByteStringTag == 0); | 1472 STATIC_ASSERT(kTwoByteStringTag == 0); |
1473 __ And(a0, a0, Operand(kStringEncodingMask)); // Non-zero for one_byte. | 1473 __ And(a0, a0, Operand(kStringEncodingMask)); // Non-zero for one_byte. |
1474 __ ld(t9, FieldMemOperand(regexp_data, JSRegExp::kDataOneByteCodeOffset)); | 1474 __ ld(t9, FieldMemOperand(regexp_data, JSRegExp::kDataOneByteCodeOffset)); |
1475 __ dsra(a3, a0, 2); // a3 is 1 for one_byte, 0 for UC16 (used below). | 1475 __ dsra(a3, a0, 2); // a3 is 1 for one_byte, 0 for UC16 (used below). |
1476 __ ld(a5, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset)); | 1476 __ ld(a5, FieldMemOperand(regexp_data, JSRegExp::kDataUC16CodeOffset)); |
1477 __ Movz(t9, a5, a0); // If UC16 (a0 is 0), replace t9 w/kDataUC16CodeOffset. | 1477 __ Movz(t9, a5, a0); // If UC16 (a0 is 0), replace t9 w/kDataUC16CodeOffset. |
1478 | 1478 |
1479 // (E) Carry on. String handling is done. | 1479 // (E) Carry on. String handling is done. |
1480 // t9: irregexp code | 1480 // t9: irregexp code |
1481 // Check that the irregexp code has been generated for the actual string | 1481 // Check that the irregexp code has been generated for the actual string |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1711 subject, | 1711 subject, |
1712 SeqTwoByteString::kHeaderSize - kHeapObjectTag); | 1712 SeqTwoByteString::kHeaderSize - kHeapObjectTag); |
1713 __ jmp(&seq_string); // Go to (4). | 1713 __ jmp(&seq_string); // Go to (4). |
1714 | 1714 |
1715 // (7) Short external string or not a string? If yes, bail out to runtime. | 1715 // (7) Short external string or not a string? If yes, bail out to runtime. |
1716 __ bind(¬_long_external); | 1716 __ bind(¬_long_external); |
1717 STATIC_ASSERT(kNotStringTag != 0 && kShortExternalStringTag !=0); | 1717 STATIC_ASSERT(kNotStringTag != 0 && kShortExternalStringTag !=0); |
1718 __ And(at, a1, Operand(kIsNotStringMask | kShortExternalStringMask)); | 1718 __ And(at, a1, Operand(kIsNotStringMask | kShortExternalStringMask)); |
1719 __ Branch(&runtime, ne, at, Operand(zero_reg)); | 1719 __ Branch(&runtime, ne, at, Operand(zero_reg)); |
1720 | 1720 |
1721 // (8) Sliced string. Replace subject with parent. Go to (4). | 1721 // (8) Sliced or thin string. Replace subject with parent. Go to (4). |
| 1722 Label thin_string; |
| 1723 __ Branch(&thin_string, eq, a1, Operand(kThinStringTag)); |
1722 // Load offset into t0 and replace subject string with parent. | 1724 // Load offset into t0 and replace subject string with parent. |
1723 __ ld(t0, FieldMemOperand(subject, SlicedString::kOffsetOffset)); | 1725 __ ld(t0, FieldMemOperand(subject, SlicedString::kOffsetOffset)); |
1724 __ SmiUntag(t0); | 1726 __ SmiUntag(t0); |
1725 __ ld(subject, FieldMemOperand(subject, SlicedString::kParentOffset)); | 1727 __ ld(subject, FieldMemOperand(subject, SlicedString::kParentOffset)); |
1726 __ jmp(&check_underlying); // Go to (1). | 1728 __ jmp(&check_underlying); // Go to (1). |
| 1729 |
| 1730 __ bind(&thin_string); |
| 1731 __ ld(subject, FieldMemOperand(subject, ThinString::kActualOffset)); |
| 1732 __ jmp(&check_underlying); // Go to (1). |
1727 #endif // V8_INTERPRETED_REGEXP | 1733 #endif // V8_INTERPRETED_REGEXP |
1728 } | 1734 } |
1729 | 1735 |
1730 | 1736 |
1731 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { | 1737 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { |
1732 // a0 : number of arguments to the construct function | 1738 // a0 : number of arguments to the construct function |
1733 // a2 : feedback vector | 1739 // a2 : feedback vector |
1734 // a3 : slot in feedback vector (Smi) | 1740 // a3 : slot in feedback vector (Smi) |
1735 // a1 : the function to call | 1741 // a1 : the function to call |
1736 FrameScope scope(masm, StackFrame::INTERNAL); | 1742 FrameScope scope(masm, StackFrame::INTERNAL); |
(...skipping 2816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4553 kStackUnwindSpace, kInvalidStackOffset, | 4559 kStackUnwindSpace, kInvalidStackOffset, |
4554 return_value_operand, NULL); | 4560 return_value_operand, NULL); |
4555 } | 4561 } |
4556 | 4562 |
4557 #undef __ | 4563 #undef __ |
4558 | 4564 |
4559 } // namespace internal | 4565 } // namespace internal |
4560 } // namespace v8 | 4566 } // namespace v8 |
4561 | 4567 |
4562 #endif // V8_TARGET_ARCH_MIPS64 | 4568 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |