| 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 6052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6063 const Register out = locs()->out(0).reg(); | 6063 const Register out = locs()->out(0).reg(); |
| 6064 ASSERT(left == out); | 6064 ASSERT(left == out); |
| 6065 | 6065 |
| 6066 Label* deopt = NULL; | 6066 Label* deopt = NULL; |
| 6067 if (CanDeoptimize()) { | 6067 if (CanDeoptimize()) { |
| 6068 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp); | 6068 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp); |
| 6069 } | 6069 } |
| 6070 if (locs()->in(1).IsConstant()) { | 6070 if (locs()->in(1).IsConstant()) { |
| 6071 // Code for a constant shift amount. | 6071 // Code for a constant shift amount. |
| 6072 ASSERT(locs()->in(1).constant().IsSmi()); | 6072 ASSERT(locs()->in(1).constant().IsSmi()); |
| 6073 const int64_t shift = | 6073 const int64_t shift = Smi::Cast(locs()->in(1).constant()).Value(); |
| 6074 reinterpret_cast<int64_t>(locs()->in(1).constant().raw()) >> 1; | |
| 6075 ASSERT(shift >= 0); | 6074 ASSERT(shift >= 0); |
| 6076 switch (op_kind()) { | 6075 switch (op_kind()) { |
| 6077 case Token::kSHR: | 6076 case Token::kSHR: |
| 6078 __ sarq(left, | 6077 __ sarq(left, |
| 6079 Immediate(Utils::Minimum<int64_t>(shift, kBitsPerWord - 1))); | 6078 Immediate(Utils::Minimum<int64_t>(shift, kBitsPerWord - 1))); |
| 6080 break; | 6079 break; |
| 6081 case Token::kSHL: { | 6080 case Token::kSHL: { |
| 6082 ASSERT(shift < 64); | 6081 ASSERT(shift < 64); |
| 6083 if (can_overflow()) { | 6082 if (can_overflow()) { |
| 6084 // Check for overflow. | 6083 // Check for overflow. |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6648 compiler->AddCurrentDescriptor(stub_kind_, deopt_id_, token_pos()); | 6647 compiler->AddCurrentDescriptor(stub_kind_, deopt_id_, token_pos()); |
| 6649 compiler->RecordSafepoint(locs()); | 6648 compiler->RecordSafepoint(locs()); |
| 6650 } | 6649 } |
| 6651 | 6650 |
| 6652 | 6651 |
| 6653 } // namespace dart | 6652 } // namespace dart |
| 6654 | 6653 |
| 6655 #undef __ | 6654 #undef __ |
| 6656 | 6655 |
| 6657 #endif // defined TARGET_ARCH_X64 | 6656 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |