OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
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 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 __ bne(slow); // First was a heap number, second wasn't. Go slow case. | 487 __ bne(slow); // First was a heap number, second wasn't. Go slow case. |
488 | 488 |
489 // Both are heap numbers. Load them up then jump to the code we have | 489 // Both are heap numbers. Load them up then jump to the code we have |
490 // for that. | 490 // for that. |
491 __ lfd(d6, FieldMemOperand(rhs, HeapNumber::kValueOffset)); | 491 __ lfd(d6, FieldMemOperand(rhs, HeapNumber::kValueOffset)); |
492 __ lfd(d7, FieldMemOperand(lhs, HeapNumber::kValueOffset)); | 492 __ lfd(d7, FieldMemOperand(lhs, HeapNumber::kValueOffset)); |
493 | 493 |
494 __ b(both_loaded_as_doubles); | 494 __ b(both_loaded_as_doubles); |
495 } | 495 } |
496 | 496 |
497 | 497 // Fast negative check for internalized-to-internalized equality or receiver |
498 // Fast negative check for internalized-to-internalized equality. | 498 // equality. Also handles the undetectable receiver to null/undefined |
| 499 // comparison. |
499 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, | 500 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, |
500 Register lhs, Register rhs, | 501 Register lhs, Register rhs, |
501 Label* possible_strings, | 502 Label* possible_strings, |
502 Label* runtime_call) { | 503 Label* runtime_call) { |
503 DCHECK((lhs.is(r3) && rhs.is(r4)) || (lhs.is(r4) && rhs.is(r3))); | 504 DCHECK((lhs.is(r3) && rhs.is(r4)) || (lhs.is(r4) && rhs.is(r3))); |
504 | 505 |
505 // r5 is object type of rhs. | 506 // r5 is object type of rhs. |
506 Label object_test, return_unequal, undetectable; | 507 Label object_test, return_equal, return_unequal, undetectable; |
507 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); | 508 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
508 __ andi(r0, r5, Operand(kIsNotStringMask)); | 509 __ andi(r0, r5, Operand(kIsNotStringMask)); |
509 __ bne(&object_test, cr0); | 510 __ bne(&object_test, cr0); |
510 __ andi(r0, r5, Operand(kIsNotInternalizedMask)); | 511 __ andi(r0, r5, Operand(kIsNotInternalizedMask)); |
511 __ bne(possible_strings, cr0); | 512 __ bne(possible_strings, cr0); |
512 __ CompareObjectType(lhs, r6, r6, FIRST_NONSTRING_TYPE); | 513 __ CompareObjectType(lhs, r6, r6, FIRST_NONSTRING_TYPE); |
513 __ bge(runtime_call); | 514 __ bge(runtime_call); |
514 __ andi(r0, r6, Operand(kIsNotInternalizedMask)); | 515 __ andi(r0, r6, Operand(kIsNotInternalizedMask)); |
515 __ bne(possible_strings, cr0); | 516 __ bne(possible_strings, cr0); |
516 | 517 |
(...skipping 17 matching lines...) Expand all Loading... |
534 __ CompareInstanceType(r6, r6, FIRST_JS_RECEIVER_TYPE); | 535 __ CompareInstanceType(r6, r6, FIRST_JS_RECEIVER_TYPE); |
535 __ blt(runtime_call); | 536 __ blt(runtime_call); |
536 | 537 |
537 __ bind(&return_unequal); | 538 __ bind(&return_unequal); |
538 // Return non-equal by returning the non-zero object pointer in r3. | 539 // Return non-equal by returning the non-zero object pointer in r3. |
539 __ Ret(); | 540 __ Ret(); |
540 | 541 |
541 __ bind(&undetectable); | 542 __ bind(&undetectable); |
542 __ andi(r0, r8, Operand(1 << Map::kIsUndetectable)); | 543 __ andi(r0, r8, Operand(1 << Map::kIsUndetectable)); |
543 __ beq(&return_unequal, cr0); | 544 __ beq(&return_unequal, cr0); |
| 545 |
| 546 // If both sides are JSReceivers, then the result is false according to |
| 547 // the HTML specification, which says that only comparisons with null or |
| 548 // undefined are affected by special casing for document.all. |
| 549 __ CompareInstanceType(r5, r5, ODDBALL_TYPE); |
| 550 __ beq(&return_equal); |
| 551 __ CompareInstanceType(r6, r6, ODDBALL_TYPE); |
| 552 __ bne(&return_unequal); |
| 553 |
| 554 __ bind(&return_equal); |
544 __ li(r3, Operand(EQUAL)); | 555 __ li(r3, Operand(EQUAL)); |
545 __ Ret(); | 556 __ Ret(); |
546 } | 557 } |
547 | 558 |
548 | 559 |
549 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, | 560 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, |
550 Register scratch, | 561 Register scratch, |
551 CompareICState::State expected, | 562 CompareICState::State expected, |
552 Label* fail) { | 563 Label* fail) { |
553 Label ok; | 564 Label ok; |
(...skipping 5244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5798 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, | 5809 CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, |
5799 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5810 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5800 } | 5811 } |
5801 | 5812 |
5802 | 5813 |
5803 #undef __ | 5814 #undef __ |
5804 } // namespace internal | 5815 } // namespace internal |
5805 } // namespace v8 | 5816 } // namespace v8 |
5806 | 5817 |
5807 #endif // V8_TARGET_ARCH_PPC | 5818 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |