| 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 6288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6299 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6299 void ShiftMintOpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6300 PairLocation* left_pair = locs()->in(0).AsPairLocation(); | 6300 PairLocation* left_pair = locs()->in(0).AsPairLocation(); |
| 6301 Register left_lo = left_pair->At(0).reg(); | 6301 Register left_lo = left_pair->At(0).reg(); |
| 6302 Register left_hi = left_pair->At(1).reg(); | 6302 Register left_hi = left_pair->At(1).reg(); |
| 6303 PairLocation* out_pair = locs()->out(0).AsPairLocation(); | 6303 PairLocation* out_pair = locs()->out(0).AsPairLocation(); |
| 6304 Register out_lo = out_pair->At(0).reg(); | 6304 Register out_lo = out_pair->At(0).reg(); |
| 6305 Register out_hi = out_pair->At(1).reg(); | 6305 Register out_hi = out_pair->At(1).reg(); |
| 6306 | 6306 |
| 6307 Label* deopt = NULL; | 6307 Label* deopt = NULL; |
| 6308 if (CanDeoptimize()) { | 6308 if (CanDeoptimize()) { |
| 6309 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptShiftMintOp); | 6309 deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp); |
| 6310 } | 6310 } |
| 6311 if (locs()->in(1).IsConstant()) { | 6311 if (locs()->in(1).IsConstant()) { |
| 6312 // Code for a constant shift amount. | 6312 // Code for a constant shift amount. |
| 6313 ASSERT(locs()->in(1).constant().IsSmi()); | 6313 ASSERT(locs()->in(1).constant().IsSmi()); |
| 6314 const int32_t shift = | 6314 const int32_t shift = |
| 6315 reinterpret_cast<int32_t>(locs()->in(1).constant().raw()) >> 1; | 6315 reinterpret_cast<int32_t>(locs()->in(1).constant().raw()) >> 1; |
| 6316 switch (op_kind()) { | 6316 switch (op_kind()) { |
| 6317 case Token::kSHR: { | 6317 case Token::kSHR: { |
| 6318 if (shift < 32) { | 6318 if (shift < 32) { |
| 6319 __ Lsl(out_lo, left_hi, Operand(32 - shift)); | 6319 __ Lsl(out_lo, left_hi, Operand(32 - shift)); |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6530 | 6530 |
| 6531 void ShiftUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 6531 void ShiftUint32OpInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 6532 const intptr_t kShifterLimit = 31; | 6532 const intptr_t kShifterLimit = 31; |
| 6533 | 6533 |
| 6534 Register left = locs()->in(0).reg(); | 6534 Register left = locs()->in(0).reg(); |
| 6535 Register out = locs()->out(0).reg(); | 6535 Register out = locs()->out(0).reg(); |
| 6536 Register temp = locs()->temp(0).reg(); | 6536 Register temp = locs()->temp(0).reg(); |
| 6537 | 6537 |
| 6538 ASSERT(left != out); | 6538 ASSERT(left != out); |
| 6539 | 6539 |
| 6540 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptShiftMintOp); | 6540 Label* deopt = compiler->AddDeoptStub(deopt_id(), ICData::kDeoptBinaryMintOp); |
| 6541 | 6541 |
| 6542 if (locs()->in(1).IsConstant()) { | 6542 if (locs()->in(1).IsConstant()) { |
| 6543 // Shifter is constant. | 6543 // Shifter is constant. |
| 6544 | 6544 |
| 6545 const Object& constant = locs()->in(1).constant(); | 6545 const Object& constant = locs()->in(1).constant(); |
| 6546 ASSERT(constant.IsSmi()); | 6546 ASSERT(constant.IsSmi()); |
| 6547 const intptr_t shift_value = Smi::Cast(constant).Value(); | 6547 const intptr_t shift_value = Smi::Cast(constant).Value(); |
| 6548 | 6548 |
| 6549 // Do the shift: (shift_value > 0) && (shift_value <= kShifterLimit). | 6549 // Do the shift: (shift_value > 0) && (shift_value <= kShifterLimit). |
| 6550 switch (op_kind()) { | 6550 switch (op_kind()) { |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6926 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 6926 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 6927 #if defined(DEBUG) | 6927 #if defined(DEBUG) |
| 6928 __ LoadImmediate(R4, kInvalidObjectPointer); | 6928 __ LoadImmediate(R4, kInvalidObjectPointer); |
| 6929 __ LoadImmediate(R5, kInvalidObjectPointer); | 6929 __ LoadImmediate(R5, kInvalidObjectPointer); |
| 6930 #endif | 6930 #endif |
| 6931 } | 6931 } |
| 6932 | 6932 |
| 6933 } // namespace dart | 6933 } // namespace dart |
| 6934 | 6934 |
| 6935 #endif // defined TARGET_ARCH_ARM | 6935 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |