| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // On stack: type argument (+1), data (+0). | 139 // On stack: type argument (+1), data (+0). |
| 140 void Intrinsifier::GrowableList_Allocate(Assembler* assembler) { | 140 void Intrinsifier::GrowableList_Allocate(Assembler* assembler) { |
| 141 // The newly allocated object is returned in R0. | 141 // The newly allocated object is returned in R0. |
| 142 const intptr_t kTypeArgumentsOffset = 1 * kWordSize; | 142 const intptr_t kTypeArgumentsOffset = 1 * kWordSize; |
| 143 const intptr_t kArrayOffset = 0 * kWordSize; | 143 const intptr_t kArrayOffset = 0 * kWordSize; |
| 144 Label fall_through; | 144 Label fall_through; |
| 145 | 145 |
| 146 // Try allocating in new space. | 146 // Try allocating in new space. |
| 147 const Class& cls = Class::Handle( | 147 const Class& cls = Class::Handle( |
| 148 Isolate::Current()->object_store()->growable_object_array_class()); | 148 Isolate::Current()->object_store()->growable_object_array_class()); |
| 149 __ TryAllocate(cls, &fall_through, R0, R1, PP); | 149 __ TryAllocate(cls, &fall_through, R0, R1, kNoPP); |
| 150 | 150 |
| 151 // Store backing array object in growable array object. | 151 // Store backing array object in growable array object. |
| 152 __ ldr(R1, Address(SP, kArrayOffset)); // Data argument. | 152 __ ldr(R1, Address(SP, kArrayOffset)); // Data argument. |
| 153 // R0 is new, no barrier needed. | 153 // R0 is new, no barrier needed. |
| 154 __ StoreIntoObjectNoBarrier( | 154 __ StoreIntoObjectNoBarrier( |
| 155 R0, | 155 R0, |
| 156 FieldAddress(R0, GrowableObjectArray::data_offset()), | 156 FieldAddress(R0, GrowableObjectArray::data_offset()), |
| 157 R1); | 157 R1); |
| 158 | 158 |
| 159 // R0: new growable array object start as a tagged pointer. | 159 // R0: new growable array object start as a tagged pointer. |
| 160 // Store the type argument field in the growable array object. | 160 // Store the type argument field in the growable array object. |
| 161 __ ldr(R1, Address(SP, kTypeArgumentsOffset)); // Type argument. | 161 __ ldr(R1, Address(SP, kTypeArgumentsOffset)); // Type argument. |
| 162 __ StoreIntoObjectNoBarrier( | 162 __ StoreIntoObjectNoBarrier( |
| 163 R0, | 163 R0, |
| 164 FieldAddress(R0, GrowableObjectArray::type_arguments_offset()), | 164 FieldAddress(R0, GrowableObjectArray::type_arguments_offset()), |
| 165 R1); | 165 R1); |
| 166 | 166 |
| 167 // Set the length field in the growable array object to 0. | 167 // Set the length field in the growable array object to 0. |
| 168 __ LoadImmediate(R1, 0, kNoPP); | 168 __ LoadImmediate(R1, 0, kNoPP); |
| 169 __ str(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); | 169 __ str(R1, FieldAddress(R0, GrowableObjectArray::length_offset())); |
| 170 __ UpdateAllocationStats(kGrowableObjectArrayCid, kNoPP); | |
| 171 __ ret(); // Returns the newly allocated object in R0. | 170 __ ret(); // Returns the newly allocated object in R0. |
| 172 | 171 |
| 173 __ Bind(&fall_through); | 172 __ Bind(&fall_through); |
| 174 } | 173 } |
| 175 | 174 |
| 176 | 175 |
| 177 void Intrinsifier::GrowableList_getLength(Assembler* assembler) { | 176 void Intrinsifier::GrowableList_getLength(Assembler* assembler) { |
| 178 __ ldr(R0, Address(SP, 0 * kWordSize)); | 177 __ ldr(R0, Address(SP, 0 * kWordSize)); |
| 179 __ ldr(R0, FieldAddress(R0, GrowableObjectArray::length_offset())); | 178 __ ldr(R0, FieldAddress(R0, GrowableObjectArray::length_offset())); |
| 180 __ ret(); | 179 __ ret(); |
| (...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1637 Isolate* isolate = Isolate::Current(); | 1636 Isolate* isolate = Isolate::Current(); |
| 1638 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); | 1637 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate), kNoPP); |
| 1639 // Set return value to Isolate::current_tag_. | 1638 // Set return value to Isolate::current_tag_. |
| 1640 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); | 1639 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); |
| 1641 __ ret(); | 1640 __ ret(); |
| 1642 } | 1641 } |
| 1643 | 1642 |
| 1644 } // namespace dart | 1643 } // namespace dart |
| 1645 | 1644 |
| 1646 #endif // defined TARGET_ARCH_ARM64 | 1645 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |