| 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 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 __ dsubu(a3, a0, a1); | 1676 __ dsubu(a3, a0, a1); |
| 1677 __ SmiScale(a7, a3, kPointerSizeLog2); | 1677 __ SmiScale(a7, a3, kPointerSizeLog2); |
| 1678 __ Daddu(a3, a2, Operand(a7)); | 1678 __ Daddu(a3, a2, Operand(a7)); |
| 1679 __ Ret(USE_DELAY_SLOT); | 1679 __ Ret(USE_DELAY_SLOT); |
| 1680 __ ld(v0, MemOperand(a3, kDisplacement)); | 1680 __ ld(v0, MemOperand(a3, kDisplacement)); |
| 1681 | 1681 |
| 1682 // Slow-case: Handle non-smi or out-of-bounds access to arguments | 1682 // Slow-case: Handle non-smi or out-of-bounds access to arguments |
| 1683 // by calling the runtime system. | 1683 // by calling the runtime system. |
| 1684 __ bind(&slow); | 1684 __ bind(&slow); |
| 1685 __ push(a1); | 1685 __ push(a1); |
| 1686 __ TailCallRuntime(Runtime::kGetArgumentsProperty, 1, 1); | 1686 __ TailCallRuntime(Runtime::kArguments, 1, 1); |
| 1687 } | 1687 } |
| 1688 | 1688 |
| 1689 | 1689 |
| 1690 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { | 1690 void ArgumentsAccessStub::GenerateNewSloppySlow(MacroAssembler* masm) { |
| 1691 // sp[0] : number of parameters | 1691 // sp[0] : number of parameters |
| 1692 // sp[4] : receiver displacement | 1692 // sp[4] : receiver displacement |
| 1693 // sp[8] : function | 1693 // sp[8] : function |
| 1694 | 1694 |
| 1695 // Check if the calling frame is an arguments adaptor frame. | 1695 // Check if the calling frame is an arguments adaptor frame. |
| 1696 Label runtime; | 1696 Label runtime; |
| (...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3481 StringHelper::GenerateCopyCharacters( | 3481 StringHelper::GenerateCopyCharacters( |
| 3482 masm, a1, a5, a2, a3, String::TWO_BYTE_ENCODING); | 3482 masm, a1, a5, a2, a3, String::TWO_BYTE_ENCODING); |
| 3483 | 3483 |
| 3484 __ bind(&return_v0); | 3484 __ bind(&return_v0); |
| 3485 Counters* counters = isolate()->counters(); | 3485 Counters* counters = isolate()->counters(); |
| 3486 __ IncrementCounter(counters->sub_string_native(), 1, a3, a4); | 3486 __ IncrementCounter(counters->sub_string_native(), 1, a3, a4); |
| 3487 __ DropAndRet(3); | 3487 __ DropAndRet(3); |
| 3488 | 3488 |
| 3489 // Just jump to runtime to create the sub string. | 3489 // Just jump to runtime to create the sub string. |
| 3490 __ bind(&runtime); | 3490 __ bind(&runtime); |
| 3491 __ TailCallRuntime(Runtime::kSubStringRT, 3, 1); | 3491 __ TailCallRuntime(Runtime::kSubString, 3, 1); |
| 3492 | 3492 |
| 3493 __ bind(&single_char); | 3493 __ bind(&single_char); |
| 3494 // v0: original string | 3494 // v0: original string |
| 3495 // a1: instance type | 3495 // a1: instance type |
| 3496 // a2: length | 3496 // a2: length |
| 3497 // a3: from index (untagged) | 3497 // a3: from index (untagged) |
| 3498 __ SmiTag(a3); | 3498 __ SmiTag(a3); |
| 3499 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, | 3499 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, |
| 3500 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 3500 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); |
| 3501 generator.GenerateFast(masm); | 3501 generator.GenerateFast(masm); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3675 | 3675 |
| 3676 // Check that both objects are sequential one_byte strings. | 3676 // Check that both objects are sequential one_byte strings. |
| 3677 __ JumpIfNotBothSequentialOneByteStrings(a1, a0, a2, a3, &runtime); | 3677 __ JumpIfNotBothSequentialOneByteStrings(a1, a0, a2, a3, &runtime); |
| 3678 | 3678 |
| 3679 // Compare flat one_byte strings natively. Remove arguments from stack first. | 3679 // Compare flat one_byte strings natively. Remove arguments from stack first. |
| 3680 __ IncrementCounter(counters->string_compare_native(), 1, a2, a3); | 3680 __ IncrementCounter(counters->string_compare_native(), 1, a2, a3); |
| 3681 __ Daddu(sp, sp, Operand(2 * kPointerSize)); | 3681 __ Daddu(sp, sp, Operand(2 * kPointerSize)); |
| 3682 StringHelper::GenerateCompareFlatOneByteStrings(masm, a1, a0, a2, a3, a4, a5); | 3682 StringHelper::GenerateCompareFlatOneByteStrings(masm, a1, a0, a2, a3, a4, a5); |
| 3683 | 3683 |
| 3684 __ bind(&runtime); | 3684 __ bind(&runtime); |
| 3685 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); | 3685 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
| 3686 } | 3686 } |
| 3687 | 3687 |
| 3688 | 3688 |
| 3689 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { | 3689 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
| 3690 // ----------- S t a t e ------------- | 3690 // ----------- S t a t e ------------- |
| 3691 // -- a1 : left | 3691 // -- a1 : left |
| 3692 // -- a0 : right | 3692 // -- a0 : right |
| 3693 // -- ra : return address | 3693 // -- ra : return address |
| 3694 // ----------------------------------- | 3694 // ----------------------------------- |
| 3695 | 3695 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3985 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, | 3985 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, |
| 3986 tmp2, tmp3, tmp4); | 3986 tmp2, tmp3, tmp4); |
| 3987 } | 3987 } |
| 3988 | 3988 |
| 3989 // Handle more complex cases in runtime. | 3989 // Handle more complex cases in runtime. |
| 3990 __ bind(&runtime); | 3990 __ bind(&runtime); |
| 3991 __ Push(left, right); | 3991 __ Push(left, right); |
| 3992 if (equality) { | 3992 if (equality) { |
| 3993 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); | 3993 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); |
| 3994 } else { | 3994 } else { |
| 3995 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); | 3995 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
| 3996 } | 3996 } |
| 3997 | 3997 |
| 3998 __ bind(&miss); | 3998 __ bind(&miss); |
| 3999 GenerateMiss(masm); | 3999 GenerateMiss(masm); |
| 4000 } | 4000 } |
| 4001 | 4001 |
| 4002 | 4002 |
| 4003 void CompareICStub::GenerateObjects(MacroAssembler* masm) { | 4003 void CompareICStub::GenerateObjects(MacroAssembler* masm) { |
| 4004 DCHECK(state() == CompareICState::OBJECT); | 4004 DCHECK(state() == CompareICState::OBJECT); |
| 4005 Label miss; | 4005 Label miss; |
| (...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5758 MemOperand(fp, 6 * kPointerSize), NULL); | 5758 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5759 } | 5759 } |
| 5760 | 5760 |
| 5761 | 5761 |
| 5762 #undef __ | 5762 #undef __ |
| 5763 | 5763 |
| 5764 } // namespace internal | 5764 } // namespace internal |
| 5765 } // namespace v8 | 5765 } // namespace v8 |
| 5766 | 5766 |
| 5767 #endif // V8_TARGET_ARCH_MIPS64 | 5767 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |