| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 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 14 matching lines...) Expand all Loading... |
| 25 // if the intrinsified method always executes a return. | 25 // if the intrinsified method always executes a return. |
| 26 // The FP register should not be modified, because it is used by the profiler. | 26 // The FP register should not be modified, because it is used by the profiler. |
| 27 // The PP and THR registers (see constants_arm64.h) must be preserved. | 27 // The PP and THR registers (see constants_arm64.h) must be preserved. |
| 28 | 28 |
| 29 #define __ assembler-> | 29 #define __ assembler-> |
| 30 | 30 |
| 31 | 31 |
| 32 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; } | 32 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; } |
| 33 | 33 |
| 34 | 34 |
| 35 static bool IsABIPreservedRegister(Register reg) { |
| 36 return ((1 << reg) & kAbiPreservedCpuRegs) != 0; |
| 37 } |
| 38 |
| 39 |
| 35 void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) { | 40 void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) { |
| 41 ASSERT(IsABIPreservedRegister(CODE_REG)); |
| 42 ASSERT(!IsABIPreservedRegister(ARGS_DESC_REG)); |
| 43 ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP)); |
| 44 ASSERT(IsABIPreservedRegister(CALLEE_SAVED_TEMP2)); |
| 45 ASSERT(CALLEE_SAVED_TEMP != CODE_REG); |
| 46 ASSERT(CALLEE_SAVED_TEMP != ARGS_DESC_REG); |
| 47 ASSERT(CALLEE_SAVED_TEMP2 != CODE_REG); |
| 48 ASSERT(CALLEE_SAVED_TEMP2 != ARGS_DESC_REG); |
| 49 |
| 36 assembler->Comment("IntrinsicCallPrologue"); | 50 assembler->Comment("IntrinsicCallPrologue"); |
| 37 assembler->mov(CALLEE_SAVED_TEMP, LR); | 51 assembler->mov(CALLEE_SAVED_TEMP, LR); |
| 38 assembler->mov(CALLEE_SAVED_TEMP2, R4); | 52 assembler->mov(CALLEE_SAVED_TEMP2, ARGS_DESC_REG); |
| 39 } | 53 } |
| 40 | 54 |
| 41 | 55 |
| 42 void Intrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { | 56 void Intrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { |
| 43 assembler->Comment("IntrinsicCallEpilogue"); | 57 assembler->Comment("IntrinsicCallEpilogue"); |
| 44 assembler->mov(LR, CALLEE_SAVED_TEMP); | 58 assembler->mov(LR, CALLEE_SAVED_TEMP); |
| 45 assembler->mov(R4, CALLEE_SAVED_TEMP2); | 59 assembler->mov(ARGS_DESC_REG, CALLEE_SAVED_TEMP2); |
| 46 } | 60 } |
| 47 | 61 |
| 48 | 62 |
| 49 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 63 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
| 50 // update. Array length is always a Smi. | 64 // update. Array length is always a Smi. |
| 51 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { | 65 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { |
| 52 if (Isolate::Current()->type_checks()) { | 66 if (Isolate::Current()->type_checks()) { |
| 53 return; | 67 return; |
| 54 } | 68 } |
| 55 | 69 |
| (...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2193 __ cmp(R0, Operand(0)); | 2207 __ cmp(R0, Operand(0)); |
| 2194 __ LoadObject(R0, Bool::False()); | 2208 __ LoadObject(R0, Bool::False()); |
| 2195 __ LoadObject(TMP, Bool::True()); | 2209 __ LoadObject(TMP, Bool::True()); |
| 2196 __ csel(R0, TMP, R0, NE); | 2210 __ csel(R0, TMP, R0, NE); |
| 2197 __ ret(); | 2211 __ ret(); |
| 2198 } | 2212 } |
| 2199 | 2213 |
| 2200 } // namespace dart | 2214 } // namespace dart |
| 2201 | 2215 |
| 2202 #endif // defined TARGET_ARCH_ARM64 | 2216 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |