| 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 17 matching lines...) Expand all Loading... |
| 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 // Intrinsify only for Smi value and index. Non-smi values need a store buffer | 35 // Intrinsify only for Smi value and index. Non-smi values need a store buffer |
| 36 // update. Array length is always a Smi. | 36 // update. Array length is always a Smi. |
| 37 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { | 37 void Intrinsifier::ObjectArraySetIndexed(Assembler* assembler) { |
| 38 if (Isolate::Current()->flags().type_checks()) { | 38 if (Isolate::Current()->type_checks()) { |
| 39 return; | 39 return; |
| 40 } | 40 } |
| 41 | 41 |
| 42 Label fall_through; | 42 Label fall_through; |
| 43 __ ldr(R1, Address(SP, 1 * kWordSize)); // Index. | 43 __ ldr(R1, Address(SP, 1 * kWordSize)); // Index. |
| 44 __ tst(R1, Operand(kSmiTagMask)); | 44 __ tst(R1, Operand(kSmiTagMask)); |
| 45 // Index not Smi. | 45 // Index not Smi. |
| 46 __ b(&fall_through, NE); | 46 __ b(&fall_through, NE); |
| 47 __ ldr(R0, Address(SP, 2 * kWordSize)); // Array. | 47 __ ldr(R0, Address(SP, 2 * kWordSize)); // Array. |
| 48 | 48 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 __ Bind(&fall_through); | 103 __ Bind(&fall_through); |
| 104 } | 104 } |
| 105 | 105 |
| 106 | 106 |
| 107 // Add an element to growable array if it doesn't need to grow, otherwise | 107 // Add an element to growable array if it doesn't need to grow, otherwise |
| 108 // call into regular code. | 108 // call into regular code. |
| 109 // On stack: growable array (+1), value (+0). | 109 // On stack: growable array (+1), value (+0). |
| 110 void Intrinsifier::GrowableArray_add(Assembler* assembler) { | 110 void Intrinsifier::GrowableArray_add(Assembler* assembler) { |
| 111 // In checked mode we need to type-check the incoming argument. | 111 // In checked mode we need to type-check the incoming argument. |
| 112 if (Isolate::Current()->flags().type_checks()) { | 112 if (Isolate::Current()->type_checks()) { |
| 113 return; | 113 return; |
| 114 } | 114 } |
| 115 Label fall_through; | 115 Label fall_through; |
| 116 // R0: Array. | 116 // R0: Array. |
| 117 __ ldr(R0, Address(SP, 1 * kWordSize)); | 117 __ ldr(R0, Address(SP, 1 * kWordSize)); |
| 118 // R1: length. | 118 // R1: length. |
| 119 __ ldr(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); | 119 __ ldr(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); |
| 120 // R2: data. | 120 // R2: data. |
| 121 __ ldr(R2, FieldAddress(R0, GrowableObjectArray::data_offset())); | 121 __ ldr(R2, FieldAddress(R0, GrowableObjectArray::data_offset())); |
| 122 // R3: capacity. | 122 // R3: capacity. |
| (...skipping 1997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2120 | 2120 |
| 2121 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { | 2121 void Intrinsifier::Profiler_getCurrentTag(Assembler* assembler) { |
| 2122 __ LoadIsolate(R0); | 2122 __ LoadIsolate(R0); |
| 2123 __ ldr(R0, Address(R0, Isolate::current_tag_offset())); | 2123 __ ldr(R0, Address(R0, Isolate::current_tag_offset())); |
| 2124 __ Ret(); | 2124 __ Ret(); |
| 2125 } | 2125 } |
| 2126 | 2126 |
| 2127 } // namespace dart | 2127 } // namespace dart |
| 2128 | 2128 |
| 2129 #endif // defined TARGET_ARCH_ARM | 2129 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |