OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
7 | 7 |
8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
9 | 9 |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 | 158 |
159 | 159 |
160 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 160 void IfThenElseInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
161 ASSERT(locs()->out(0).reg() == RDX); | 161 ASSERT(locs()->out(0).reg() == RDX); |
162 | 162 |
163 // Clear upper part of the out register. We are going to use setcc on it | 163 // Clear upper part of the out register. We are going to use setcc on it |
164 // which is a byte move. | 164 // which is a byte move. |
165 __ xorq(RDX, RDX); | 165 __ xorq(RDX, RDX); |
166 | 166 |
167 // Emit comparison code. This must not overwrite the result register. | 167 // Emit comparison code. This must not overwrite the result register. |
| 168 // IfThenElseInstr::Supports() should prevent EmitComparisonCode from using |
| 169 // the labels or returning an invalid condition. |
168 BranchLabels labels = {NULL, NULL, NULL}; | 170 BranchLabels labels = {NULL, NULL, NULL}; |
169 Condition true_condition = comparison()->EmitComparisonCode(compiler, labels); | 171 Condition true_condition = comparison()->EmitComparisonCode(compiler, labels); |
| 172 ASSERT(true_condition != INVALID_CONDITION); |
170 | 173 |
171 const bool is_power_of_two_kind = IsPowerOfTwoKind(if_true_, if_false_); | 174 const bool is_power_of_two_kind = IsPowerOfTwoKind(if_true_, if_false_); |
172 | 175 |
173 intptr_t true_value = if_true_; | 176 intptr_t true_value = if_true_; |
174 intptr_t false_value = if_false_; | 177 intptr_t false_value = if_false_; |
175 | 178 |
176 if (is_power_of_two_kind) { | 179 if (is_power_of_two_kind) { |
177 if (true_value == 0) { | 180 if (true_value == 0) { |
178 // We need to have zero in RDX on true_condition. | 181 // We need to have zero in RDX on true_condition. |
179 true_condition = NegateCondition(true_condition); | 182 true_condition = NegateCondition(true_condition); |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 BranchLabels labels) { | 569 BranchLabels labels) { |
567 if ((operation_cid() == kSmiCid) || (operation_cid() == kMintCid)) { | 570 if ((operation_cid() == kSmiCid) || (operation_cid() == kMintCid)) { |
568 return EmitInt64ComparisonOp(compiler, *locs(), kind()); | 571 return EmitInt64ComparisonOp(compiler, *locs(), kind()); |
569 } else { | 572 } else { |
570 ASSERT(operation_cid() == kDoubleCid); | 573 ASSERT(operation_cid() == kDoubleCid); |
571 return EmitDoubleComparisonOp(compiler, *locs(), kind(), labels); | 574 return EmitDoubleComparisonOp(compiler, *locs(), kind(), labels); |
572 } | 575 } |
573 } | 576 } |
574 | 577 |
575 | 578 |
576 void EqualityCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 579 void ComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
577 ASSERT((kind() == Token::kEQ) || (kind() == Token::kNE)); | |
578 | |
579 Label is_true, is_false; | 580 Label is_true, is_false; |
580 BranchLabels labels = {&is_true, &is_false, &is_false}; | 581 BranchLabels labels = {&is_true, &is_false, &is_false}; |
581 Condition true_condition = EmitComparisonCode(compiler, labels); | 582 Condition true_condition = EmitComparisonCode(compiler, labels); |
582 EmitBranchOnCondition(compiler, true_condition, labels); | 583 if (true_condition != INVALID_CONDITION) { |
| 584 EmitBranchOnCondition(compiler, true_condition, labels); |
| 585 } |
583 | 586 |
584 Register result = locs()->out(0).reg(); | 587 Register result = locs()->out(0).reg(); |
585 Label done; | 588 Label done; |
586 __ Bind(&is_false); | 589 __ Bind(&is_false); |
587 __ LoadObject(result, Bool::False()); | 590 __ LoadObject(result, Bool::False()); |
588 __ jmp(&done); | 591 __ jmp(&done); |
589 __ Bind(&is_true); | 592 __ Bind(&is_true); |
590 __ LoadObject(result, Bool::True()); | 593 __ LoadObject(result, Bool::True()); |
591 __ Bind(&done); | 594 __ Bind(&done); |
592 } | 595 } |
593 | 596 |
594 | 597 |
595 void EqualityCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 598 void ComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
596 BranchInstr* branch) { | 599 BranchInstr* branch) { |
597 ASSERT((kind() == Token::kNE) || (kind() == Token::kEQ)); | |
598 | |
599 BranchLabels labels = compiler->CreateBranchLabels(branch); | 600 BranchLabels labels = compiler->CreateBranchLabels(branch); |
600 Condition true_condition = EmitComparisonCode(compiler, labels); | 601 Condition true_condition = EmitComparisonCode(compiler, labels); |
601 EmitBranchOnCondition(compiler, true_condition, labels); | 602 if (true_condition != INVALID_CONDITION) { |
| 603 EmitBranchOnCondition(compiler, true_condition, labels); |
| 604 } |
602 } | 605 } |
603 | 606 |
604 | 607 |
605 LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, bool opt) const { | 608 LocationSummary* TestSmiInstr::MakeLocationSummary(Zone* zone, bool opt) const { |
606 const intptr_t kNumInputs = 2; | 609 const intptr_t kNumInputs = 2; |
607 const intptr_t kNumTemps = 0; | 610 const intptr_t kNumTemps = 0; |
608 LocationSummary* locs = new (zone) | 611 LocationSummary* locs = new (zone) |
609 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 612 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
610 locs->set_in(0, Location::RequiresRegister()); | 613 locs->set_in(0, Location::RequiresRegister()); |
611 // Only one input can be a constant operand. The case of two constant | 614 // Only one input can be a constant operand. The case of two constant |
(...skipping 12 matching lines...) Expand all Loading... |
624 const int64_t imm = reinterpret_cast<int64_t>(right.constant().raw()); | 627 const int64_t imm = reinterpret_cast<int64_t>(right.constant().raw()); |
625 __ TestImmediate(left_reg, Immediate(imm)); | 628 __ TestImmediate(left_reg, Immediate(imm)); |
626 } else { | 629 } else { |
627 __ testq(left_reg, right.reg()); | 630 __ testq(left_reg, right.reg()); |
628 } | 631 } |
629 Condition true_condition = (kind() == Token::kNE) ? NOT_ZERO : ZERO; | 632 Condition true_condition = (kind() == Token::kNE) ? NOT_ZERO : ZERO; |
630 return true_condition; | 633 return true_condition; |
631 } | 634 } |
632 | 635 |
633 | 636 |
634 void TestSmiInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
635 // Never emitted outside of the BranchInstr. | |
636 UNREACHABLE(); | |
637 } | |
638 | |
639 | |
640 void TestSmiInstr::EmitBranchCode(FlowGraphCompiler* compiler, | |
641 BranchInstr* branch) { | |
642 BranchLabels labels = compiler->CreateBranchLabels(branch); | |
643 Condition true_condition = EmitComparisonCode(compiler, labels); | |
644 EmitBranchOnCondition(compiler, true_condition, labels); | |
645 } | |
646 | |
647 | |
648 LocationSummary* TestCidsInstr::MakeLocationSummary(Zone* zone, | 637 LocationSummary* TestCidsInstr::MakeLocationSummary(Zone* zone, |
649 bool opt) const { | 638 bool opt) const { |
650 const intptr_t kNumInputs = 1; | 639 const intptr_t kNumInputs = 1; |
651 const intptr_t kNumTemps = 1; | 640 const intptr_t kNumTemps = 1; |
652 LocationSummary* locs = new (zone) | 641 LocationSummary* locs = new (zone) |
653 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 642 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
654 locs->set_in(0, Location::RequiresRegister()); | 643 locs->set_in(0, Location::RequiresRegister()); |
655 locs->set_temp(0, Location::RequiresRegister()); | 644 locs->set_temp(0, Location::RequiresRegister()); |
656 locs->set_out(0, Location::RequiresRegister()); | 645 locs->set_out(0, Location::RequiresRegister()); |
657 return locs; | 646 return locs; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 // If the cid is not in the list, jump to the opposite label from the cids | 678 // If the cid is not in the list, jump to the opposite label from the cids |
690 // that are in the list. These must be all the same (see asserts in the | 679 // that are in the list. These must be all the same (see asserts in the |
691 // constructor). | 680 // constructor). |
692 Label* target = result ? labels.false_label : labels.true_label; | 681 Label* target = result ? labels.false_label : labels.true_label; |
693 if (target != labels.fall_through) { | 682 if (target != labels.fall_through) { |
694 __ jmp(target); | 683 __ jmp(target); |
695 } | 684 } |
696 } else { | 685 } else { |
697 __ jmp(deopt); | 686 __ jmp(deopt); |
698 } | 687 } |
699 // Dummy result as the last instruction is a jump, any conditional | 688 // Dummy result as this method already did the jump, there's no need |
700 // branch using the result will therefore be skipped. | 689 // for the caller to branch on a condition. |
701 return ZERO; | 690 return INVALID_CONDITION; |
702 } | 691 } |
703 | 692 |
704 | 693 |
705 void TestCidsInstr::EmitBranchCode(FlowGraphCompiler* compiler, | |
706 BranchInstr* branch) { | |
707 BranchLabels labels = compiler->CreateBranchLabels(branch); | |
708 EmitComparisonCode(compiler, labels); | |
709 } | |
710 | |
711 | |
712 void TestCidsInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
713 Register result_reg = locs()->out(0).reg(); | |
714 Label is_true, is_false, done; | |
715 BranchLabels labels = {&is_true, &is_false, &is_false}; | |
716 EmitComparisonCode(compiler, labels); | |
717 __ Bind(&is_false); | |
718 __ LoadObject(result_reg, Bool::False()); | |
719 __ jmp(&done, Assembler::kNearJump); | |
720 __ Bind(&is_true); | |
721 __ LoadObject(result_reg, Bool::True()); | |
722 __ Bind(&done); | |
723 } | |
724 | |
725 | |
726 LocationSummary* RelationalOpInstr::MakeLocationSummary(Zone* zone, | 694 LocationSummary* RelationalOpInstr::MakeLocationSummary(Zone* zone, |
727 bool opt) const { | 695 bool opt) const { |
728 const intptr_t kNumInputs = 2; | 696 const intptr_t kNumInputs = 2; |
729 const intptr_t kNumTemps = 0; | 697 const intptr_t kNumTemps = 0; |
730 if (operation_cid() == kDoubleCid) { | 698 if (operation_cid() == kDoubleCid) { |
731 LocationSummary* summary = new (zone) | 699 LocationSummary* summary = new (zone) |
732 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 700 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
733 summary->set_in(0, Location::RequiresFpuRegister()); | 701 summary->set_in(0, Location::RequiresFpuRegister()); |
734 summary->set_in(1, Location::RequiresFpuRegister()); | 702 summary->set_in(1, Location::RequiresFpuRegister()); |
735 summary->set_out(0, Location::RequiresRegister()); | 703 summary->set_out(0, Location::RequiresRegister()); |
(...skipping 24 matching lines...) Expand all Loading... |
760 BranchLabels labels) { | 728 BranchLabels labels) { |
761 if ((operation_cid() == kSmiCid) || (operation_cid() == kMintCid)) { | 729 if ((operation_cid() == kSmiCid) || (operation_cid() == kMintCid)) { |
762 return EmitInt64ComparisonOp(compiler, *locs(), kind()); | 730 return EmitInt64ComparisonOp(compiler, *locs(), kind()); |
763 } else { | 731 } else { |
764 ASSERT(operation_cid() == kDoubleCid); | 732 ASSERT(operation_cid() == kDoubleCid); |
765 return EmitDoubleComparisonOp(compiler, *locs(), kind(), labels); | 733 return EmitDoubleComparisonOp(compiler, *locs(), kind(), labels); |
766 } | 734 } |
767 } | 735 } |
768 | 736 |
769 | 737 |
770 void RelationalOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
771 Label is_true, is_false; | |
772 BranchLabels labels = {&is_true, &is_false, &is_false}; | |
773 Condition true_condition = EmitComparisonCode(compiler, labels); | |
774 EmitBranchOnCondition(compiler, true_condition, labels); | |
775 | |
776 Register result = locs()->out(0).reg(); | |
777 Label done; | |
778 __ Bind(&is_false); | |
779 __ LoadObject(result, Bool::False()); | |
780 __ jmp(&done); | |
781 __ Bind(&is_true); | |
782 __ LoadObject(result, Bool::True()); | |
783 __ Bind(&done); | |
784 } | |
785 | |
786 | |
787 void RelationalOpInstr::EmitBranchCode(FlowGraphCompiler* compiler, | |
788 BranchInstr* branch) { | |
789 BranchLabels labels = compiler->CreateBranchLabels(branch); | |
790 Condition true_condition = EmitComparisonCode(compiler, labels); | |
791 EmitBranchOnCondition(compiler, true_condition, labels); | |
792 } | |
793 | |
794 | |
795 LocationSummary* NativeCallInstr::MakeLocationSummary(Zone* zone, | 738 LocationSummary* NativeCallInstr::MakeLocationSummary(Zone* zone, |
796 bool opt) const { | 739 bool opt) const { |
797 return MakeCallSummary(zone); | 740 return MakeCallSummary(zone); |
798 } | 741 } |
799 | 742 |
800 | 743 |
801 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 744 void NativeCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
802 SetupNative(); | 745 SetupNative(); |
803 Register result = locs()->out(0).reg(); | 746 Register result = locs()->out(0).reg(); |
804 const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function()); | 747 const intptr_t argc_tag = NativeArguments::ComputeArgcTag(function()); |
(...skipping 2297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3102 | 3045 |
3103 void CheckedSmiComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler, | 3046 void CheckedSmiComparisonInstr::EmitBranchCode(FlowGraphCompiler* compiler, |
3104 BranchInstr* branch) { | 3047 BranchInstr* branch) { |
3105 BranchLabels labels = compiler->CreateBranchLabels(branch); | 3048 BranchLabels labels = compiler->CreateBranchLabels(branch); |
3106 CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath( | 3049 CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath( |
3107 this, compiler->CurrentTryIndex(), labels, | 3050 this, compiler->CurrentTryIndex(), labels, |
3108 /* merged = */ true); | 3051 /* merged = */ true); |
3109 compiler->AddSlowPathCode(slow_path); | 3052 compiler->AddSlowPathCode(slow_path); |
3110 EMIT_SMI_CHECK; | 3053 EMIT_SMI_CHECK; |
3111 Condition true_condition = EmitComparisonCode(compiler, labels); | 3054 Condition true_condition = EmitComparisonCode(compiler, labels); |
| 3055 ASSERT(true_condition != INVALID_CONDITION); |
3112 EmitBranchOnCondition(compiler, true_condition, labels); | 3056 EmitBranchOnCondition(compiler, true_condition, labels); |
3113 __ Bind(slow_path->exit_label()); | 3057 __ Bind(slow_path->exit_label()); |
3114 } | 3058 } |
3115 | 3059 |
3116 | 3060 |
3117 void CheckedSmiComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3061 void CheckedSmiComparisonInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
3118 Label true_label, false_label, done; | 3062 Label true_label, false_label, done; |
3119 BranchLabels labels = {&true_label, &false_label, &false_label}; | 3063 BranchLabels labels = {&true_label, &false_label, &false_label}; |
3120 CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath( | 3064 CheckedSmiComparisonSlowPath* slow_path = new CheckedSmiComparisonSlowPath( |
3121 this, compiler->CurrentTryIndex(), labels, | 3065 this, compiler->CurrentTryIndex(), labels, |
3122 /* merged = */ false); | 3066 /* merged = */ false); |
3123 compiler->AddSlowPathCode(slow_path); | 3067 compiler->AddSlowPathCode(slow_path); |
3124 EMIT_SMI_CHECK; | 3068 EMIT_SMI_CHECK; |
3125 Condition true_condition = EmitComparisonCode(compiler, labels); | 3069 Condition true_condition = EmitComparisonCode(compiler, labels); |
| 3070 ASSERT(true_condition != INVALID_CONDITION); |
3126 EmitBranchOnCondition(compiler, true_condition, labels); | 3071 EmitBranchOnCondition(compiler, true_condition, labels); |
3127 Register result = locs()->out(0).reg(); | 3072 Register result = locs()->out(0).reg(); |
3128 __ Bind(&false_label); | 3073 __ Bind(&false_label); |
3129 __ LoadObject(result, Bool::False()); | 3074 __ LoadObject(result, Bool::False()); |
3130 __ jmp(&done); | 3075 __ jmp(&done); |
3131 __ Bind(&true_label); | 3076 __ Bind(&true_label); |
3132 __ LoadObject(result, Bool::True()); | 3077 __ LoadObject(result, Bool::True()); |
3133 __ Bind(&done); | 3078 __ Bind(&done); |
3134 __ Bind(slow_path->exit_label()); | 3079 __ Bind(slow_path->exit_label()); |
3135 } | 3080 } |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3944 __ AddImmediate(RSP, Immediate(kDoubleSize)); | 3889 __ AddImmediate(RSP, Immediate(kDoubleSize)); |
3945 // Mask off the sign. | 3890 // Mask off the sign. |
3946 __ AndImmediate(temp, Immediate(0x7FFFFFFFFFFFFFFFLL)); | 3891 __ AndImmediate(temp, Immediate(0x7FFFFFFFFFFFFFFFLL)); |
3947 // Compare with +infinity. | 3892 // Compare with +infinity. |
3948 __ CompareImmediate(temp, Immediate(0x7FF0000000000000LL)); | 3893 __ CompareImmediate(temp, Immediate(0x7FF0000000000000LL)); |
3949 return is_negated ? NOT_EQUAL : EQUAL; | 3894 return is_negated ? NOT_EQUAL : EQUAL; |
3950 } | 3895 } |
3951 } | 3896 } |
3952 | 3897 |
3953 | 3898 |
3954 void DoubleTestOpInstr::EmitBranchCode(FlowGraphCompiler* compiler, | |
3955 BranchInstr* branch) { | |
3956 ASSERT(compiler->is_optimizing()); | |
3957 BranchLabels labels = compiler->CreateBranchLabels(branch); | |
3958 Condition true_condition = EmitComparisonCode(compiler, labels); | |
3959 EmitBranchOnCondition(compiler, true_condition, labels); | |
3960 } | |
3961 | |
3962 | |
3963 void DoubleTestOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
3964 Label is_true, is_false; | |
3965 BranchLabels labels = {&is_true, &is_false, &is_false}; | |
3966 Condition true_condition = EmitComparisonCode(compiler, labels); | |
3967 EmitBranchOnCondition(compiler, true_condition, labels); | |
3968 | |
3969 Register result = locs()->out(0).reg(); | |
3970 Label done; | |
3971 __ Bind(&is_false); | |
3972 __ LoadObject(result, Bool::False()); | |
3973 __ jmp(&done); | |
3974 __ Bind(&is_true); | |
3975 __ LoadObject(result, Bool::True()); | |
3976 __ Bind(&done); | |
3977 } | |
3978 | |
3979 | |
3980 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone, | 3899 LocationSummary* BinaryFloat32x4OpInstr::MakeLocationSummary(Zone* zone, |
3981 bool opt) const { | 3900 bool opt) const { |
3982 const intptr_t kNumInputs = 2; | 3901 const intptr_t kNumInputs = 2; |
3983 const intptr_t kNumTemps = 0; | 3902 const intptr_t kNumTemps = 0; |
3984 LocationSummary* summary = new (zone) | 3903 LocationSummary* summary = new (zone) |
3985 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3904 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
3986 summary->set_in(0, Location::RequiresFpuRegister()); | 3905 summary->set_in(0, Location::RequiresFpuRegister()); |
3987 summary->set_in(1, Location::RequiresFpuRegister()); | 3906 summary->set_in(1, Location::RequiresFpuRegister()); |
3988 summary->set_out(0, Location::SameAsFirstInput()); | 3907 summary->set_out(0, Location::SameAsFirstInput()); |
3989 return summary; | 3908 return summary; |
(...skipping 2641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6631 left.reg(), right.reg(), needs_number_check(), token_pos(), deopt_id_); | 6550 left.reg(), right.reg(), needs_number_check(), token_pos(), deopt_id_); |
6632 } | 6551 } |
6633 if (kind() != Token::kEQ_STRICT) { | 6552 if (kind() != Token::kEQ_STRICT) { |
6634 ASSERT(kind() == Token::kNE_STRICT); | 6553 ASSERT(kind() == Token::kNE_STRICT); |
6635 true_condition = NegateCondition(true_condition); | 6554 true_condition = NegateCondition(true_condition); |
6636 } | 6555 } |
6637 return true_condition; | 6556 return true_condition; |
6638 } | 6557 } |
6639 | 6558 |
6640 | 6559 |
6641 void StrictCompareInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
6642 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); | |
6643 | |
6644 Label is_true, is_false; | |
6645 BranchLabels labels = {&is_true, &is_false, &is_false}; | |
6646 | |
6647 Condition true_condition = EmitComparisonCode(compiler, labels); | |
6648 EmitBranchOnCondition(compiler, true_condition, labels); | |
6649 | |
6650 Register result = locs()->out(0).reg(); | |
6651 Label done; | |
6652 __ Bind(&is_false); | |
6653 __ LoadObject(result, Bool::False()); | |
6654 __ jmp(&done); | |
6655 __ Bind(&is_true); | |
6656 __ LoadObject(result, Bool::True()); | |
6657 __ Bind(&done); | |
6658 } | |
6659 | |
6660 | |
6661 void StrictCompareInstr::EmitBranchCode(FlowGraphCompiler* compiler, | |
6662 BranchInstr* branch) { | |
6663 ASSERT(kind() == Token::kEQ_STRICT || kind() == Token::kNE_STRICT); | |
6664 | |
6665 BranchLabels labels = compiler->CreateBranchLabels(branch); | |
6666 Condition true_condition = EmitComparisonCode(compiler, labels); | |
6667 EmitBranchOnCondition(compiler, true_condition, labels); | |
6668 } | |
6669 | |
6670 | |
6671 LocationSummary* ClosureCallInstr::MakeLocationSummary(Zone* zone, | 6560 LocationSummary* ClosureCallInstr::MakeLocationSummary(Zone* zone, |
6672 bool opt) const { | 6561 bool opt) const { |
6673 const intptr_t kNumInputs = 1; | 6562 const intptr_t kNumInputs = 1; |
6674 const intptr_t kNumTemps = 0; | 6563 const intptr_t kNumTemps = 0; |
6675 LocationSummary* summary = new (zone) | 6564 LocationSummary* summary = new (zone) |
6676 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); | 6565 LocationSummary(zone, kNumInputs, kNumTemps, LocationSummary::kCall); |
6677 summary->set_in(0, Location::RegisterLocation(RAX)); // Function. | 6566 summary->set_in(0, Location::RegisterLocation(RAX)); // Function. |
6678 summary->set_out(0, Location::RegisterLocation(RAX)); | 6567 summary->set_out(0, Location::RegisterLocation(RAX)); |
6679 return summary; | 6568 return summary; |
6680 } | 6569 } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6781 __ Drop(1); | 6670 __ Drop(1); |
6782 __ popq(result); | 6671 __ popq(result); |
6783 } | 6672 } |
6784 | 6673 |
6785 | 6674 |
6786 } // namespace dart | 6675 } // namespace dart |
6787 | 6676 |
6788 #undef __ | 6677 #undef __ |
6789 | 6678 |
6790 #endif // defined TARGET_ARCH_X64 | 6679 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |