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 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...skipping 2351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2362 case Token::ADD: | 2362 case Token::ADD: |
2363 __ AdduAndCheckForOverflow(v0, left, right, scratch1); | 2363 __ AdduAndCheckForOverflow(v0, left, right, scratch1); |
2364 __ BranchOnOverflow(&stub_call, scratch1); | 2364 __ BranchOnOverflow(&stub_call, scratch1); |
2365 break; | 2365 break; |
2366 case Token::SUB: | 2366 case Token::SUB: |
2367 __ SubuAndCheckForOverflow(v0, left, right, scratch1); | 2367 __ SubuAndCheckForOverflow(v0, left, right, scratch1); |
2368 __ BranchOnOverflow(&stub_call, scratch1); | 2368 __ BranchOnOverflow(&stub_call, scratch1); |
2369 break; | 2369 break; |
2370 case Token::MUL: { | 2370 case Token::MUL: { |
2371 __ SmiUntag(scratch1, right); | 2371 __ SmiUntag(scratch1, right); |
2372 __ Mult(left, scratch1); | 2372 __ Mul(scratch2, v0, left, scratch1); |
2373 __ mflo(scratch1); | 2373 __ sra(scratch1, v0, 31); |
2374 __ mfhi(scratch2); | |
2375 __ sra(scratch1, scratch1, 31); | |
2376 __ Branch(&stub_call, ne, scratch1, Operand(scratch2)); | 2374 __ Branch(&stub_call, ne, scratch1, Operand(scratch2)); |
2377 __ mflo(v0); | |
2378 __ Branch(&done, ne, v0, Operand(zero_reg)); | 2375 __ Branch(&done, ne, v0, Operand(zero_reg)); |
2379 __ Addu(scratch2, right, left); | 2376 __ Addu(scratch2, right, left); |
2380 __ Branch(&stub_call, lt, scratch2, Operand(zero_reg)); | 2377 __ Branch(&stub_call, lt, scratch2, Operand(zero_reg)); |
2381 DCHECK(Smi::FromInt(0) == 0); | 2378 DCHECK(Smi::FromInt(0) == 0); |
2382 __ mov(v0, zero_reg); | 2379 __ mov(v0, zero_reg); |
2383 break; | 2380 break; |
2384 } | 2381 } |
2385 case Token::BIT_OR: | 2382 case Token::BIT_OR: |
2386 __ Or(v0, left, Operand(right)); | 2383 __ Or(v0, left, Operand(right)); |
2387 break; | 2384 break; |
(...skipping 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3936 __ JumpIfSmi(separator, &bailout); | 3933 __ JumpIfSmi(separator, &bailout); |
3937 __ lw(scratch1, FieldMemOperand(separator, HeapObject::kMapOffset)); | 3934 __ lw(scratch1, FieldMemOperand(separator, HeapObject::kMapOffset)); |
3938 __ lbu(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset)); | 3935 __ lbu(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset)); |
3939 __ JumpIfInstanceTypeIsNotSequentialAscii(scratch1, scratch2, &bailout); | 3936 __ JumpIfInstanceTypeIsNotSequentialAscii(scratch1, scratch2, &bailout); |
3940 | 3937 |
3941 // Add (separator length times array_length) - separator length to the | 3938 // Add (separator length times array_length) - separator length to the |
3942 // string_length to get the length of the result string. array_length is not | 3939 // string_length to get the length of the result string. array_length is not |
3943 // smi but the other values are, so the result is a smi. | 3940 // smi but the other values are, so the result is a smi. |
3944 __ lw(scratch1, FieldMemOperand(separator, SeqOneByteString::kLengthOffset)); | 3941 __ lw(scratch1, FieldMemOperand(separator, SeqOneByteString::kLengthOffset)); |
3945 __ Subu(string_length, string_length, Operand(scratch1)); | 3942 __ Subu(string_length, string_length, Operand(scratch1)); |
3946 __ Mult(array_length, scratch1); | 3943 __ Mul(scratch3, scratch2, array_length, scratch1); |
3947 // Check for smi overflow. No overflow if higher 33 bits of 64-bit result are | 3944 // Check for smi overflow. No overflow if higher 33 bits of 64-bit result are |
3948 // zero. | 3945 // zero. |
3949 __ mfhi(scratch2); | 3946 __ Branch(&bailout, ne, scratch3, Operand(zero_reg)); |
3950 __ Branch(&bailout, ne, scratch2, Operand(zero_reg)); | |
3951 __ mflo(scratch2); | |
3952 __ And(scratch3, scratch2, Operand(0x80000000)); | 3947 __ And(scratch3, scratch2, Operand(0x80000000)); |
3953 __ Branch(&bailout, ne, scratch3, Operand(zero_reg)); | 3948 __ Branch(&bailout, ne, scratch3, Operand(zero_reg)); |
3954 __ AdduAndCheckForOverflow(string_length, string_length, scratch2, scratch3); | 3949 __ AdduAndCheckForOverflow(string_length, string_length, scratch2, scratch3); |
3955 __ BranchOnOverflow(&bailout, scratch3); | 3950 __ BranchOnOverflow(&bailout, scratch3); |
3956 __ SmiUntag(string_length); | 3951 __ SmiUntag(string_length); |
3957 | 3952 |
3958 // Get first element in the array to free up the elements register to be used | 3953 // Get first element in the array to free up the elements register to be used |
3959 // for the result. | 3954 // for the result. |
3960 __ Addu(element, | 3955 __ Addu(element, |
3961 elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 3956 elements, Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
(...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4880 Assembler::target_address_at(pc_immediate_load_address)) == | 4875 Assembler::target_address_at(pc_immediate_load_address)) == |
4881 reinterpret_cast<uint32_t>( | 4876 reinterpret_cast<uint32_t>( |
4882 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4877 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4883 return OSR_AFTER_STACK_CHECK; | 4878 return OSR_AFTER_STACK_CHECK; |
4884 } | 4879 } |
4885 | 4880 |
4886 | 4881 |
4887 } } // namespace v8::internal | 4882 } } // namespace v8::internal |
4888 | 4883 |
4889 #endif // V8_TARGET_ARCH_MIPS | 4884 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |