| 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 15 matching lines...) Expand all Loading... |
| 26 // if the intrinsified method always executes a return. | 26 // if the intrinsified method always executes a return. |
| 27 // The FP register should not be modified, because it is used by the profiler. | 27 // The FP register should not be modified, because it is used by the profiler. |
| 28 // The PP and THR registers (see constants_arm.h) must be preserved. | 28 // The PP and THR registers (see constants_arm.h) must be preserved. |
| 29 | 29 |
| 30 #define __ assembler-> | 30 #define __ assembler-> |
| 31 | 31 |
| 32 | 32 |
| 33 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; } | 33 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; } |
| 34 | 34 |
| 35 | 35 |
| 36 static bool IsABIPreservedRegister(Register reg) { |
| 37 return ((1 << reg) & kAbiPreservedCpuRegs) != 0; |
| 38 } |
| 39 |
| 40 |
| 36 void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) { | 41 void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) { |
| 42 ASSERT(IsABIPreservedRegister(CODE_REG)); |
| 43 ASSERT(IsABIPreservedRegister(ARGS_DESC_REG)); |
| 44 ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP)); |
| 45 |
| 37 // Save LR by moving it to a callee saved temporary register. | 46 // Save LR by moving it to a callee saved temporary register. |
| 38 assembler->Comment("IntrinsicCallPrologue"); | 47 assembler->Comment("IntrinsicCallPrologue"); |
| 39 assembler->mov(CALLEE_SAVED_TEMP, Operand(LR)); | 48 assembler->mov(CALLEE_SAVED_TEMP, Operand(LR)); |
| 40 } | 49 } |
| 41 | 50 |
| 42 | 51 |
| 43 void Intrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { | 52 void Intrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { |
| 44 // Restore LR. | 53 // Restore LR. |
| 45 assembler->Comment("IntrinsicCallEpilogue"); | 54 assembler->Comment("IntrinsicCallEpilogue"); |
| 46 assembler->mov(LR, Operand(CALLEE_SAVED_TEMP)); | 55 assembler->mov(LR, Operand(CALLEE_SAVED_TEMP)); |
| (...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2118 __ ldr(R0, Address(R0, TimelineStream::enabled_offset())); | 2127 __ ldr(R0, Address(R0, TimelineStream::enabled_offset())); |
| 2119 __ cmp(R0, Operand(0)); | 2128 __ cmp(R0, Operand(0)); |
| 2120 __ LoadObject(R0, Bool::True(), NE); | 2129 __ LoadObject(R0, Bool::True(), NE); |
| 2121 __ LoadObject(R0, Bool::False(), EQ); | 2130 __ LoadObject(R0, Bool::False(), EQ); |
| 2122 __ Ret(); | 2131 __ Ret(); |
| 2123 } | 2132 } |
| 2124 | 2133 |
| 2125 } // namespace dart | 2134 } // namespace dart |
| 2126 | 2135 |
| 2127 #endif // defined TARGET_ARCH_ARM | 2136 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |