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 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/ic/handler-compiler.h" | 10 #include "src/ic/handler-compiler.h" |
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 // for that. | 503 // for that. |
504 __ ldc1(f12, FieldMemOperand(lhs, HeapNumber::kValueOffset)); | 504 __ ldc1(f12, FieldMemOperand(lhs, HeapNumber::kValueOffset)); |
505 __ ldc1(f14, FieldMemOperand(rhs, HeapNumber::kValueOffset)); | 505 __ ldc1(f14, FieldMemOperand(rhs, HeapNumber::kValueOffset)); |
506 | 506 |
507 __ jmp(both_loaded_as_doubles); | 507 __ jmp(both_loaded_as_doubles); |
508 } | 508 } |
509 | 509 |
510 | 510 |
511 // Fast negative check for internalized-to-internalized equality. | 511 // Fast negative check for internalized-to-internalized equality. |
512 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, | 512 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, |
513 Register lhs, | 513 Register lhs, Register rhs, |
514 Register rhs, | |
515 Label* possible_strings, | 514 Label* possible_strings, |
516 Label* not_both_strings) { | 515 Label* runtime_call) { |
517 DCHECK((lhs.is(a0) && rhs.is(a1)) || | 516 DCHECK((lhs.is(a0) && rhs.is(a1)) || |
518 (lhs.is(a1) && rhs.is(a0))); | 517 (lhs.is(a1) && rhs.is(a0))); |
519 | 518 |
520 // a2 is object type of rhs. | 519 // a2 is object type of rhs. |
521 Label object_test; | 520 Label object_test, return_unequal, undetectable; |
522 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); | 521 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
523 __ And(at, a2, Operand(kIsNotStringMask)); | 522 __ And(at, a2, Operand(kIsNotStringMask)); |
524 __ Branch(&object_test, ne, at, Operand(zero_reg)); | 523 __ Branch(&object_test, ne, at, Operand(zero_reg)); |
525 __ And(at, a2, Operand(kIsNotInternalizedMask)); | 524 __ And(at, a2, Operand(kIsNotInternalizedMask)); |
526 __ Branch(possible_strings, ne, at, Operand(zero_reg)); | 525 __ Branch(possible_strings, ne, at, Operand(zero_reg)); |
527 __ GetObjectType(rhs, a3, a3); | 526 __ GetObjectType(rhs, a3, a3); |
528 __ Branch(not_both_strings, ge, a3, Operand(FIRST_NONSTRING_TYPE)); | 527 __ Branch(runtime_call, ge, a3, Operand(FIRST_NONSTRING_TYPE)); |
529 __ And(at, a3, Operand(kIsNotInternalizedMask)); | 528 __ And(at, a3, Operand(kIsNotInternalizedMask)); |
530 __ Branch(possible_strings, ne, at, Operand(zero_reg)); | 529 __ Branch(possible_strings, ne, at, Operand(zero_reg)); |
531 | 530 |
532 // Both are internalized strings. We already checked they weren't the same | 531 // Both are internalized. We already checked they weren't the same pointer so |
533 // pointer so they are not equal. | 532 // they are not equal. Return non-equal by returning the non-zero object |
| 533 // pointer in v0. |
534 __ Ret(USE_DELAY_SLOT); | 534 __ Ret(USE_DELAY_SLOT); |
535 __ li(v0, Operand(1)); // Non-zero indicates not equal. | 535 __ mov(v0, a0); // In delay slot. |
536 | 536 |
537 __ bind(&object_test); | 537 __ bind(&object_test); |
538 __ Branch(not_both_strings, lt, a2, Operand(FIRST_JS_RECEIVER_TYPE)); | 538 __ ld(a2, FieldMemOperand(lhs, HeapObject::kMapOffset)); |
539 __ GetObjectType(rhs, a2, a3); | 539 __ ld(a3, FieldMemOperand(rhs, HeapObject::kMapOffset)); |
540 __ Branch(not_both_strings, lt, a3, Operand(FIRST_JS_RECEIVER_TYPE)); | 540 __ lbu(t0, FieldMemOperand(a2, Map::kBitFieldOffset)); |
| 541 __ lbu(t1, FieldMemOperand(a3, Map::kBitFieldOffset)); |
| 542 __ And(at, t0, Operand(1 << Map::kIsUndetectable)); |
| 543 __ Branch(&undetectable, ne, at, Operand(zero_reg)); |
| 544 __ And(at, t1, Operand(1 << Map::kIsUndetectable)); |
| 545 __ Branch(&return_unequal, ne, at, Operand(zero_reg)); |
541 | 546 |
542 // If both objects are undetectable, they are equal. Otherwise, they | 547 __ GetInstanceType(a2, a2); |
543 // are not equal, since they are different objects and an object is not | 548 __ Branch(runtime_call, lt, a2, Operand(FIRST_JS_RECEIVER_TYPE)); |
544 // equal to undefined. | 549 __ GetInstanceType(a3, a3); |
545 __ ld(a3, FieldMemOperand(lhs, HeapObject::kMapOffset)); | 550 __ Branch(runtime_call, lt, a3, Operand(FIRST_JS_RECEIVER_TYPE)); |
546 __ lbu(a2, FieldMemOperand(a2, Map::kBitFieldOffset)); | 551 |
547 __ lbu(a3, FieldMemOperand(a3, Map::kBitFieldOffset)); | 552 __ bind(&return_unequal); |
548 __ and_(a0, a2, a3); | 553 // Return non-equal by returning the non-zero object pointer in v0. |
549 __ And(a0, a0, Operand(1 << Map::kIsUndetectable)); | |
550 __ Ret(USE_DELAY_SLOT); | 554 __ Ret(USE_DELAY_SLOT); |
551 __ xori(v0, a0, 1 << Map::kIsUndetectable); | 555 __ mov(v0, a0); // In delay slot. |
| 556 |
| 557 __ bind(&undetectable); |
| 558 __ And(at, t1, Operand(1 << Map::kIsUndetectable)); |
| 559 __ Branch(&return_unequal, eq, at, Operand(zero_reg)); |
| 560 __ Ret(USE_DELAY_SLOT); |
| 561 __ li(v0, Operand(EQUAL)); // In delay slot. |
552 } | 562 } |
553 | 563 |
554 | 564 |
555 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, | 565 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, |
556 Register scratch, | 566 Register scratch, |
557 CompareICState::State expected, | 567 CompareICState::State expected, |
558 Label* fail) { | 568 Label* fail) { |
559 Label ok; | 569 Label ok; |
560 if (expected == CompareICState::SMI) { | 570 if (expected == CompareICState::SMI) { |
561 __ JumpIfNotSmi(input, fail); | 571 __ JumpIfNotSmi(input, fail); |
(...skipping 5194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5756 return_value_operand, NULL); | 5766 return_value_operand, NULL); |
5757 } | 5767 } |
5758 | 5768 |
5759 | 5769 |
5760 #undef __ | 5770 #undef __ |
5761 | 5771 |
5762 } // namespace internal | 5772 } // namespace internal |
5763 } // namespace v8 | 5773 } // namespace v8 |
5764 | 5774 |
5765 #endif // V8_TARGET_ARCH_MIPS64 | 5775 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |