OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_S390 | 5 #if V8_TARGET_ARCH_S390 |
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/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 // and go to (1). Otherwise bail out to runtime. | 1364 // and go to (1). Otherwise bail out to runtime. |
1365 // (4) Sequential string. Load regexp code according to encoding. | 1365 // (4) Sequential string. Load regexp code according to encoding. |
1366 // (E) Carry on. | 1366 // (E) Carry on. |
1367 /// [...] | 1367 /// [...] |
1368 | 1368 |
1369 // Deferred code at the end of the stub: | 1369 // Deferred code at the end of the stub: |
1370 // (5) Long external string? If not, go to (7). | 1370 // (5) Long external string? If not, go to (7). |
1371 // (6) External string. Make it, offset-wise, look like a sequential string. | 1371 // (6) External string. Make it, offset-wise, look like a sequential string. |
1372 // Go to (4). | 1372 // Go to (4). |
1373 // (7) Short external string or not a string? If yes, bail out to runtime. | 1373 // (7) Short external string or not a string? If yes, bail out to runtime. |
1374 // (8) Sliced or thin string. Replace subject with parent. Go to (1). | 1374 // (8) Sliced string. Replace subject with parent. Go to (1). |
1375 | 1375 |
1376 Label seq_string /* 4 */, external_string /* 6 */, check_underlying /* 1 */, | 1376 Label seq_string /* 4 */, external_string /* 6 */, check_underlying /* 1 */, |
1377 not_seq_nor_cons /* 5 */, not_long_external /* 7 */; | 1377 not_seq_nor_cons /* 5 */, not_long_external /* 7 */; |
1378 | 1378 |
1379 __ bind(&check_underlying); | 1379 __ bind(&check_underlying); |
1380 __ LoadP(r2, FieldMemOperand(subject, HeapObject::kMapOffset)); | 1380 __ LoadP(r2, FieldMemOperand(subject, HeapObject::kMapOffset)); |
1381 __ LoadlB(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset)); | 1381 __ LoadlB(r2, FieldMemOperand(r2, Map::kInstanceTypeOffset)); |
1382 | 1382 |
1383 // (1) Sequential string? If yes, go to (4). | 1383 // (1) Sequential string? If yes, go to (4). |
1384 | 1384 |
1385 STATIC_ASSERT((kIsNotStringMask | kStringRepresentationMask | | 1385 STATIC_ASSERT((kIsNotStringMask | kStringRepresentationMask | |
1386 kShortExternalStringMask) == 0x93); | 1386 kShortExternalStringMask) == 0x93); |
1387 __ mov(r3, Operand(kIsNotStringMask | kStringRepresentationMask | | 1387 __ mov(r3, Operand(kIsNotStringMask | kStringRepresentationMask | |
1388 kShortExternalStringMask)); | 1388 kShortExternalStringMask)); |
1389 __ AndP(r3, r2); | 1389 __ AndP(r3, r2); |
1390 STATIC_ASSERT((kStringTag | kSeqStringTag) == 0); | 1390 STATIC_ASSERT((kStringTag | kSeqStringTag) == 0); |
1391 __ beq(&seq_string, Label::kNear); // Go to (4). | 1391 __ beq(&seq_string, Label::kNear); // Go to (4). |
1392 | 1392 |
1393 // (2) Sequential or cons? If not, go to (5). | 1393 // (2) Sequential or cons? If not, go to (5). |
1394 STATIC_ASSERT(kConsStringTag < kExternalStringTag); | 1394 STATIC_ASSERT(kConsStringTag < kExternalStringTag); |
1395 STATIC_ASSERT(kSlicedStringTag > kExternalStringTag); | 1395 STATIC_ASSERT(kSlicedStringTag > kExternalStringTag); |
1396 STATIC_ASSERT(kThinStringTag > kExternalStringTag); | |
1397 STATIC_ASSERT(kIsNotStringMask > kExternalStringTag); | 1396 STATIC_ASSERT(kIsNotStringMask > kExternalStringTag); |
1398 STATIC_ASSERT(kShortExternalStringTag > kExternalStringTag); | 1397 STATIC_ASSERT(kShortExternalStringTag > kExternalStringTag); |
1399 STATIC_ASSERT(kExternalStringTag < 0xffffu); | 1398 STATIC_ASSERT(kExternalStringTag < 0xffffu); |
1400 __ CmpP(r3, Operand(kExternalStringTag)); | 1399 __ CmpP(r3, Operand(kExternalStringTag)); |
1401 __ bge(¬_seq_nor_cons); // Go to (5). | 1400 __ bge(¬_seq_nor_cons); // Go to (5). |
1402 | 1401 |
1403 // (3) Cons string. Check that it's flat. | 1402 // (3) Cons string. Check that it's flat. |
1404 // Replace subject with first string and reload instance type. | 1403 // Replace subject with first string and reload instance type. |
1405 __ LoadP(r2, FieldMemOperand(subject, ConsString::kSecondOffset)); | 1404 __ LoadP(r2, FieldMemOperand(subject, ConsString::kSecondOffset)); |
1406 __ CompareRoot(r2, Heap::kempty_stringRootIndex); | 1405 __ CompareRoot(r2, Heap::kempty_stringRootIndex); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1674 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); | 1673 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); |
1675 __ b(&seq_string); // Go to (4). | 1674 __ b(&seq_string); // Go to (4). |
1676 | 1675 |
1677 // (7) Short external string or not a string? If yes, bail out to runtime. | 1676 // (7) Short external string or not a string? If yes, bail out to runtime. |
1678 __ bind(¬_long_external); | 1677 __ bind(¬_long_external); |
1679 STATIC_ASSERT(kNotStringTag != 0 && kShortExternalStringTag != 0); | 1678 STATIC_ASSERT(kNotStringTag != 0 && kShortExternalStringTag != 0); |
1680 __ mov(r0, Operand(kIsNotStringMask | kShortExternalStringMask)); | 1679 __ mov(r0, Operand(kIsNotStringMask | kShortExternalStringMask)); |
1681 __ AndP(r0, r3); | 1680 __ AndP(r0, r3); |
1682 __ bne(&runtime); | 1681 __ bne(&runtime); |
1683 | 1682 |
1684 // (8) Sliced or thin string. Replace subject with parent. Go to (4). | 1683 // (8) Sliced string. Replace subject with parent. Go to (4). |
1685 Label thin_string; | |
1686 __ CmpP(r3, Operand(kThinStringTag)); | |
1687 __ beq(&thin_string); | |
1688 // Load offset into ip and replace subject string with parent. | 1684 // Load offset into ip and replace subject string with parent. |
1689 __ LoadP(ip, FieldMemOperand(subject, SlicedString::kOffsetOffset)); | 1685 __ LoadP(ip, FieldMemOperand(subject, SlicedString::kOffsetOffset)); |
1690 __ SmiUntag(ip); | 1686 __ SmiUntag(ip); |
1691 __ LoadP(subject, FieldMemOperand(subject, SlicedString::kParentOffset)); | 1687 __ LoadP(subject, FieldMemOperand(subject, SlicedString::kParentOffset)); |
1692 __ b(&check_underlying); // Go to (4). | 1688 __ b(&check_underlying); // Go to (4). |
1693 | |
1694 __ bind(&thin_string); | |
1695 __ LoadP(subject, FieldMemOperand(subject, ThinString::kActualOffset)); | |
1696 __ b(&check_underlying); // Go to (4). | |
1697 #endif // V8_INTERPRETED_REGEXP | 1689 #endif // V8_INTERPRETED_REGEXP |
1698 } | 1690 } |
1699 | 1691 |
1700 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { | 1692 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { |
1701 // r2 : number of arguments to the construct function | 1693 // r2 : number of arguments to the construct function |
1702 // r3 : the function to call | 1694 // r3 : the function to call |
1703 // r4 : feedback vector | 1695 // r4 : feedback vector |
1704 // r5 : slot in feedback vector (Smi) | 1696 // r5 : slot in feedback vector (Smi) |
1705 FrameScope scope(masm, StackFrame::INTERNAL); | 1697 FrameScope scope(masm, StackFrame::INTERNAL); |
1706 | 1698 |
(...skipping 2652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4359 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 4351 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
4360 kStackUnwindSpace, NULL, return_value_operand, NULL); | 4352 kStackUnwindSpace, NULL, return_value_operand, NULL); |
4361 } | 4353 } |
4362 | 4354 |
4363 #undef __ | 4355 #undef __ |
4364 | 4356 |
4365 } // namespace internal | 4357 } // namespace internal |
4366 } // namespace v8 | 4358 } // namespace v8 |
4367 | 4359 |
4368 #endif // V8_TARGET_ARCH_S390 | 4360 #endif // V8_TARGET_ARCH_S390 |
OLD | NEW |