| 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/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 5759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5770 } | 5770 } |
| 5771 | 5771 |
| 5772 | 5772 |
| 5773 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5773 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5774 const Register left = locs()->in(0).reg(); | 5774 const Register left = locs()->in(0).reg(); |
| 5775 const Register out = locs()->out(0).reg(); | 5775 const Register out = locs()->out(0).reg(); |
| 5776 ASSERT(left == out); | 5776 ASSERT(left == out); |
| 5777 | 5777 |
| 5778 Label* deopt = NULL; | 5778 Label* deopt = NULL; |
| 5779 if (CanDeoptimize()) { | 5779 if (CanDeoptimize()) { |
| 5780 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptShiftMintOp); | 5780 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp); |
| 5781 } | 5781 } |
| 5782 if (locs()->in(1).IsConstant()) { | 5782 if (locs()->in(1).IsConstant()) { |
| 5783 // Code for a constant shift amount. | 5783 // Code for a constant shift amount. |
| 5784 ASSERT(locs()->in(1).constant().IsSmi()); | 5784 ASSERT(locs()->in(1).constant().IsSmi()); |
| 5785 const int64_t shift = | 5785 const int64_t shift = |
| 5786 reinterpret_cast<int64_t>(locs()->in(1).constant().raw()) >> 1; | 5786 reinterpret_cast<int64_t>(locs()->in(1).constant().raw()) >> 1; |
| 5787 switch (op_kind()) { | 5787 switch (op_kind()) { |
| 5788 case Token::kSHR: | 5788 case Token::kSHR: |
| 5789 __ sarq(left, Immediate(shift)); | 5789 __ sarq(left, Immediate(shift)); |
| 5790 break; | 5790 break; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5939 | 5939 |
| 5940 | 5940 |
| 5941 void ShiftUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 5941 void ShiftUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 5942 const intptr_t kShifterLimit = 31; | 5942 const intptr_t kShifterLimit = 31; |
| 5943 | 5943 |
| 5944 Register left = locs()->in(0).reg(); | 5944 Register left = locs()->in(0).reg(); |
| 5945 Register out = locs()->out(0).reg(); | 5945 Register out = locs()->out(0).reg(); |
| 5946 ASSERT(left == out); | 5946 ASSERT(left == out); |
| 5947 | 5947 |
| 5948 | 5948 |
| 5949 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptShiftMintOp); | 5949 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp); |
| 5950 | 5950 |
| 5951 if (locs()->in(1).IsConstant()) { | 5951 if (locs()->in(1).IsConstant()) { |
| 5952 // Shifter is constant. | 5952 // Shifter is constant. |
| 5953 | 5953 |
| 5954 const Object& constant = locs()->in(1).constant(); | 5954 const Object& constant = locs()->in(1).constant(); |
| 5955 ASSERT(constant.IsSmi()); | 5955 ASSERT(constant.IsSmi()); |
| 5956 const intptr_t shift_value = Smi::Cast(constant).Value(); | 5956 const intptr_t shift_value = Smi::Cast(constant).Value(); |
| 5957 | 5957 |
| 5958 // Do the shift: (shift_value > 0) && (shift_value <= kShifterLimit). | 5958 // Do the shift: (shift_value > 0) && (shift_value <= kShifterLimit). |
| 5959 switch (op_kind()) { | 5959 switch (op_kind()) { |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6402 __ movq(R10, Immediate(kInvalidObjectPointer)); | 6402 __ movq(R10, Immediate(kInvalidObjectPointer)); |
| 6403 __ movq(RBX, Immediate(kInvalidObjectPointer)); | 6403 __ movq(RBX, Immediate(kInvalidObjectPointer)); |
| 6404 #endif | 6404 #endif |
| 6405 } | 6405 } |
| 6406 | 6406 |
| 6407 } // namespace dart | 6407 } // namespace dart |
| 6408 | 6408 |
| 6409 #undef __ | 6409 #undef __ |
| 6410 | 6410 |
| 6411 #endif // defined TARGET_ARCH_X64 | 6411 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |