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_MIPS. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_MIPS. |
6 #if defined(TARGET_ARCH_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 2393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2404 __ BranchEqual(left, 0x80000000, deopt); | 2404 __ BranchEqual(left, 0x80000000, deopt); |
2405 __ subu(result, ZR, left); | 2405 __ subu(result, ZR, left); |
2406 break; | 2406 break; |
2407 } | 2407 } |
2408 ASSERT((value != 0) && Utils::IsPowerOfTwo(Utils::Abs(value))); | 2408 ASSERT((value != 0) && Utils::IsPowerOfTwo(Utils::Abs(value))); |
2409 const intptr_t shift_count = | 2409 const intptr_t shift_count = |
2410 Utils::ShiftForPowerOfTwo(Utils::Abs(value)) + kSmiTagSize; | 2410 Utils::ShiftForPowerOfTwo(Utils::Abs(value)) + kSmiTagSize; |
2411 ASSERT(kSmiTagSize == 1); | 2411 ASSERT(kSmiTagSize == 1); |
2412 __ sra(TMP, left, 31); | 2412 __ sra(TMP, left, 31); |
2413 ASSERT(shift_count > 1); // 1, -1 case handled above. | 2413 ASSERT(shift_count > 1); // 1, -1 case handled above. |
2414 __ sll(TMP, TMP, 32 - shift_count); | 2414 __ srl(TMP, TMP, 32 - shift_count); |
2415 __ addu(left, left, TMP); | 2415 __ addu(left, left, TMP); |
2416 ASSERT(shift_count > 0); | 2416 ASSERT(shift_count > 0); |
2417 __ sra(result, left, shift_count); | 2417 __ sra(result, left, shift_count); |
2418 if (value < 0) { | 2418 if (value < 0) { |
2419 __ subu(result, ZR, result); | 2419 __ subu(result, ZR, result); |
2420 } | 2420 } |
2421 __ SmiTag(result); | 2421 __ SmiTag(result); |
2422 break; | 2422 break; |
2423 } | 2423 } |
2424 case Token::kBIT_AND: { | 2424 case Token::kBIT_AND: { |
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3663 compiler->GenerateCall(token_pos(), | 3663 compiler->GenerateCall(token_pos(), |
3664 &label, | 3664 &label, |
3665 PcDescriptors::kOther, | 3665 PcDescriptors::kOther, |
3666 locs()); | 3666 locs()); |
3667 __ Drop(2); // Discard type arguments and receiver. | 3667 __ Drop(2); // Discard type arguments and receiver. |
3668 } | 3668 } |
3669 | 3669 |
3670 } // namespace dart | 3670 } // namespace dart |
3671 | 3671 |
3672 #endif // defined TARGET_ARCH_MIPS | 3672 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |