| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_PPC | 7 #if V8_TARGET_ARCH_PPC |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1679 __ sub(r6, r3, r4); | 1679 __ sub(r6, r3, r4); |
| 1680 __ SmiToPtrArrayOffset(r6, r6); | 1680 __ SmiToPtrArrayOffset(r6, r6); |
| 1681 __ add(r6, r5, r6); | 1681 __ add(r6, r5, r6); |
| 1682 __ LoadP(r3, MemOperand(r6, kDisplacement)); | 1682 __ LoadP(r3, MemOperand(r6, kDisplacement)); |
| 1683 __ blr(); | 1683 __ blr(); |
| 1684 | 1684 |
| 1685 // Slow-case: Handle non-smi or out-of-bounds access to arguments | 1685 // Slow-case: Handle non-smi or out-of-bounds access to arguments |
| 1686 // by calling the runtime system. | 1686 // by calling the runtime system. |
| 1687 __ bind(&slow); | 1687 __ bind(&slow); |
| 1688 __ push(r4); | 1688 __ push(r4); |
| 1689 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); | 1689 __ TailCallRuntime(Runtime::kArguments, 1, 1); |
| 1690 } | 1690 } |
| 1691 | 1691 |
| 1692 | 1692 |
| 1693 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { | 1693 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { |
| 1694 // sp[0] : number of parameters | 1694 // sp[0] : number of parameters |
| 1695 // sp[1] : receiver displacement | 1695 // sp[1] : receiver displacement |
| 1696 // sp[2] : function | 1696 // sp[2] : function |
| 1697 | 1697 |
| 1698 // Check if the calling frame is an arguments adaptor frame. | 1698 // Check if the calling frame is an arguments adaptor frame. |
| 1699 Label runtime; | 1699 Label runtime; |
| (...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3474 String::TWO_BYTE_ENCODING); | 3474 String::TWO_BYTE_ENCODING); |
| 3475 | 3475 |
| 3476 __ bind(&return_r3); | 3476 __ bind(&return_r3); |
| 3477 Counters* counters = isolate()->counters(); | 3477 Counters* counters = isolate()->counters(); |
| 3478 __ IncrementCounter(counters->sub_string_native(), 1, r6, r7); | 3478 __ IncrementCounter(counters->sub_string_native(), 1, r6, r7); |
| 3479 __ Drop(3); | 3479 __ Drop(3); |
| 3480 __ Ret(); | 3480 __ Ret(); |
| 3481 | 3481 |
| 3482 // Just jump to runtime to create the sub string. | 3482 // Just jump to runtime to create the sub string. |
| 3483 __ bind(&runtime); | 3483 __ bind(&runtime); |
| 3484 __ TailCallRuntime(Runtime::kSubStringRT, 3, 1); | 3484 __ TailCallRuntime(Runtime::kSubString, 3, 1); |
| 3485 | 3485 |
| 3486 __ bind(&single_char); | 3486 __ bind(&single_char); |
| 3487 // r3: original string | 3487 // r3: original string |
| 3488 // r4: instance type | 3488 // r4: instance type |
| 3489 // r5: length | 3489 // r5: length |
| 3490 // r6: from index (untagged) | 3490 // r6: from index (untagged) |
| 3491 __ SmiTag(r6, r6); | 3491 __ SmiTag(r6, r6); |
| 3492 StringCharAtGenerator generator(r3, r6, r5, r3, &runtime, &runtime, &runtime, | 3492 StringCharAtGenerator generator(r3, r6, r5, r3, &runtime, &runtime, &runtime, |
| 3493 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 3493 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); |
| 3494 generator.GenerateFast(masm); | 3494 generator.GenerateFast(masm); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3687 __ JumpIfNotBothSequentialOneByteStrings(r4, r3, r5, r6, &runtime); | 3687 __ JumpIfNotBothSequentialOneByteStrings(r4, r3, r5, r6, &runtime); |
| 3688 | 3688 |
| 3689 // Compare flat one-byte strings natively. Remove arguments from stack first. | 3689 // Compare flat one-byte strings natively. Remove arguments from stack first. |
| 3690 __ IncrementCounter(counters->string_compare_native(), 1, r5, r6); | 3690 __ IncrementCounter(counters->string_compare_native(), 1, r5, r6); |
| 3691 __ addi(sp, sp, Operand(2 * kPointerSize)); | 3691 __ addi(sp, sp, Operand(2 * kPointerSize)); |
| 3692 StringHelper::GenerateCompareFlatOneByteStrings(masm, r4, r3, r5, r6, r7); | 3692 StringHelper::GenerateCompareFlatOneByteStrings(masm, r4, r3, r5, r6, r7); |
| 3693 | 3693 |
| 3694 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) | 3694 // Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater) |
| 3695 // tagged as a small integer. | 3695 // tagged as a small integer. |
| 3696 __ bind(&runtime); | 3696 __ bind(&runtime); |
| 3697 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); | 3697 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
| 3698 } | 3698 } |
| 3699 | 3699 |
| 3700 | 3700 |
| 3701 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { | 3701 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
| 3702 // ----------- S t a t e ------------- | 3702 // ----------- S t a t e ------------- |
| 3703 // -- r4 : left | 3703 // -- r4 : left |
| 3704 // -- r3 : right | 3704 // -- r3 : right |
| 3705 // -- lr : return address | 3705 // -- lr : return address |
| 3706 // ----------------------------------- | 3706 // ----------------------------------- |
| 3707 | 3707 |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3991 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, | 3991 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, |
| 3992 tmp2, tmp3); | 3992 tmp2, tmp3); |
| 3993 } | 3993 } |
| 3994 | 3994 |
| 3995 // Handle more complex cases in runtime. | 3995 // Handle more complex cases in runtime. |
| 3996 __ bind(&runtime); | 3996 __ bind(&runtime); |
| 3997 __ Push(left, right); | 3997 __ Push(left, right); |
| 3998 if (equality) { | 3998 if (equality) { |
| 3999 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); | 3999 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); |
| 4000 } else { | 4000 } else { |
| 4001 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); | 4001 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
| 4002 } | 4002 } |
| 4003 | 4003 |
| 4004 __ bind(&miss); | 4004 __ bind(&miss); |
| 4005 GenerateMiss(masm); | 4005 GenerateMiss(masm); |
| 4006 } | 4006 } |
| 4007 | 4007 |
| 4008 | 4008 |
| 4009 void CompareICStub::GenerateObjects(MacroAssembler* masm) { | 4009 void CompareICStub::GenerateObjects(MacroAssembler* masm) { |
| 4010 DCHECK(state() == CompareICState::OBJECT); | 4010 DCHECK(state() == CompareICState::OBJECT); |
| 4011 Label miss; | 4011 Label miss; |
| (...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5831 kStackUnwindSpace, NULL, | 5831 kStackUnwindSpace, NULL, |
| 5832 MemOperand(fp, 6 * kPointerSize), NULL); | 5832 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5833 } | 5833 } |
| 5834 | 5834 |
| 5835 | 5835 |
| 5836 #undef __ | 5836 #undef __ |
| 5837 } // namespace internal | 5837 } // namespace internal |
| 5838 } // namespace v8 | 5838 } // namespace v8 |
| 5839 | 5839 |
| 5840 #endif // V8_TARGET_ARCH_PPC | 5840 #endif // V8_TARGET_ARCH_PPC |
| OLD | NEW |