| 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 6067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6078 | 6078 |
| 6079 Label* deopt = NULL; | 6079 Label* deopt = NULL; |
| 6080 if (CanDeoptimize()) { | 6080 if (CanDeoptimize()) { |
| 6081 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp); | 6081 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp); |
| 6082 } | 6082 } |
| 6083 if (locs()->in(1).IsConstant()) { | 6083 if (locs()->in(1).IsConstant()) { |
| 6084 // Code for a constant shift amount. | 6084 // Code for a constant shift amount. |
| 6085 ASSERT(locs()->in(1).constant().IsSmi()); | 6085 ASSERT(locs()->in(1).constant().IsSmi()); |
| 6086 const int32_t shift = | 6086 const int32_t shift = |
| 6087 reinterpret_cast<int32_t>(locs()->in(1).constant().raw()) >> 1; | 6087 reinterpret_cast<int32_t>(locs()->in(1).constant().raw()) >> 1; |
| 6088 ASSERT(!has_shift_count_check()); |
| 6089 ASSERT(shift >= 0); |
| 6088 switch (op_kind()) { | 6090 switch (op_kind()) { |
| 6089 case Token::kSHR: { | 6091 case Token::kSHR: { |
| 6090 if (shift > 31) { | 6092 if (shift > 31) { |
| 6091 __ movl(left_lo, left_hi); // Shift by 32. | 6093 __ movl(left_lo, left_hi); // Shift by 32. |
| 6092 __ sarl(left_hi, Immediate(31)); // Sign extend left hi. | 6094 __ sarl(left_hi, Immediate(31)); // Sign extend left hi. |
| 6093 if (shift > 32) { | 6095 if (shift > 32) { |
| 6094 __ sarl(left_lo, Immediate(shift > 63 ? 31 : shift - 32)); | 6096 __ sarl(left_lo, Immediate(shift > 63 ? 31 : shift - 32)); |
| 6095 } | 6097 } |
| 6096 } else { | 6098 } else { |
| 6097 __ shrdl(left_lo, left_hi, Immediate(shift)); | 6099 __ shrdl(left_lo, left_hi, Immediate(shift)); |
| (...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6785 __ Call(*StubCode::DebugStepCheck_entry()); | 6787 __ Call(*StubCode::DebugStepCheck_entry()); |
| 6786 compiler->EmitCallsiteMetaData(token_pos(), deopt_id_, stub_kind_, locs()); | 6788 compiler->EmitCallsiteMetaData(token_pos(), deopt_id_, stub_kind_, locs()); |
| 6787 } | 6789 } |
| 6788 | 6790 |
| 6789 | 6791 |
| 6790 } // namespace dart | 6792 } // namespace dart |
| 6791 | 6793 |
| 6792 #undef __ | 6794 #undef __ |
| 6793 | 6795 |
| 6794 #endif // defined TARGET_ARCH_IA32 | 6796 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |