| 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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
| 6 | 6 |
| 7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
| 8 #include "src/bootstrapper.h" | 8 #include "src/bootstrapper.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 // for that. | 507 // for that. |
| 508 __ ldc1(f12, FieldMemOperand(lhs, HeapNumber::kValueOffset)); | 508 __ ldc1(f12, FieldMemOperand(lhs, HeapNumber::kValueOffset)); |
| 509 __ ldc1(f14, FieldMemOperand(rhs, HeapNumber::kValueOffset)); | 509 __ ldc1(f14, FieldMemOperand(rhs, HeapNumber::kValueOffset)); |
| 510 | 510 |
| 511 __ jmp(both_loaded_as_doubles); | 511 __ jmp(both_loaded_as_doubles); |
| 512 } | 512 } |
| 513 | 513 |
| 514 | 514 |
| 515 // Fast negative check for internalized-to-internalized equality. | 515 // Fast negative check for internalized-to-internalized equality. |
| 516 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, | 516 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, |
| 517 Register lhs, | 517 Register lhs, Register rhs, |
| 518 Register rhs, | |
| 519 Label* possible_strings, | 518 Label* possible_strings, |
| 520 Label* not_both_strings) { | 519 Label* runtime_call) { |
| 521 DCHECK((lhs.is(a0) && rhs.is(a1)) || | 520 DCHECK((lhs.is(a0) && rhs.is(a1)) || |
| 522 (lhs.is(a1) && rhs.is(a0))); | 521 (lhs.is(a1) && rhs.is(a0))); |
| 523 | 522 |
| 524 // a2 is object type of rhs. | 523 // a2 is object type of rhs. |
| 525 Label object_test; | 524 Label object_test, return_unequal, undetectable; |
| 526 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); | 525 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
| 527 __ And(at, a2, Operand(kIsNotStringMask)); | 526 __ And(at, a2, Operand(kIsNotStringMask)); |
| 528 __ Branch(&object_test, ne, at, Operand(zero_reg)); | 527 __ Branch(&object_test, ne, at, Operand(zero_reg)); |
| 529 __ And(at, a2, Operand(kIsNotInternalizedMask)); | 528 __ And(at, a2, Operand(kIsNotInternalizedMask)); |
| 530 __ Branch(possible_strings, ne, at, Operand(zero_reg)); | 529 __ Branch(possible_strings, ne, at, Operand(zero_reg)); |
| 531 __ GetObjectType(rhs, a3, a3); | 530 __ GetObjectType(rhs, a3, a3); |
| 532 __ Branch(not_both_strings, ge, a3, Operand(FIRST_NONSTRING_TYPE)); | 531 __ Branch(runtime_call, ge, a3, Operand(FIRST_NONSTRING_TYPE)); |
| 533 __ And(at, a3, Operand(kIsNotInternalizedMask)); | 532 __ And(at, a3, Operand(kIsNotInternalizedMask)); |
| 534 __ Branch(possible_strings, ne, at, Operand(zero_reg)); | 533 __ Branch(possible_strings, ne, at, Operand(zero_reg)); |
| 535 | 534 |
| 536 // Both are internalized strings. We already checked they weren't the same | 535 // Both are internalized. We already checked they weren't the same pointer so |
| 537 // pointer so they are not equal. | 536 // they are not equal. Return non-equal by returning the non-zero object |
| 537 // pointer in v0. |
| 538 __ Ret(USE_DELAY_SLOT); | 538 __ Ret(USE_DELAY_SLOT); |
| 539 __ li(v0, Operand(1)); // Non-zero indicates not equal. | 539 __ mov(v0, a0); // In delay slot. |
| 540 | 540 |
| 541 __ bind(&object_test); | 541 __ bind(&object_test); |
| 542 __ Branch(not_both_strings, lt, a2, Operand(FIRST_JS_RECEIVER_TYPE)); | 542 __ lw(a2, FieldMemOperand(lhs, HeapObject::kMapOffset)); |
| 543 __ GetObjectType(rhs, a2, a3); | 543 __ lw(a3, FieldMemOperand(rhs, HeapObject::kMapOffset)); |
| 544 __ Branch(not_both_strings, lt, a3, Operand(FIRST_JS_RECEIVER_TYPE)); | 544 __ lbu(t0, FieldMemOperand(a2, Map::kBitFieldOffset)); |
| 545 __ lbu(t1, FieldMemOperand(a3, Map::kBitFieldOffset)); |
| 546 __ And(at, t0, Operand(1 << Map::kIsUndetectable)); |
| 547 __ Branch(&undetectable, ne, at, Operand(zero_reg)); |
| 548 __ And(at, t1, Operand(1 << Map::kIsUndetectable)); |
| 549 __ Branch(&return_unequal, ne, at, Operand(zero_reg)); |
| 545 | 550 |
| 546 // If both objects are undetectable, they are equal. Otherwise, they | 551 __ GetInstanceType(a2, a2); |
| 547 // are not equal, since they are different objects and an object is not | 552 __ Branch(runtime_call, lt, a2, Operand(FIRST_JS_RECEIVER_TYPE)); |
| 548 // equal to undefined. | 553 __ GetInstanceType(a3, a3); |
| 549 __ lw(a3, FieldMemOperand(lhs, HeapObject::kMapOffset)); | 554 __ Branch(runtime_call, lt, a3, Operand(FIRST_JS_RECEIVER_TYPE)); |
| 550 __ lbu(a2, FieldMemOperand(a2, Map::kBitFieldOffset)); | 555 |
| 551 __ lbu(a3, FieldMemOperand(a3, Map::kBitFieldOffset)); | 556 __ bind(&return_unequal); |
| 552 __ and_(a0, a2, a3); | 557 // Return non-equal by returning the non-zero object pointer in v0. |
| 553 __ And(a0, a0, Operand(1 << Map::kIsUndetectable)); | |
| 554 __ Ret(USE_DELAY_SLOT); | 558 __ Ret(USE_DELAY_SLOT); |
| 555 __ xori(v0, a0, 1 << Map::kIsUndetectable); | 559 __ mov(v0, a0); // In delay slot. |
| 560 |
| 561 __ bind(&undetectable); |
| 562 __ And(at, t1, Operand(1 << Map::kIsUndetectable)); |
| 563 __ Branch(&return_unequal, eq, at, Operand(zero_reg)); |
| 564 __ Ret(USE_DELAY_SLOT); |
| 565 __ li(v0, Operand(EQUAL)); // In delay slot. |
| 556 } | 566 } |
| 557 | 567 |
| 558 | 568 |
| 559 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, | 569 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, |
| 560 Register scratch, | 570 Register scratch, |
| 561 CompareICState::State expected, | 571 CompareICState::State expected, |
| 562 Label* fail) { | 572 Label* fail) { |
| 563 Label ok; | 573 Label ok; |
| 564 if (expected == CompareICState::SMI) { | 574 if (expected == CompareICState::SMI) { |
| 565 __ JumpIfNotSmi(input, fail); | 575 __ JumpIfNotSmi(input, fail); |
| (...skipping 5164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5730 return_value_operand, NULL); | 5740 return_value_operand, NULL); |
| 5731 } | 5741 } |
| 5732 | 5742 |
| 5733 | 5743 |
| 5734 #undef __ | 5744 #undef __ |
| 5735 | 5745 |
| 5736 } // namespace internal | 5746 } // namespace internal |
| 5737 } // namespace v8 | 5747 } // namespace v8 |
| 5738 | 5748 |
| 5739 #endif // V8_TARGET_ARCH_MIPS | 5749 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |