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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #define __ assembler-> | 28 #define __ assembler-> |
29 | 29 |
30 | 30 |
31 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; } | 31 intptr_t Intrinsifier::ParameterSlotFromSp() { return -1; } |
32 | 32 |
33 | 33 |
34 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 34 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
35 // update. Array length is always a Smi. | 35 // update. Array length is always a Smi. |
36 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { | 36 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { |
37 if (Isolate::Current()->flags().type_checks()) { | 37 if (Isolate::Current()->type_checks()) { |
38 return; | 38 return; |
39 } | 39 } |
40 | 40 |
41 Label fall_through; | 41 Label fall_through; |
42 __ ldr(R1, Address(SP, 1 * kWordSize)); // Index. | 42 __ ldr(R1, Address(SP, 1 * kWordSize)); // Index. |
43 __ tsti(R1, Immediate(kSmiTagMask)); | 43 __ tsti(R1, Immediate(kSmiTagMask)); |
44 // Index not Smi. | 44 // Index not Smi. |
45 __ b(&fall_through, NE); | 45 __ b(&fall_through, NE); |
46 __ ldr(R0, Address(SP, 2 * kWordSize)); // Array. | 46 __ ldr(R0, Address(SP, 2 * kWordSize)); // Array. |
47 | 47 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 __ Bind(&fall_through); | 101 __ Bind(&fall_through); |
102 } | 102 } |
103 | 103 |
104 | 104 |
105 // Add an element to growable array if it doesn't need to grow, otherwise | 105 // Add an element to growable array if it doesn't need to grow, otherwise |
106 // call into regular code. | 106 // call into regular code. |
107 // On stack: growable array (+1), value (+0). | 107 // On stack: growable array (+1), value (+0). |
108 void Intrinsifier::GrowableArray_add(Assembler* assembler) { | 108 void Intrinsifier::GrowableArray_add(Assembler* assembler) { |
109 // In checked mode we need to type-check the incoming argument. | 109 // In checked mode we need to type-check the incoming argument. |
110 if (Isolate::Current()->flags().type_checks()) { | 110 if (Isolate::Current()->type_checks()) { |
111 return; | 111 return; |
112 } | 112 } |
113 Label fall_through; | 113 Label fall_through; |
114 // R0: Array. | 114 // R0: Array. |
115 __ ldr(R0, Address(SP, 1 * kWordSize)); | 115 __ ldr(R0, Address(SP, 1 * kWordSize)); |
116 // R1: length. | 116 // R1: length. |
117 __ ldr(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); | 117 __ ldr(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); |
118 // R2: data. | 118 // R2: data. |
119 __ ldr(R2, FieldAddress(R0, GrowableObjectArray::data_offset())); | 119 __ ldr(R2, FieldAddress(R0, GrowableObjectArray::data_offset())); |
120 // R3: capacity. | 120 // R3: capacity. |
(...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2195 | 2195 |
2196 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2196 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
2197 __ LoadIsolate(R0); | 2197 __ LoadIsolate(R0); |
2198 __ ldr(R0, Address(R0, Isolate::current_tag_offset())); | 2198 __ ldr(R0, Address(R0, Isolate::current_tag_offset())); |
2199 __ ret(); | 2199 __ ret(); |
2200 } | 2200 } |
2201 | 2201 |
2202 } // namespace dart | 2202 } // namespace dart |
2203 | 2203 |
2204 #endif // defined TARGET_ARCH_ARM64 | 2204 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |