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 #if V8_TARGET_ARCH_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2076 case Token::SHR: { | 2076 case Token::SHR: { |
2077 __ SmiUntag(scratch1, left); | 2077 __ SmiUntag(scratch1, left); |
2078 __ GetLeastBitsFromSmi(scratch2, right, 5); | 2078 __ GetLeastBitsFromSmi(scratch2, right, 5); |
2079 __ dsrlv(scratch1, scratch1, scratch2); | 2079 __ dsrlv(scratch1, scratch1, scratch2); |
2080 __ And(scratch2, scratch1, 0x80000000); | 2080 __ And(scratch2, scratch1, 0x80000000); |
2081 __ Branch(&stub_call, ne, scratch2, Operand(zero_reg)); | 2081 __ Branch(&stub_call, ne, scratch2, Operand(zero_reg)); |
2082 __ SmiTag(v0, scratch1); | 2082 __ SmiTag(v0, scratch1); |
2083 break; | 2083 break; |
2084 } | 2084 } |
2085 case Token::ADD: | 2085 case Token::ADD: |
2086 __ DadduAndCheckForOverflow(v0, left, right, scratch1); | 2086 __ DaddBranchOvf(v0, left, Operand(right), &stub_call); |
2087 __ BranchOnOverflow(&stub_call, scratch1); | |
2088 break; | 2087 break; |
2089 case Token::SUB: | 2088 case Token::SUB: |
2090 __ DsubuAndCheckForOverflow(v0, left, right, scratch1); | 2089 __ DsubBranchOvf(v0, left, Operand(right), &stub_call); |
2091 __ BranchOnOverflow(&stub_call, scratch1); | |
2092 break; | 2090 break; |
2093 case Token::MUL: { | 2091 case Token::MUL: { |
2094 __ Dmulh(v0, left, right); | 2092 __ Dmulh(v0, left, right); |
2095 __ dsra32(scratch2, v0, 0); | 2093 __ dsra32(scratch2, v0, 0); |
2096 __ sra(scratch1, v0, 31); | 2094 __ sra(scratch1, v0, 31); |
2097 __ Branch(USE_DELAY_SLOT, &stub_call, ne, scratch2, Operand(scratch1)); | 2095 __ Branch(USE_DELAY_SLOT, &stub_call, ne, scratch2, Operand(scratch1)); |
2098 __ SmiTag(v0); | 2096 __ SmiTag(v0); |
2099 __ Branch(USE_DELAY_SLOT, &done, ne, v0, Operand(zero_reg)); | 2097 __ Branch(USE_DELAY_SLOT, &done, ne, v0, Operand(zero_reg)); |
2100 __ Daddu(scratch2, right, left); | 2098 __ Daddu(scratch2, right, left); |
2101 __ Branch(&stub_call, lt, scratch2, Operand(zero_reg)); | 2099 __ Branch(&stub_call, lt, scratch2, Operand(zero_reg)); |
(...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3665 __ sd(v0, MemOperand(sp, 2 * kPointerSize)); | 3663 __ sd(v0, MemOperand(sp, 2 * kPointerSize)); |
3666 break; | 3664 break; |
3667 case KEYED_SUPER_PROPERTY: | 3665 case KEYED_SUPER_PROPERTY: |
3668 __ sd(v0, MemOperand(sp, 3 * kPointerSize)); | 3666 __ sd(v0, MemOperand(sp, 3 * kPointerSize)); |
3669 break; | 3667 break; |
3670 } | 3668 } |
3671 } | 3669 } |
3672 } | 3670 } |
3673 | 3671 |
3674 Register scratch1 = a1; | 3672 Register scratch1 = a1; |
3675 Register scratch2 = a4; | |
3676 __ li(scratch1, Operand(Smi::FromInt(count_value))); | 3673 __ li(scratch1, Operand(Smi::FromInt(count_value))); |
3677 __ DadduAndCheckForOverflow(v0, v0, scratch1, scratch2); | 3674 __ DaddBranchNoOvf(v0, v0, Operand(scratch1), &done); |
3678 __ BranchOnNoOverflow(&done, scratch2); | |
3679 // Call stub. Undo operation first. | 3675 // Call stub. Undo operation first. |
3680 __ Move(v0, a0); | 3676 __ Move(v0, a0); |
3681 __ jmp(&stub_call); | 3677 __ jmp(&stub_call); |
3682 __ bind(&slow); | 3678 __ bind(&slow); |
3683 } | 3679 } |
3684 | 3680 |
3685 // Convert old value into a number. | 3681 // Convert old value into a number. |
3686 ToNumberStub convert_stub(isolate()); | 3682 ToNumberStub convert_stub(isolate()); |
3687 __ CallStub(&convert_stub); | 3683 __ CallStub(&convert_stub); |
3688 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 3684 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4175 reinterpret_cast<uint64_t>( | 4171 reinterpret_cast<uint64_t>( |
4176 isolate->builtins()->OnStackReplacement()->entry())); | 4172 isolate->builtins()->OnStackReplacement()->entry())); |
4177 return ON_STACK_REPLACEMENT; | 4173 return ON_STACK_REPLACEMENT; |
4178 } | 4174 } |
4179 | 4175 |
4180 | 4176 |
4181 } // namespace internal | 4177 } // namespace internal |
4182 } // namespace v8 | 4178 } // namespace v8 |
4183 | 4179 |
4184 #endif // V8_TARGET_ARCH_MIPS64 | 4180 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |