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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
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 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1676 __ subu(a3, a0, a1); | 1676 __ subu(a3, a0, a1); |
1677 __ sll(t3, a3, kPointerSizeLog2 - kSmiTagSize); | 1677 __ sll(t3, a3, kPointerSizeLog2 - kSmiTagSize); |
1678 __ Addu(a3, a2, Operand(t3)); | 1678 __ Addu(a3, a2, Operand(t3)); |
1679 __ Ret(USE_DELAY_SLOT); | 1679 __ Ret(USE_DELAY_SLOT); |
1680 __ lw(v0, MemOperand(a3, kDisplacement)); | 1680 __ lw(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 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3449 StringHelper::GenerateCopyCharacters( | 3449 StringHelper::GenerateCopyCharacters( |
3450 masm, a1, t1, a2, a3, String::TWO_BYTE_ENCODING); | 3450 masm, a1, t1, a2, a3, String::TWO_BYTE_ENCODING); |
3451 | 3451 |
3452 __ bind(&return_v0); | 3452 __ bind(&return_v0); |
3453 Counters* counters = isolate()->counters(); | 3453 Counters* counters = isolate()->counters(); |
3454 __ IncrementCounter(counters->sub_string_native(), 1, a3, t0); | 3454 __ IncrementCounter(counters->sub_string_native(), 1, a3, t0); |
3455 __ DropAndRet(3); | 3455 __ DropAndRet(3); |
3456 | 3456 |
3457 // Just jump to runtime to create the sub string. | 3457 // Just jump to runtime to create the sub string. |
3458 __ bind(&runtime); | 3458 __ bind(&runtime); |
3459 __ TailCallRuntime(Runtime::kSubStringRT, 3, 1); | 3459 __ TailCallRuntime(Runtime::kSubString, 3, 1); |
3460 | 3460 |
3461 __ bind(&single_char); | 3461 __ bind(&single_char); |
3462 // v0: original string | 3462 // v0: original string |
3463 // a1: instance type | 3463 // a1: instance type |
3464 // a2: length | 3464 // a2: length |
3465 // a3: from index (untagged) | 3465 // a3: from index (untagged) |
3466 __ SmiTag(a3, a3); | 3466 __ SmiTag(a3, a3); |
3467 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, | 3467 StringCharAtGenerator generator(v0, a3, a2, v0, &runtime, &runtime, &runtime, |
3468 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); | 3468 STRING_INDEX_IS_NUMBER, RECEIVER_IS_STRING); |
3469 generator.GenerateFast(masm); | 3469 generator.GenerateFast(masm); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3643 | 3643 |
3644 // Check that both objects are sequential one-byte strings. | 3644 // Check that both objects are sequential one-byte strings. |
3645 __ JumpIfNotBothSequentialOneByteStrings(a1, a0, a2, a3, &runtime); | 3645 __ JumpIfNotBothSequentialOneByteStrings(a1, a0, a2, a3, &runtime); |
3646 | 3646 |
3647 // Compare flat ASCII strings natively. Remove arguments from stack first. | 3647 // Compare flat ASCII strings natively. Remove arguments from stack first. |
3648 __ IncrementCounter(counters->string_compare_native(), 1, a2, a3); | 3648 __ IncrementCounter(counters->string_compare_native(), 1, a2, a3); |
3649 __ Addu(sp, sp, Operand(2 * kPointerSize)); | 3649 __ Addu(sp, sp, Operand(2 * kPointerSize)); |
3650 StringHelper::GenerateCompareFlatOneByteStrings(masm, a1, a0, a2, a3, t0, t1); | 3650 StringHelper::GenerateCompareFlatOneByteStrings(masm, a1, a0, a2, a3, t0, t1); |
3651 | 3651 |
3652 __ bind(&runtime); | 3652 __ bind(&runtime); |
3653 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); | 3653 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
3654 } | 3654 } |
3655 | 3655 |
3656 | 3656 |
3657 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { | 3657 void BinaryOpICWithAllocationSiteStub::Generate(MacroAssembler* masm) { |
3658 // ----------- S t a t e ------------- | 3658 // ----------- S t a t e ------------- |
3659 // -- a1 : left | 3659 // -- a1 : left |
3660 // -- a0 : right | 3660 // -- a0 : right |
3661 // -- ra : return address | 3661 // -- ra : return address |
3662 // ----------------------------------- | 3662 // ----------------------------------- |
3663 | 3663 |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3953 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, | 3953 StringHelper::GenerateCompareFlatOneByteStrings(masm, left, right, tmp1, |
3954 tmp2, tmp3, tmp4); | 3954 tmp2, tmp3, tmp4); |
3955 } | 3955 } |
3956 | 3956 |
3957 // Handle more complex cases in runtime. | 3957 // Handle more complex cases in runtime. |
3958 __ bind(&runtime); | 3958 __ bind(&runtime); |
3959 __ Push(left, right); | 3959 __ Push(left, right); |
3960 if (equality) { | 3960 if (equality) { |
3961 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); | 3961 __ TailCallRuntime(Runtime::kStringEquals, 2, 1); |
3962 } else { | 3962 } else { |
3963 __ TailCallRuntime(Runtime::kStringCompareRT, 2, 1); | 3963 __ TailCallRuntime(Runtime::kStringCompare, 2, 1); |
3964 } | 3964 } |
3965 | 3965 |
3966 __ bind(&miss); | 3966 __ bind(&miss); |
3967 GenerateMiss(masm); | 3967 GenerateMiss(masm); |
3968 } | 3968 } |
3969 | 3969 |
3970 | 3970 |
3971 void CompareICStub::GenerateObjects(MacroAssembler* masm) { | 3971 void CompareICStub::GenerateObjects(MacroAssembler* masm) { |
3972 DCHECK(state() == CompareICState::OBJECT); | 3972 DCHECK(state() == CompareICState::OBJECT); |
3973 Label miss; | 3973 Label miss; |
(...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5726 MemOperand(fp, 6 * kPointerSize), NULL); | 5726 MemOperand(fp, 6 * kPointerSize), NULL); |
5727 } | 5727 } |
5728 | 5728 |
5729 | 5729 |
5730 #undef __ | 5730 #undef __ |
5731 | 5731 |
5732 } // namespace internal | 5732 } // namespace internal |
5733 } // namespace v8 | 5733 } // namespace v8 |
5734 | 5734 |
5735 #endif // V8_TARGET_ARCH_MIPS | 5735 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |