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. |
Jarin
2016/03/09 08:09:32
Please update the comment to describe what the fun
Benedikt Meurer
2016/03/09 09:51:11
Done.
| |
481 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, | 481 static void EmitCheckForInternalizedStringsOrObjects(MacroAssembler* masm, |
482 Register lhs, Register rhs, | 482 Register lhs, Register rhs, |
483 Label* possible_strings, | 483 Label* possible_strings, |
484 Label* runtime_call) { | 484 Label* runtime_call) { |
485 DCHECK((lhs.is(r0) && rhs.is(r1)) || | 485 DCHECK((lhs.is(r0) && rhs.is(r1)) || |
486 (lhs.is(r1) && rhs.is(r0))); | 486 (lhs.is(r1) && rhs.is(r0))); |
487 | 487 |
488 // r2 is object type of rhs. | 488 // r2 is object type of rhs. |
489 Label object_test, return_unequal, undetectable; | 489 Label object_test, return_equal, return_unequal, undetectable; |
490 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); | 490 STATIC_ASSERT(kInternalizedTag == 0 && kStringTag == 0); |
491 __ tst(r2, Operand(kIsNotStringMask)); | 491 __ tst(r2, Operand(kIsNotStringMask)); |
492 __ b(ne, &object_test); | 492 __ b(ne, &object_test); |
493 __ tst(r2, Operand(kIsNotInternalizedMask)); | 493 __ tst(r2, Operand(kIsNotInternalizedMask)); |
494 __ b(ne, possible_strings); | 494 __ b(ne, possible_strings); |
495 __ CompareObjectType(lhs, r3, r3, FIRST_NONSTRING_TYPE); | 495 __ CompareObjectType(lhs, r3, r3, FIRST_NONSTRING_TYPE); |
496 __ b(ge, runtime_call); | 496 __ b(ge, runtime_call); |
497 __ tst(r3, Operand(kIsNotInternalizedMask)); | 497 __ tst(r3, Operand(kIsNotInternalizedMask)); |
498 __ b(ne, possible_strings); | 498 __ b(ne, possible_strings); |
499 | 499 |
(...skipping 17 matching lines...) Expand all Loading... | |
517 __ CompareInstanceType(r3, r3, FIRST_JS_RECEIVER_TYPE); | 517 __ CompareInstanceType(r3, r3, FIRST_JS_RECEIVER_TYPE); |
518 __ b(lt, runtime_call); | 518 __ b(lt, runtime_call); |
519 | 519 |
520 __ bind(&return_unequal); | 520 __ bind(&return_unequal); |
521 // Return non-equal by returning the non-zero object pointer in r0. | 521 // Return non-equal by returning the non-zero object pointer in r0. |
522 __ Ret(); | 522 __ Ret(); |
523 | 523 |
524 __ bind(&undetectable); | 524 __ bind(&undetectable); |
525 __ tst(r5, Operand(1 << Map::kIsUndetectable)); | 525 __ tst(r5, Operand(1 << Map::kIsUndetectable)); |
526 __ b(eq, &return_unequal); | 526 __ b(eq, &return_unequal); |
527 | |
528 // If both sides are JSReceivers, then the result is false according to | |
529 // the HTML specification, which says that only comparisons with null or | |
530 // undefined are affected by special casing for document.all. | |
531 __ CompareInstanceType(r2, r2, ODDBALL_TYPE); | |
532 __ b(eq, &return_equal); | |
533 __ CompareInstanceType(r3, r3, ODDBALL_TYPE); | |
534 __ b(ne, &return_unequal); | |
535 | |
536 __ bind(&return_equal); | |
527 __ mov(r0, Operand(EQUAL)); | 537 __ mov(r0, Operand(EQUAL)); |
528 __ Ret(); | 538 __ Ret(); |
529 } | 539 } |
530 | 540 |
531 | 541 |
532 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, | 542 static void CompareICStub_CheckInputType(MacroAssembler* masm, Register input, |
533 Register scratch, | 543 Register scratch, |
534 CompareICState::State expected, | 544 CompareICState::State expected, |
535 Label* fail) { | 545 Label* fail) { |
536 Label ok; | 546 Label ok; |
(...skipping 5054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5591 kStackUnwindSpace, NULL, return_value_operand, NULL); | 5601 kStackUnwindSpace, NULL, return_value_operand, NULL); |
5592 } | 5602 } |
5593 | 5603 |
5594 | 5604 |
5595 #undef __ | 5605 #undef __ |
5596 | 5606 |
5597 } // namespace internal | 5607 } // namespace internal |
5598 } // namespace v8 | 5608 } // namespace v8 |
5599 | 5609 |
5600 #endif // V8_TARGET_ARCH_ARM | 5610 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |