| 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 "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 3796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3807 __ j(NOT_ZERO, &done, Assembler::kNearJump); // Negative -> return left. | 3807 __ j(NOT_ZERO, &done, Assembler::kNearJump); // Negative -> return left. |
| 3808 } else { | 3808 } else { |
| 3809 ASSERT(left == result); | 3809 ASSERT(left == result); |
| 3810 __ j(ZERO, &done, Assembler::kNearJump); // Positive -> return left. | 3810 __ j(ZERO, &done, Assembler::kNearJump); // Positive -> return left. |
| 3811 } | 3811 } |
| 3812 __ movsd(result, right); | 3812 __ movsd(result, right); |
| 3813 __ Bind(&done); | 3813 __ Bind(&done); |
| 3814 return; | 3814 return; |
| 3815 } | 3815 } |
| 3816 | 3816 |
| 3817 Label done; | |
| 3818 ASSERT(result_cid() == kSmiCid); | 3817 ASSERT(result_cid() == kSmiCid); |
| 3819 Register left = locs()->in(0).reg(); | 3818 Register left = locs()->in(0).reg(); |
| 3820 Register right = locs()->in(1).reg(); | 3819 Register right = locs()->in(1).reg(); |
| 3821 Register result = locs()->out().reg(); | 3820 Register result = locs()->out().reg(); |
| 3822 __ cmpq(left, right); | 3821 __ cmpq(left, right); |
| 3823 ASSERT(result == left); | 3822 ASSERT(result == left); |
| 3824 if (is_min) { | 3823 if (is_min) { |
| 3825 __ j(LESS_EQUAL, &done, Assembler::kNearJump); | 3824 __ cmovgeq(result, right); |
| 3826 } else { | 3825 } else { |
| 3827 __ j(GREATER_EQUAL, &done, Assembler::kNearJump); | 3826 __ cmovlessq(result, right); |
| 3828 } | 3827 } |
| 3829 __ movq(result, right); | |
| 3830 __ Bind(&done); | |
| 3831 } | 3828 } |
| 3832 | 3829 |
| 3833 | 3830 |
| 3834 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3831 void UnarySmiOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3835 Register value = locs()->in(0).reg(); | 3832 Register value = locs()->in(0).reg(); |
| 3836 ASSERT(value == locs()->out().reg()); | 3833 ASSERT(value == locs()->out().reg()); |
| 3837 switch (op_kind()) { | 3834 switch (op_kind()) { |
| 3838 case Token::kNEGATE: { | 3835 case Token::kNEGATE: { |
| 3839 Label* deopt = compiler->AddDeoptStub(deopt_id(), | 3836 Label* deopt = compiler->AddDeoptStub(deopt_id(), |
| 3840 kDeoptUnaryOp); | 3837 kDeoptUnaryOp); |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4551 PcDescriptors::kOther, | 4548 PcDescriptors::kOther, |
| 4552 locs()); | 4549 locs()); |
| 4553 __ Drop(2); // Discard type arguments and receiver. | 4550 __ Drop(2); // Discard type arguments and receiver. |
| 4554 } | 4551 } |
| 4555 | 4552 |
| 4556 } // namespace dart | 4553 } // namespace dart |
| 4557 | 4554 |
| 4558 #undef __ | 4555 #undef __ |
| 4559 | 4556 |
| 4560 #endif // defined TARGET_ARCH_X64 | 4557 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |