| 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 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 | 499 |
| 500 // Fast negative check for internalized-to-internalized equality. | 500 // Fast negative check for internalized-to-internalized equality. |
| 501 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, | 501 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, |
| 502 Register lhs, Register rhs, | 502 Register lhs, Register rhs, |
| 503 Label* possible_strings, | 503 Label* possible_strings, |
| 504 Label* runtime_call) { | 504 Label* runtime_call) { |
| 505 DCHECK((lhs.is(a0) && rhs.is(a1)) || | 505 DCHECK((lhs.is(a0) && rhs.is(a1)) || |
| 506 (lhs.is(a1) && rhs.is(a0))); | 506 (lhs.is(a1) && rhs.is(a0))); |
| 507 | 507 |
| 508 // a2 is object type of rhs. | 508 // a2 is object type of rhs. |
| 509 Label object_test, return_unequal, undetectable; | 509 Label object_test, return_equal, return_unequal, undetectable; |
| 510 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); | 510 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
| 511 __ And(at, a2, Operand(kIsNotStringMask)); | 511 __ And(at, a2, Operand(kIsNotStringMask)); |
| 512 __ Branch(&object_test, ne, at, Operand(zero_reg)); | 512 __ Branch(&object_test, ne, at, Operand(zero_reg)); |
| 513 __ And(at, a2, Operand(kIsNotInternalizedMask)); | 513 __ And(at, a2, Operand(kIsNotInternalizedMask)); |
| 514 __ Branch(possible_strings, ne, at, Operand(zero_reg)); | 514 __ Branch(possible_strings, ne, at, Operand(zero_reg)); |
| 515 __ GetObjectType(rhs, a3, a3); | 515 __ GetObjectType(rhs, a3, a3); |
| 516 __ Branch(runtime_call, ge, a3, Operand(FIRST_NONSTRING_TYPE)); | 516 __ Branch(runtime_call, ge, a3, Operand(FIRST_NONSTRING_TYPE)); |
| 517 __ And(at, a3, Operand(kIsNotInternalizedMask)); | 517 __ And(at, a3, Operand(kIsNotInternalizedMask)); |
| 518 __ Branch(possible_strings, ne, at, Operand(zero_reg)); | 518 __ Branch(possible_strings, ne, at, Operand(zero_reg)); |
| 519 | 519 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 539 __ Branch(runtime_call, lt, a3, Operand(FIRST_JS_RECEIVER_TYPE)); | 539 __ Branch(runtime_call, lt, a3, Operand(FIRST_JS_RECEIVER_TYPE)); |
| 540 | 540 |
| 541 __ bind(&return_unequal); | 541 __ bind(&return_unequal); |
| 542 // Return non-equal by returning the non-zero object pointer in v0. | 542 // Return non-equal by returning the non-zero object pointer in v0. |
| 543 __ Ret(USE_DELAY_SLOT); | 543 __ Ret(USE_DELAY_SLOT); |
| 544 __ mov(v0, a0); // In delay slot. | 544 __ mov(v0, a0); // In delay slot. |
| 545 | 545 |
| 546 __ bind(&undetectable); | 546 __ bind(&undetectable); |
| 547 __ And(at, t1, Operand(1 << Map::kIsUndetectable)); | 547 __ And(at, t1, Operand(1 << Map::kIsUndetectable)); |
| 548 __ Branch(&return_unequal, eq, at, Operand(zero_reg)); | 548 __ Branch(&return_unequal, eq, at, Operand(zero_reg)); |
| 549 |
| 550 // If both sides are JSReceivers, then the result is false according to |
| 551 // the HTML specification, which says that only comparisons with null or |
| 552 // undefined are affected by special casing for document.all. |
| 553 __ GetInstanceType(a2, a2); |
| 554 __ Branch(&return_equal, eq, a2, Operand(ODDBALL_TYPE)); |
| 555 __ GetInstanceType(a3, a3); |
| 556 __ Branch(&return_unequal, ne, a3, Operand(ODDBALL_TYPE)); |
| 557 |
| 558 __ bind(&return_equal); |
| 549 __ Ret(USE_DELAY_SLOT); | 559 __ Ret(USE_DELAY_SLOT); |
| 550 __ li(v0, Operand(EQUAL)); // In delay slot. | 560 __ li(v0, Operand(EQUAL)); // In delay slot. |
| 551 } | 561 } |
| 552 | 562 |
| 553 | 563 |
| 554 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, | 564 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, |
| 555 Register scratch, | 565 Register scratch, |
| 556 CompareICState::State expected, | 566 CompareICState::State expected, |
| 557 Label* fail) { | 567 Label* fail) { |
| 558 Label ok; | 568 Label ok; |
| (...skipping 5210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5769 return_value_operand, NULL); | 5779 return_value_operand, NULL); |
| 5770 } | 5780 } |
| 5771 | 5781 |
| 5772 | 5782 |
| 5773 #undef __ | 5783 #undef __ |
| 5774 | 5784 |
| 5775 } // namespace internal | 5785 } // namespace internal |
| 5776 } // namespace v8 | 5786 } // namespace v8 |
| 5777 | 5787 |
| 5778 #endif // V8_TARGET_ARCH_MIPS | 5788 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |