| 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 case Token::kGTE: return GE; | 303 case Token::kGTE: return GE; |
| 304 default: | 304 default: |
| 305 UNREACHABLE(); | 305 UNREACHABLE(); |
| 306 return VS; | 306 return VS; |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 | 309 |
| 310 | 310 |
| 311 LocationSummary* EqualityCompareInstr::MakeLocationSummary() const { | 311 LocationSummary* EqualityCompareInstr::MakeLocationSummary() const { |
| 312 const intptr_t kNumInputs = 2; | 312 const intptr_t kNumInputs = 2; |
| 313 const bool is_checked_strict_equal = | |
| 314 HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid); | |
| 315 if (receiver_class_id() == kMintCid) { | 313 if (receiver_class_id() == kMintCid) { |
| 316 const intptr_t kNumTemps = 1; | 314 const intptr_t kNumTemps = 1; |
| 317 LocationSummary* locs = | 315 LocationSummary* locs = |
| 318 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 316 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 319 locs->set_in(0, Location::RequiresFpuRegister()); | 317 locs->set_in(0, Location::RequiresFpuRegister()); |
| 320 locs->set_in(1, Location::RequiresFpuRegister()); | 318 locs->set_in(1, Location::RequiresFpuRegister()); |
| 321 locs->set_temp(0, Location::RequiresRegister()); | 319 locs->set_temp(0, Location::RequiresRegister()); |
| 322 locs->set_out(Location::RequiresRegister()); | 320 locs->set_out(Location::RequiresRegister()); |
| 323 return locs; | 321 return locs; |
| 324 } | 322 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 337 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 335 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 338 locs->set_in(0, Location::RegisterOrConstant(left())); | 336 locs->set_in(0, Location::RegisterOrConstant(left())); |
| 339 // Only one input can be a constant operand. The case of two constant | 337 // Only one input can be a constant operand. The case of two constant |
| 340 // operands should be handled by constant propagation. | 338 // operands should be handled by constant propagation. |
| 341 locs->set_in(1, locs->in(0).IsConstant() | 339 locs->set_in(1, locs->in(0).IsConstant() |
| 342 ? Location::RequiresRegister() | 340 ? Location::RequiresRegister() |
| 343 : Location::RegisterOrConstant(right())); | 341 : Location::RegisterOrConstant(right())); |
| 344 locs->set_out(Location::RequiresRegister()); | 342 locs->set_out(Location::RequiresRegister()); |
| 345 return locs; | 343 return locs; |
| 346 } | 344 } |
| 347 if (is_checked_strict_equal) { | 345 if (is_checked_strict_equal()) { |
| 348 const intptr_t kNumTemps = 1; | 346 const intptr_t kNumTemps = 1; |
| 349 LocationSummary* locs = | 347 LocationSummary* locs = |
| 350 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 348 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 351 locs->set_in(0, Location::RequiresRegister()); | 349 locs->set_in(0, Location::RequiresRegister()); |
| 352 locs->set_in(1, Location::RequiresRegister()); | 350 locs->set_in(1, Location::RequiresRegister()); |
| 353 locs->set_temp(0, Location::RequiresRegister()); | 351 locs->set_temp(0, Location::RequiresRegister()); |
| 354 locs->set_out(Location::RequiresRegister()); | 352 locs->set_out(Location::RequiresRegister()); |
| 355 return locs; | 353 return locs; |
| 356 } | 354 } |
| 357 if (IsPolymorphic()) { | 355 if (IsPolymorphic()) { |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 return; | 774 return; |
| 777 } | 775 } |
| 778 if (receiver_class_id() == kMintCid) { | 776 if (receiver_class_id() == kMintCid) { |
| 779 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), kNoBranch); | 777 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), kNoBranch); |
| 780 return; | 778 return; |
| 781 } | 779 } |
| 782 if (receiver_class_id() == kDoubleCid) { | 780 if (receiver_class_id() == kDoubleCid) { |
| 783 EmitDoubleComparisonOp(compiler, *locs(), kind(), kNoBranch); | 781 EmitDoubleComparisonOp(compiler, *locs(), kind(), kNoBranch); |
| 784 return; | 782 return; |
| 785 } | 783 } |
| 786 const bool is_checked_strict_equal = | 784 if (is_checked_strict_equal()) { |
| 787 HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid); | |
| 788 if (is_checked_strict_equal) { | |
| 789 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), kNoBranch, | 785 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), kNoBranch, |
| 790 deopt_id()); | 786 deopt_id()); |
| 791 return; | 787 return; |
| 792 } | 788 } |
| 793 if (IsPolymorphic()) { | 789 if (IsPolymorphic()) { |
| 794 EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(), | 790 EmitGenericEqualityCompare(compiler, locs(), kind(), kNoBranch, *ic_data(), |
| 795 deopt_id(), token_pos()); | 791 deopt_id(), token_pos()); |
| 796 return; | 792 return; |
| 797 } | 793 } |
| 798 Register left = locs()->in(0).reg(); | 794 Register left = locs()->in(0).reg(); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 819 return; | 815 return; |
| 820 } | 816 } |
| 821 if (receiver_class_id() == kMintCid) { | 817 if (receiver_class_id() == kMintCid) { |
| 822 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), branch); | 818 EmitUnboxedMintEqualityOp(compiler, *locs(), kind(), branch); |
| 823 return; | 819 return; |
| 824 } | 820 } |
| 825 if (receiver_class_id() == kDoubleCid) { | 821 if (receiver_class_id() == kDoubleCid) { |
| 826 EmitDoubleComparisonOp(compiler, *locs(), kind(), branch); | 822 EmitDoubleComparisonOp(compiler, *locs(), kind(), branch); |
| 827 return; | 823 return; |
| 828 } | 824 } |
| 829 const bool is_checked_strict_equal = | 825 if (is_checked_strict_equal()) { |
| 830 HasICData() && ic_data()->AllTargetsHaveSameOwner(kInstanceCid); | |
| 831 if (is_checked_strict_equal) { | |
| 832 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), branch, | 826 EmitCheckedStrictEqual(compiler, *ic_data(), *locs(), kind(), branch, |
| 833 deopt_id()); | 827 deopt_id()); |
| 834 return; | 828 return; |
| 835 } | 829 } |
| 836 if (IsPolymorphic()) { | 830 if (IsPolymorphic()) { |
| 837 EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(), | 831 EmitGenericEqualityCompare(compiler, locs(), kind(), branch, *ic_data(), |
| 838 deopt_id(), token_pos()); | 832 deopt_id(), token_pos()); |
| 839 return; | 833 return; |
| 840 } | 834 } |
| 841 Register left = locs()->in(0).reg(); | 835 Register left = locs()->in(0).reg(); |
| (...skipping 2742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3584 compiler->GenerateCall(token_pos(), | 3578 compiler->GenerateCall(token_pos(), |
| 3585 &label, | 3579 &label, |
| 3586 PcDescriptors::kOther, | 3580 PcDescriptors::kOther, |
| 3587 locs()); | 3581 locs()); |
| 3588 __ Drop(2); // Discard type arguments and receiver. | 3582 __ Drop(2); // Discard type arguments and receiver. |
| 3589 } | 3583 } |
| 3590 | 3584 |
| 3591 } // namespace dart | 3585 } // namespace dart |
| 3592 | 3586 |
| 3593 #endif // defined TARGET_ARCH_ARM | 3587 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |