| 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
| 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 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1367 // and go to (1). Otherwise bail out to runtime. | 1367 // and go to (1). Otherwise bail out to runtime. |
| 1368 // (4) Sequential string. Load regexp code according to encoding. | 1368 // (4) Sequential string. Load regexp code according to encoding. |
| 1369 // (E) Carry on. | 1369 // (E) Carry on. |
| 1370 /// [...] | 1370 /// [...] |
| 1371 | 1371 |
| 1372 // Deferred code at the end of the stub: | 1372 // Deferred code at the end of the stub: |
| 1373 // (5) Long external string? If not, go to (7). | 1373 // (5) Long external string? If not, go to (7). |
| 1374 // (6) External string. Make it, offset-wise, look like a sequential string. | 1374 // (6) External string. Make it, offset-wise, look like a sequential string. |
| 1375 // Go to (4). | 1375 // Go to (4). |
| 1376 // (7) Short external string or not a string? If yes, bail out to runtime. | 1376 // (7) Short external string or not a string? If yes, bail out to runtime. |
| 1377 // (8) Sliced or thin string. Replace subject with parent. Go to (1). | 1377 // (8) Sliced string. Replace subject with parent. Go to (1). |
| 1378 | 1378 |
| 1379 Label seq_string /* 4 */, external_string /* 6 */, check_underlying /* 1 */, | 1379 Label seq_string /* 4 */, external_string /* 6 */, check_underlying /* 1 */, |
| 1380 not_seq_nor_cons /* 5 */, not_long_external /* 7 */; | 1380 not_seq_nor_cons /* 5 */, not_long_external /* 7 */; |
| 1381 | 1381 |
| 1382 __ bind(&check_underlying); | 1382 __ bind(&check_underlying); |
| 1383 __ LoadP(r3, FieldMemOperand(subject, HeapObject::kMapOffset)); | 1383 __ LoadP(r3, FieldMemOperand(subject, HeapObject::kMapOffset)); |
| 1384 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset)); | 1384 __ lbz(r3, FieldMemOperand(r3, Map::kInstanceTypeOffset)); |
| 1385 | 1385 |
| 1386 // (1) Sequential string? If yes, go to (4). | 1386 // (1) Sequential string? If yes, go to (4). |
| 1387 | 1387 |
| 1388 STATIC_ASSERT((kIsNotStringMask | kStringRepresentationMask | | 1388 STATIC_ASSERT((kIsNotStringMask | kStringRepresentationMask | |
| 1389 kShortExternalStringMask) == 0xa7); | 1389 kShortExternalStringMask) == 0xa7); |
| 1390 __ andi(r4, r3, Operand(kIsNotStringMask | kStringRepresentationMask | | 1390 __ andi(r4, r3, Operand(kIsNotStringMask | kStringRepresentationMask | |
| 1391 kShortExternalStringMask)); | 1391 kShortExternalStringMask)); |
| 1392 STATIC_ASSERT((kStringTag | kSeqStringTag) == 0); | 1392 STATIC_ASSERT((kStringTag | kSeqStringTag) == 0); |
| 1393 __ beq(&seq_string, cr0); // Go to (4). | 1393 __ beq(&seq_string, cr0); // Go to (4). |
| 1394 | 1394 |
| 1395 // (2) Sequential or cons? If not, go to (5). | 1395 // (2) Sequential or cons? If not, go to (5). |
| 1396 STATIC_ASSERT(kConsStringTag < kExternalStringTag); | 1396 STATIC_ASSERT(kConsStringTag < kExternalStringTag); |
| 1397 STATIC_ASSERT(kSlicedStringTag > kExternalStringTag); | 1397 STATIC_ASSERT(kSlicedStringTag > kExternalStringTag); |
| 1398 STATIC_ASSERT(kThinStringTag > kExternalStringTag); | |
| 1399 STATIC_ASSERT(kIsNotStringMask > kExternalStringTag); | 1398 STATIC_ASSERT(kIsNotStringMask > kExternalStringTag); |
| 1400 STATIC_ASSERT(kShortExternalStringTag > kExternalStringTag); | 1399 STATIC_ASSERT(kShortExternalStringTag > kExternalStringTag); |
| 1401 STATIC_ASSERT(kExternalStringTag < 0xffffu); | 1400 STATIC_ASSERT(kExternalStringTag < 0xffffu); |
| 1402 __ cmpi(r4, Operand(kExternalStringTag)); | 1401 __ cmpi(r4, Operand(kExternalStringTag)); |
| 1403 __ bge(¬_seq_nor_cons); // Go to (5). | 1402 __ bge(¬_seq_nor_cons); // Go to (5). |
| 1404 | 1403 |
| 1405 // (3) Cons string. Check that it's flat. | 1404 // (3) Cons string. Check that it's flat. |
| 1406 // Replace subject with first string and reload instance type. | 1405 // Replace subject with first string and reload instance type. |
| 1407 __ LoadP(r3, FieldMemOperand(subject, ConsString::kSecondOffset)); | 1406 __ LoadP(r3, FieldMemOperand(subject, ConsString::kSecondOffset)); |
| 1408 __ CompareRoot(r3, Heap::kempty_stringRootIndex); | 1407 __ CompareRoot(r3, Heap::kempty_stringRootIndex); |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1665 __ subi(subject, subject, | 1664 __ subi(subject, subject, |
| 1666 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); | 1665 Operand(SeqTwoByteString::kHeaderSize - kHeapObjectTag)); |
| 1667 __ b(&seq_string); // Go to (4). | 1666 __ b(&seq_string); // Go to (4). |
| 1668 | 1667 |
| 1669 // (7) Short external string or not a string? If yes, bail out to runtime. | 1668 // (7) Short external string or not a string? If yes, bail out to runtime. |
| 1670 __ bind(¬_long_external); | 1669 __ bind(¬_long_external); |
| 1671 STATIC_ASSERT(kNotStringTag != 0 && kShortExternalStringTag != 0); | 1670 STATIC_ASSERT(kNotStringTag != 0 && kShortExternalStringTag != 0); |
| 1672 __ andi(r0, r4, Operand(kIsNotStringMask | kShortExternalStringMask)); | 1671 __ andi(r0, r4, Operand(kIsNotStringMask | kShortExternalStringMask)); |
| 1673 __ bne(&runtime, cr0); | 1672 __ bne(&runtime, cr0); |
| 1674 | 1673 |
| 1675 // (8) Sliced or thin string. Replace subject with parent. Go to (4). | 1674 // (8) Sliced string. Replace subject with parent. Go to (4). |
| 1676 Label thin_string; | |
| 1677 __ cmpi(r4, Operand(kThinStringTag)); | |
| 1678 __ beq(&thin_string); | |
| 1679 // Load offset into r11 and replace subject string with parent. | 1675 // Load offset into r11 and replace subject string with parent. |
| 1680 __ LoadP(r11, FieldMemOperand(subject, SlicedString::kOffsetOffset)); | 1676 __ LoadP(r11, FieldMemOperand(subject, SlicedString::kOffsetOffset)); |
| 1681 __ SmiUntag(r11); | 1677 __ SmiUntag(r11); |
| 1682 __ LoadP(subject, FieldMemOperand(subject, SlicedString::kParentOffset)); | 1678 __ LoadP(subject, FieldMemOperand(subject, SlicedString::kParentOffset)); |
| 1683 __ b(&check_underlying); // Go to (4). | 1679 __ b(&check_underlying); // Go to (4). |
| 1684 | |
| 1685 __ bind(&thin_string); | |
| 1686 __ LoadP(subject, FieldMemOperand(subject, ThinString::kActualOffset)); | |
| 1687 __ b(&check_underlying); // Go to (4). | |
| 1688 #endif // V8_INTERPRETED_REGEXP | 1680 #endif // V8_INTERPRETED_REGEXP |
| 1689 } | 1681 } |
| 1690 | 1682 |
| 1691 | 1683 |
| 1692 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { | 1684 static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) { |
| 1693 // r3 : number of arguments to the construct function | 1685 // r3 : number of arguments to the construct function |
| 1694 // r4 : the function to call | 1686 // r4 : the function to call |
| 1695 // r5 : feedback vector | 1687 // r5 : feedback vector |
| 1696 // r6 : slot in feedback vector (Smi) | 1688 // r6 : slot in feedback vector (Smi) |
| 1697 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); | 1689 FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL); |
| (...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4352 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); | 4344 fp, (PropertyCallbackArguments::kReturnValueOffset + 3) * kPointerSize); |
| 4353 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 4345 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
| 4354 kStackUnwindSpace, NULL, return_value_operand, NULL); | 4346 kStackUnwindSpace, NULL, return_value_operand, NULL); |
| 4355 } | 4347 } |
| 4356 | 4348 |
| 4357 #undef __ | 4349 #undef __ |
| 4358 } // namespace internal | 4350 } // namespace internal |
| 4359 } // namespace v8 | 4351 } // namespace v8 |
| 4360 | 4352 |
| 4361 #endif // V8_TARGET_ARCH_PPC | 4353 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |