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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 Label fall_through; | 96 Label fall_through; |
97 | 97 |
98 // Try allocating in new space. | 98 // Try allocating in new space. |
99 const Class& cls = Class::Handle( | 99 const Class& cls = Class::Handle( |
100 Isolate::Current()->object_store()->growable_object_array_class()); | 100 Isolate::Current()->object_store()->growable_object_array_class()); |
101 __ TryAllocate(cls, &fall_through, R0, R1); | 101 __ TryAllocate(cls, &fall_through, R0, R1); |
102 | 102 |
103 // Store backing array object in growable array object. | 103 // Store backing array object in growable array object. |
104 __ ldr(R1, Address(SP, kArrayOffset)); // Data argument. | 104 __ ldr(R1, Address(SP, kArrayOffset)); // Data argument. |
105 // R0 is new, no barrier needed. | 105 // R0 is new, no barrier needed. |
106 __ InitializeFieldNoBarrier( | 106 __ StoreIntoObjectNoBarrier( |
107 R0, | 107 R0, |
108 FieldAddress(R0, GrowableObjectArray::data_offset()), | 108 FieldAddress(R0, GrowableObjectArray::data_offset()), |
109 R1); | 109 R1); |
110 | 110 |
111 // R0: new growable array object start as a tagged pointer. | 111 // R0: new growable array object start as a tagged pointer. |
112 // Store the type argument field in the growable array object. | 112 // Store the type argument field in the growable array object. |
113 __ ldr(R1, Address(SP, kTypeArgumentsOffset)); // Type argument. | 113 __ ldr(R1, Address(SP, kTypeArgumentsOffset)); // Type argument. |
114 __ InitializeFieldNoBarrier( | 114 __ StoreIntoObjectNoBarrier( |
115 R0, | 115 R0, |
116 FieldAddress(R0, GrowableObjectArray::type_arguments_offset()), | 116 FieldAddress(R0, GrowableObjectArray::type_arguments_offset()), |
117 R1); | 117 R1); |
118 | 118 |
119 // Set the length field in the growable array object to 0. | 119 // Set the length field in the growable array object to 0. |
120 __ LoadImmediate(R1, 0); | 120 __ LoadImmediate(R1, 0); |
121 __ InitializeFieldNoBarrier( | 121 __ StoreIntoObjectNoBarrier( |
122 R0, | 122 R0, |
123 FieldAddress(R0, GrowableObjectArray::length_offset()), | 123 FieldAddress(R0, GrowableObjectArray::length_offset()), |
124 R1); | 124 R1); |
125 __ Ret(); // Returns the newly allocated object in R0. | 125 __ Ret(); // Returns the newly allocated object in R0. |
126 | 126 |
127 __ Bind(&fall_through); | 127 __ Bind(&fall_through); |
128 } | 128 } |
129 | 129 |
130 | 130 |
131 // Add an element to growable array if it doesn't need to grow, otherwise | 131 // Add an element to growable array if it doesn't need to grow, otherwise |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid)); \ | 220 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid)); \ |
221 __ orr(R3, R3, Operand(TMP)); \ | 221 __ orr(R3, R3, Operand(TMP)); \ |
222 __ str(R3, FieldAddress(R0, type_name::tags_offset())); /* Tags. */ \ | 222 __ str(R3, FieldAddress(R0, type_name::tags_offset())); /* Tags. */ \ |
223 } \ | 223 } \ |
224 /* Set the length field. */ \ | 224 /* Set the length field. */ \ |
225 /* R0: new object start as a tagged pointer. */ \ | 225 /* R0: new object start as a tagged pointer. */ \ |
226 /* R1: new object end address. */ \ | 226 /* R1: new object end address. */ \ |
227 /* R2: allocation size. */ \ | 227 /* R2: allocation size. */ \ |
228 /* R4: allocation stats address. */ \ | 228 /* R4: allocation stats address. */ \ |
229 __ ldr(R3, Address(SP, kArrayLengthStackOffset)); /* Array length. */ \ | 229 __ ldr(R3, Address(SP, kArrayLengthStackOffset)); /* Array length. */ \ |
230 __ InitializeFieldNoBarrier(R0, \ | 230 __ StoreIntoObjectNoBarrier(R0, \ |
231 FieldAddress(R0, type_name::length_offset()), \ | 231 FieldAddress(R0, type_name::length_offset()), \ |
232 R3); \ | 232 R3); \ |
233 /* Initialize all array elements to 0. */ \ | 233 /* Initialize all array elements to 0. */ \ |
234 /* R0: new object start as a tagged pointer. */ \ | 234 /* R0: new object start as a tagged pointer. */ \ |
235 /* R1: new object end address. */ \ | 235 /* R1: new object end address. */ \ |
236 /* R2: allocation size. */ \ | 236 /* R2: allocation size. */ \ |
237 /* R3: iterator which initially points to the start of the variable */ \ | 237 /* R3: iterator which initially points to the start of the variable */ \ |
238 /* R4: allocation stats address */ \ | 238 /* R4: allocation stats address */ \ |
239 /* R8, R9: zero. */ \ | 239 /* R8, R9: zero. */ \ |
240 /* data area to be initialized. */ \ | 240 /* data area to be initialized. */ \ |
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 __ mov(R3, Operand(0), HI); | 1869 __ mov(R3, Operand(0), HI); |
1870 | 1870 |
1871 // Get the class index and insert it into the tags. | 1871 // Get the class index and insert it into the tags. |
1872 // R3: size and bit tags. | 1872 // R3: size and bit tags. |
1873 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid)); | 1873 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid)); |
1874 __ orr(R3, R3, Operand(TMP)); | 1874 __ orr(R3, R3, Operand(TMP)); |
1875 __ str(R3, FieldAddress(R0, String::tags_offset())); // Store tags. | 1875 __ str(R3, FieldAddress(R0, String::tags_offset())); // Store tags. |
1876 } | 1876 } |
1877 | 1877 |
1878 // Set the length field using the saved length (R8). | 1878 // Set the length field using the saved length (R8). |
1879 __ InitializeFieldNoBarrier(R0, | 1879 __ StoreIntoObjectNoBarrier(R0, |
1880 FieldAddress(R0, String::length_offset()), | 1880 FieldAddress(R0, String::length_offset()), |
1881 R8); | 1881 R8); |
1882 // Clear hash. | 1882 // Clear hash. |
1883 __ LoadImmediate(TMP, 0); | 1883 __ LoadImmediate(TMP, 0); |
1884 __ InitializeFieldNoBarrier(R0, | 1884 __ StoreIntoObjectNoBarrier(R0, |
1885 FieldAddress(R0, String::hash_offset()), | 1885 FieldAddress(R0, String::hash_offset()), |
1886 TMP); | 1886 TMP); |
1887 | 1887 |
1888 NOT_IN_PRODUCT(__ IncrementAllocationStatsWithSize(R4, R2, space)); | 1888 NOT_IN_PRODUCT(__ IncrementAllocationStatsWithSize(R4, R2, space)); |
1889 __ b(ok); | 1889 __ b(ok); |
1890 | 1890 |
1891 __ Bind(&fail); | 1891 __ Bind(&fail); |
1892 __ b(failure); | 1892 __ b(failure); |
1893 } | 1893 } |
1894 | 1894 |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2127 __ ldr(R0, Address(R0, TimelineStream::enabled_offset())); | 2127 __ ldr(R0, Address(R0, TimelineStream::enabled_offset())); |
2128 __ cmp(R0, Operand(0)); | 2128 __ cmp(R0, Operand(0)); |
2129 __ LoadObject(R0, Bool::True(), NE); | 2129 __ LoadObject(R0, Bool::True(), NE); |
2130 __ LoadObject(R0, Bool::False(), EQ); | 2130 __ LoadObject(R0, Bool::False(), EQ); |
2131 __ Ret(); | 2131 __ Ret(); |
2132 } | 2132 } |
2133 | 2133 |
2134 } // namespace dart | 2134 } // namespace dart |
2135 | 2135 |
2136 #endif // defined TARGET_ARCH_ARM | 2136 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |