| 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/intrinsifier.h" | 8 #include "vm/intrinsifier.h" |
| 9 | 9 |
| 10 #include "vm/assembler.h" | 10 #include "vm/assembler.h" |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 374 |
| 375 | 375 |
| 376 // Optimizations: | 376 // Optimizations: |
| 377 // - result is 0 if: | 377 // - result is 0 if: |
| 378 // - left is 0 | 378 // - left is 0 |
| 379 // - left equals right | 379 // - left equals right |
| 380 // - result is left if | 380 // - result is left if |
| 381 // - left > 0 && left < right | 381 // - left > 0 && left < right |
| 382 // R1: Tagged left (dividend). | 382 // R1: Tagged left (dividend). |
| 383 // R0: Tagged right (divisor). | 383 // R0: Tagged right (divisor). |
| 384 // Returns with result in R0, OR: | 384 // Returns: |
| 385 // R1: Untagged result (remainder). | 385 // R1: Untagged fallthrough result (remainder to be adjusted), or |
| 386 // R0: Tagged return result (remainder). |
| 386 static void EmitRemainderOperation(Assembler* assembler) { | 387 static void EmitRemainderOperation(Assembler* assembler) { |
| 387 Label modulo; | 388 Label modulo; |
| 388 const Register left = R1; | 389 const Register left = R1; |
| 389 const Register right = R0; | 390 const Register right = R0; |
| 390 const Register result = R1; | 391 const Register result = R1; |
| 391 const Register tmp = R2; | 392 const Register tmp = R2; |
| 392 ASSERT(left == result); | 393 ASSERT(left == result); |
| 393 | 394 |
| 394 // Check for quick zero results. | 395 // Check for quick zero results. |
| 395 __ cmp(left, Operand(0)); | 396 __ cmp(left, Operand(0)); |
| (...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1953 Isolate* isolate = Isolate::Current(); | 1954 Isolate* isolate = Isolate::Current(); |
| 1954 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); | 1955 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); |
| 1955 // Set return value to Isolate::current_tag_. | 1956 // Set return value to Isolate::current_tag_. |
| 1956 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 1957 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
| 1957 __ Ret(); | 1958 __ Ret(); |
| 1958 } | 1959 } |
| 1959 | 1960 |
| 1960 } // namespace dart | 1961 } // namespace dart |
| 1961 | 1962 |
| 1962 #endif // defined TARGET_ARCH_ARM | 1963 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |