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 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_arm.h) must be preserved. | 27 // The PP and THR registers (see constants_arm.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 void Intrinsifier::IntrinsicCallPrologue(Assembler* assembler) { |
| 36 // Save LR by moving it to a callee saved temporary register. |
| 37 assembler->Comment("IntrinsicCallPrologue"); |
| 38 assembler->mov(CALLEE_SAVED_TEMP, Operand(LR)); |
| 39 } |
| 40 |
| 41 |
| 42 void Intrinsifier::IntrinsicCallEpilogue(Assembler* assembler) { |
| 43 // Restore LR. |
| 44 assembler->Comment("IntrinsicCallEpilogue"); |
| 45 assembler->mov(LR, Operand(CALLEE_SAVED_TEMP)); |
| 46 } |
| 47 |
| 48 |
35 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 49 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
36 // update. Array length is always a Smi. | 50 // update. Array length is always a Smi. |
37 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { | 51 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { |
38 if (Isolate::Current()->type_checks()) { | 52 if (Isolate::Current()->type_checks()) { |
39 return; | 53 return; |
40 } | 54 } |
41 | 55 |
42 Label fall_through; | 56 Label fall_through; |
43 __ ldr(R1, Address(SP, 1 * kWordSize)); // Index. | 57 __ ldr(R1, Address(SP, 1 * kWordSize)); // Index. |
44 __ tst(R1, Operand(kSmiTagMask)); | 58 __ tst(R1, Operand(kSmiTagMask)); |
(...skipping 2075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2120 | 2134 |
2121 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2135 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
2122 __ LoadIsolate(R0); | 2136 __ LoadIsolate(R0); |
2123 __ ldr(R0, Address(R0, Isolate::current_tag_offset())); | 2137 __ ldr(R0, Address(R0, Isolate::current_tag_offset())); |
2124 __ Ret(); | 2138 __ Ret(); |
2125 } | 2139 } |
2126 | 2140 |
2127 } // namespace dart | 2141 } // namespace dart |
2128 | 2142 |
2129 #endif // defined TARGET_ARCH_ARM | 2143 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |