| 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 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 return locs; | 630 return locs; |
| 631 } | 631 } |
| 632 | 632 |
| 633 | 633 |
| 634 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, | 634 Condition TestCidsInstr::EmitComparisonCode(FlowGraphCompiler* compiler, |
| 635 BranchLabels labels) { | 635 BranchLabels labels) { |
| 636 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); | 636 ASSERT((kind() == Token::kIS) || (kind() == Token::kISNOT)); |
| 637 Register val_reg = locs()->in(0).reg(); | 637 Register val_reg = locs()->in(0).reg(); |
| 638 Register cid_reg = locs()->temp(0).reg(); | 638 Register cid_reg = locs()->temp(0).reg(); |
| 639 | 639 |
| 640 Label* deopt = CanDeoptimize() ? | 640 Label* deopt = CanDeoptimize() |
| 641 compiler->AddDeoptStub(deopt_id(), ICData::kDeoptTestCids) : NULL; | 641 ? compiler->AddDeoptStub(deopt_id(), |
| 642 ICData::kDeoptTestCids, |
| 643 licm_hoisted_ ? ICData::kHoisted : 0) |
| 644 : NULL; |
| 642 | 645 |
| 643 const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0; | 646 const intptr_t true_result = (kind() == Token::kIS) ? 1 : 0; |
| 644 const ZoneGrowableArray<intptr_t>& data = cid_results(); | 647 const ZoneGrowableArray<intptr_t>& data = cid_results(); |
| 645 ASSERT(data[0] == kSmiCid); | 648 ASSERT(data[0] == kSmiCid); |
| 646 bool result = data[1] == true_result; | 649 bool result = data[1] == true_result; |
| 647 __ testq(val_reg, Immediate(kSmiTagMask)); | 650 __ testq(val_reg, Immediate(kSmiTagMask)); |
| 648 __ j(ZERO, result ? labels.true_label : labels.false_label); | 651 __ j(ZERO, result ? labels.true_label : labels.false_label); |
| 649 __ LoadClassId(cid_reg, val_reg); | 652 __ LoadClassId(cid_reg, val_reg); |
| 650 for (intptr_t i = 2; i < data.length(); i += 2) { | 653 for (intptr_t i = 2; i < data.length(); i += 2) { |
| 651 const intptr_t test_cid = data[i]; | 654 const intptr_t test_cid = data[i]; |
| (...skipping 5901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6553 __ Drop(1); | 6556 __ Drop(1); |
| 6554 __ popq(result); | 6557 __ popq(result); |
| 6555 } | 6558 } |
| 6556 | 6559 |
| 6557 | 6560 |
| 6558 } // namespace dart | 6561 } // namespace dart |
| 6559 | 6562 |
| 6560 #undef __ | 6563 #undef __ |
| 6561 | 6564 |
| 6562 #endif // defined TARGET_ARCH_X64 | 6565 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |