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_ARM | 5 #if V8_TARGET_ARCH_ARM |
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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 __ b(ne, slow); // First was a heap number, second wasn't. Go slow case. | 470 __ b(ne, slow); // First was a heap number, second wasn't. Go slow case. |
471 | 471 |
472 // Both are heap numbers. Load them up then jump to the code we have | 472 // Both are heap numbers. Load them up then jump to the code we have |
473 // for that. | 473 // for that. |
474 __ vldr(d6, rhs, HeapNumber::kValueOffset - kHeapObjectTag); | 474 __ vldr(d6, rhs, HeapNumber::kValueOffset - kHeapObjectTag); |
475 __ vldr(d7, lhs, HeapNumber::kValueOffset - kHeapObjectTag); | 475 __ vldr(d7, lhs, HeapNumber::kValueOffset - kHeapObjectTag); |
476 __ jmp(both_loaded_as_doubles); | 476 __ jmp(both_loaded_as_doubles); |
477 } | 477 } |
478 | 478 |
479 | 479 |
480 // Fast negative check for internalized-to-internalized equality. | 480 // Fast negative check for internalized-to-internalized equality or receiver |
| 481 // equality. Also handles the undetectable receiver to null/undefined |
| 482 // comparison. |
481 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, | 483 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, |
482 Register lhs, Register rhs, | 484 Register lhs, Register rhs, |
483 Label* possible_strings, | 485 Label* possible_strings, |
484 Label* runtime_call) { | 486 Label* runtime_call) { |
485 DCHECK((lhs.is(r0) && rhs.is(r1)) || | 487 DCHECK((lhs.is(r0) && rhs.is(r1)) || |
486 (lhs.is(r1) && rhs.is(r0))); | 488 (lhs.is(r1) && rhs.is(r0))); |
487 | 489 |
488 // r2 is object type of rhs. | 490 // r2 is object type of rhs. |
489 Label object_test, return_unequal, undetectable; | 491 Label object_test, return_equal, return_unequal, undetectable; |
490 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); | 492 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
491 __ tst(r2, Operand(kIsNotStringMask)); | 493 __ tst(r2, Operand(kIsNotStringMask)); |
492 __ b(ne, &object_test); | 494 __ b(ne, &object_test); |
493 __ tst(r2, Operand(kIsNotInternalizedMask)); | 495 __ tst(r2, Operand(kIsNotInternalizedMask)); |
494 __ b(ne, possible_strings); | 496 __ b(ne, possible_strings); |
495 __ CompareObjectType(lhs, r3, r3, FIRST_NONSTRING_TYPE); | 497 __ CompareObjectType(lhs, r3, r3, FIRST_NONSTRING_TYPE); |
496 __ b(ge, runtime_call); | 498 __ b(ge, runtime_call); |
497 __ tst(r3, Operand(kIsNotInternalizedMask)); | 499 __ tst(r3, Operand(kIsNotInternalizedMask)); |
498 __ b(ne, possible_strings); | 500 __ b(ne, possible_strings); |
499 | 501 |
(...skipping 17 matching lines...) Expand all Loading... |
517 __ CompareInstanceType(r3, r3, FIRST_JS_RECEIVER_TYPE); | 519 __ CompareInstanceType(r3, r3, FIRST_JS_RECEIVER_TYPE); |
518 __ b(lt, runtime_call); | 520 __ b(lt, runtime_call); |
519 | 521 |
520 __ bind(&return_unequal); | 522 __ bind(&return_unequal); |
521 // Return non-equal by returning the non-zero object pointer in r0. | 523 // Return non-equal by returning the non-zero object pointer in r0. |
522 __ Ret(); | 524 __ Ret(); |
523 | 525 |
524 __ bind(&undetectable); | 526 __ bind(&undetectable); |
525 __ tst(r5, Operand(1 << Map::kIsUndetectable)); | 527 __ tst(r5, Operand(1 << Map::kIsUndetectable)); |
526 __ b(eq, &return_unequal); | 528 __ b(eq, &return_unequal); |
| 529 |
| 530 // If both sides are JSReceivers, then the result is false according to |
| 531 // the HTML specification, which says that only comparisons with null or |
| 532 // undefined are affected by special casing for document.all. |
| 533 __ CompareInstanceType(r2, r2, ODDBALL_TYPE); |
| 534 __ b(eq, &return_equal); |
| 535 __ CompareInstanceType(r3, r3, ODDBALL_TYPE); |
| 536 __ b(ne, &return_unequal); |
| 537 |
| 538 __ bind(&return_equal); |
527 __ mov(r0, Operand(EQUAL)); | 539 __ mov(r0, Operand(EQUAL)); |
528 __ Ret(); | 540 __ Ret(); |
529 } | 541 } |
530 | 542 |
531 | 543 |
532 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, | 544 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, |
533 Register scratch, | 545 Register scratch, |
534 CompareICState::State expected, | 546 CompareICState::State expected, |
535 Label* fail) { | 547 Label* fail) { |
536 Label ok; | 548 Label ok; |
(...skipping 5054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5591 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5603 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5592 } | 5604 } |
5593 | 5605 |
5594 | 5606 |
5595 #undef __ | 5607 #undef __ |
5596 | 5608 |
5597 } // namespace internal | 5609 } // namespace internal |
5598 } // namespace v8 | 5610 } // namespace v8 |
5599 | 5611 |
5600 #endif // V8_TARGET_ARCH_ARM | 5612 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |