| 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 // Note on Mips implementation: | 9 // Note on Mips implementation: |
| 10 // | 10 // |
| (...skipping 2469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2480 case Token::SHR: { | 2480 case Token::SHR: { |
| 2481 __ SmiUntag(scratch1, left); | 2481 __ SmiUntag(scratch1, left); |
| 2482 __ GetLeastBitsFromSmi(scratch2, right, 5); | 2482 __ GetLeastBitsFromSmi(scratch2, right, 5); |
| 2483 __ dsrlv(scratch1, scratch1, scratch2); | 2483 __ dsrlv(scratch1, scratch1, scratch2); |
| 2484 __ And(scratch2, scratch1, 0x80000000); | 2484 __ And(scratch2, scratch1, 0x80000000); |
| 2485 __ Branch(&stub_call, ne, scratch2, Operand(zero_reg)); | 2485 __ Branch(&stub_call, ne, scratch2, Operand(zero_reg)); |
| 2486 __ SmiTag(v0, scratch1); | 2486 __ SmiTag(v0, scratch1); |
| 2487 break; | 2487 break; |
| 2488 } | 2488 } |
| 2489 case Token::ADD: | 2489 case Token::ADD: |
| 2490 __ AdduAndCheckForOverflow(v0, left, right, scratch1); | 2490 __ DadduAndCheckForOverflow(v0, left, right, scratch1); |
| 2491 __ BranchOnOverflow(&stub_call, scratch1); | 2491 __ BranchOnOverflow(&stub_call, scratch1); |
| 2492 break; | 2492 break; |
| 2493 case Token::SUB: | 2493 case Token::SUB: |
| 2494 __ SubuAndCheckForOverflow(v0, left, right, scratch1); | 2494 __ DsubuAndCheckForOverflow(v0, left, right, scratch1); |
| 2495 __ BranchOnOverflow(&stub_call, scratch1); | 2495 __ BranchOnOverflow(&stub_call, scratch1); |
| 2496 break; | 2496 break; |
| 2497 case Token::MUL: { | 2497 case Token::MUL: { |
| 2498 __ Dmulh(v0, left, right); | 2498 __ Dmulh(v0, left, right); |
| 2499 __ dsra32(scratch2, v0, 0); | 2499 __ dsra32(scratch2, v0, 0); |
| 2500 __ sra(scratch1, v0, 31); | 2500 __ sra(scratch1, v0, 31); |
| 2501 __ Branch(USE_DELAY_SLOT, &stub_call, ne, scratch2, Operand(scratch1)); | 2501 __ Branch(USE_DELAY_SLOT, &stub_call, ne, scratch2, Operand(scratch1)); |
| 2502 __ SmiTag(v0); | 2502 __ SmiTag(v0); |
| 2503 __ Branch(USE_DELAY_SLOT, &done, ne, v0, Operand(zero_reg)); | 2503 __ Branch(USE_DELAY_SLOT, &done, ne, v0, Operand(zero_reg)); |
| 2504 __ Daddu(scratch2, right, left); | 2504 __ Daddu(scratch2, right, left); |
| (...skipping 1972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4477 Operand(zero_reg)); | 4477 Operand(zero_reg)); |
| 4478 } | 4478 } |
| 4479 __ bind(&loop); | 4479 __ bind(&loop); |
| 4480 __ ld(string, MemOperand(element)); | 4480 __ ld(string, MemOperand(element)); |
| 4481 __ Daddu(element, element, kPointerSize); | 4481 __ Daddu(element, element, kPointerSize); |
| 4482 __ JumpIfSmi(string, &bailout); | 4482 __ JumpIfSmi(string, &bailout); |
| 4483 __ ld(scratch1, FieldMemOperand(string, HeapObject::kMapOffset)); | 4483 __ ld(scratch1, FieldMemOperand(string, HeapObject::kMapOffset)); |
| 4484 __ lbu(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset)); | 4484 __ lbu(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset)); |
| 4485 __ JumpIfInstanceTypeIsNotSequentialOneByte(scratch1, scratch2, &bailout); | 4485 __ JumpIfInstanceTypeIsNotSequentialOneByte(scratch1, scratch2, &bailout); |
| 4486 __ ld(scratch1, FieldMemOperand(string, SeqOneByteString::kLengthOffset)); | 4486 __ ld(scratch1, FieldMemOperand(string, SeqOneByteString::kLengthOffset)); |
| 4487 __ AdduAndCheckForOverflow(string_length, string_length, scratch1, scratch3); | 4487 __ DadduAndCheckForOverflow(string_length, string_length, scratch1, scratch3); |
| 4488 __ BranchOnOverflow(&bailout, scratch3); | 4488 __ BranchOnOverflow(&bailout, scratch3); |
| 4489 __ Branch(&loop, lt, element, Operand(elements_end)); | 4489 __ Branch(&loop, lt, element, Operand(elements_end)); |
| 4490 | 4490 |
| 4491 // If array_length is 1, return elements[0], a string. | 4491 // If array_length is 1, return elements[0], a string. |
| 4492 __ Branch(¬_size_one_array, ne, array_length, Operand(1)); | 4492 __ Branch(¬_size_one_array, ne, array_length, Operand(1)); |
| 4493 __ ld(v0, FieldMemOperand(elements, FixedArray::kHeaderSize)); | 4493 __ ld(v0, FieldMemOperand(elements, FixedArray::kHeaderSize)); |
| 4494 __ Branch(&done); | 4494 __ Branch(&done); |
| 4495 | 4495 |
| 4496 __ bind(¬_size_one_array); | 4496 __ bind(¬_size_one_array); |
| 4497 | 4497 |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4993 case KEYED_SUPER_PROPERTY: | 4993 case KEYED_SUPER_PROPERTY: |
| 4994 __ sd(v0, MemOperand(sp, 3 * kPointerSize)); | 4994 __ sd(v0, MemOperand(sp, 3 * kPointerSize)); |
| 4995 break; | 4995 break; |
| 4996 } | 4996 } |
| 4997 } | 4997 } |
| 4998 } | 4998 } |
| 4999 | 4999 |
| 5000 Register scratch1 = a1; | 5000 Register scratch1 = a1; |
| 5001 Register scratch2 = a4; | 5001 Register scratch2 = a4; |
| 5002 __ li(scratch1, Operand(Smi::FromInt(count_value))); | 5002 __ li(scratch1, Operand(Smi::FromInt(count_value))); |
| 5003 __ AdduAndCheckForOverflow(v0, v0, scratch1, scratch2); | 5003 __ DadduAndCheckForOverflow(v0, v0, scratch1, scratch2); |
| 5004 __ BranchOnNoOverflow(&done, scratch2); | 5004 __ BranchOnNoOverflow(&done, scratch2); |
| 5005 // Call stub. Undo operation first. | 5005 // Call stub. Undo operation first. |
| 5006 __ Move(v0, a0); | 5006 __ Move(v0, a0); |
| 5007 __ jmp(&stub_call); | 5007 __ jmp(&stub_call); |
| 5008 __ bind(&slow); | 5008 __ bind(&slow); |
| 5009 } | 5009 } |
| 5010 ToNumberStub convert_stub(isolate()); | 5010 ToNumberStub convert_stub(isolate()); |
| 5011 __ CallStub(&convert_stub); | 5011 __ CallStub(&convert_stub); |
| 5012 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); | 5012 PrepareForBailoutForId(expr->ToNumberId(), TOS_REG); |
| 5013 | 5013 |
| (...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5545 reinterpret_cast<uint64_t>( | 5545 reinterpret_cast<uint64_t>( |
| 5546 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5546 isolate->builtins()->OsrAfterStackCheck()->entry())); |
| 5547 return OSR_AFTER_STACK_CHECK; | 5547 return OSR_AFTER_STACK_CHECK; |
| 5548 } | 5548 } |
| 5549 | 5549 |
| 5550 | 5550 |
| 5551 } // namespace internal | 5551 } // namespace internal |
| 5552 } // namespace v8 | 5552 } // namespace v8 |
| 5553 | 5553 |
| 5554 #endif // V8_TARGET_ARCH_MIPS64 | 5554 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |