| 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_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 return locs; | 651 return locs; |
| 652 } | 652 } |
| 653 | 653 |
| 654 | 654 |
| 655 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 655 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
| 656 BranchLabels labels) { | 656 BranchLabels labels) { |
| 657 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); | 657 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); |
| 658 Register val_reg = locs()->in(0).reg(); | 658 Register val_reg = locs()->in(0).reg(); |
| 659 Register cid_reg = locs()->temp(0).reg(); | 659 Register cid_reg = locs()->temp(0).reg(); |
| 660 | 660 |
| 661 Label* deopt = CanDeoptimize() ? | 661 Label* deopt = CanDeoptimize() |
| 662 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptTestCids) : NULL; | 662 ? compiler->AddDeoptStub(deopt_id(), |
| 663 ICData::kDeoptTestCids, |
| 664 licm_hoisted_ ? ICData::kHoisted : 0) |
| 665 : NULL; |
| 663 | 666 |
| 664 const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0; | 667 const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0; |
| 665 const ZoneGrowableArray<intptr_t>& data = cid_results(); | 668 const ZoneGrowableArray<intptr_t>& data = cid_results(); |
| 666 ASSERT(data[0] == kSmiCid); | 669 ASSERT(data[0] == kSmiCid); |
| 667 bool result = data[1] == true_result; | 670 bool result = data[1] == true_result; |
| 668 __ testl(val_reg, Immediate(kSmiTagMask)); | 671 __ testl(val_reg, Immediate(kSmiTagMask)); |
| 669 __ j(ZERO, result ? labels.true_label : labels.false_label); | 672 __ j(ZERO, result ? labels.true_label : labels.false_label); |
| 670 __ LoadClassId(cid_reg, val_reg); | 673 __ LoadClassId(cid_reg, val_reg); |
| 671 for (intptr_t i = 2; i < data.length(); i += 2) { | 674 for (intptr_t i = 2; i < data.length(); i += 2) { |
| 672 const intptr_t test_cid = data[i]; | 675 const intptr_t test_cid = data[i]; |
| (...skipping 6200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6873 __ Drop(1); | 6876 __ Drop(1); |
| 6874 __ popl(result); | 6877 __ popl(result); |
| 6875 } | 6878 } |
| 6876 | 6879 |
| 6877 | 6880 |
| 6878 } // namespace dart | 6881 } // namespace dart |
| 6879 | 6882 |
| 6880 #undef __ | 6883 #undef __ |
| 6881 | 6884 |
| 6882 #endif // defined TARGET_ARCH_IA32 | 6885 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |