Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: runtime/vm/intrinsifier_arm.cc

Issue 841343002: ARM port of r42723. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 Label fall_through; 110 Label fall_through;
111 111
112 // Try allocating in new space. 112 // Try allocating in new space.
113 const Class& cls = Class::Handle( 113 const Class& cls = Class::Handle(
114 Isolate::Current()->object_store()->growable_object_array_class()); 114 Isolate::Current()->object_store()->growable_object_array_class());
115 __ TryAllocate(cls, &fall_through, R0, R1); 115 __ TryAllocate(cls, &fall_through, R0, R1);
116 116
117 // Store backing array object in growable array object. 117 // Store backing array object in growable array object.
118 __ ldr(R1, Address(SP, kArrayOffset)); // Data argument. 118 __ ldr(R1, Address(SP, kArrayOffset)); // Data argument.
119 // R0 is new, no barrier needed. 119 // R0 is new, no barrier needed.
120 __ StoreIntoObjectNoBarrier( 120 __ InitializeFieldNoBarrier(
121 R0, 121 R0,
122 FieldAddress(R0, GrowableObjectArray::data_offset()), 122 FieldAddress(R0, GrowableObjectArray::data_offset()),
123 R1); 123 R1);
124 124
125 // R0: new growable array object start as a tagged pointer. 125 // R0: new growable array object start as a tagged pointer.
126 // Store the type argument field in the growable array object. 126 // Store the type argument field in the growable array object.
127 __ ldr(R1, Address(SP, kTypeArgumentsOffset)); // Type argument. 127 __ ldr(R1, Address(SP, kTypeArgumentsOffset)); // Type argument.
128 __ StoreIntoObjectNoBarrier( 128 __ InitializeFieldNoBarrier(
129 R0, 129 R0,
130 FieldAddress(R0, GrowableObjectArray::type_arguments_offset()), 130 FieldAddress(R0, GrowableObjectArray::type_arguments_offset()),
131 R1); 131 R1);
132 132
133 // Set the length field in the growable array object to 0. 133 // Set the length field in the growable array object to 0.
134 __ LoadImmediate(R1, 0); 134 __ LoadImmediate(R1, 0);
135 __ StoreIntoSmiField(FieldAddress(R0, GrowableObjectArray::length_offset()), 135 __ InitializeFieldNoBarrier(
136 R1); 136 R0,
137 FieldAddress(R0, GrowableObjectArray::length_offset()),
138 R1);
137 __ Ret(); // Returns the newly allocated object in R0. 139 __ Ret(); // Returns the newly allocated object in R0.
138 140
139 __ Bind(&fall_through); 141 __ Bind(&fall_through);
140 } 142 }
141 143
142 144
143 void Intrinsifier::GrowableArrayGetIndexed(Assembler* assembler) { 145 void Intrinsifier::GrowableArrayGetIndexed(Assembler* assembler) {
144 Label fall_through; 146 Label fall_through;
145 147
146 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Index 148 __ ldr(R0, Address(SP, + 0 * kWordSize)); // Index
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid)); \ 324 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid)); \
323 __ orr(R3, R3, Operand(TMP)); \ 325 __ orr(R3, R3, Operand(TMP)); \
324 __ str(R3, FieldAddress(R0, type_name::tags_offset())); /* Tags. */ \ 326 __ str(R3, FieldAddress(R0, type_name::tags_offset())); /* Tags. */ \
325 } \ 327 } \
326 /* Set the length field. */ \ 328 /* Set the length field. */ \
327 /* R0: new object start as a tagged pointer. */ \ 329 /* R0: new object start as a tagged pointer. */ \
328 /* R1: new object end address. */ \ 330 /* R1: new object end address. */ \
329 /* R2: allocation size. */ \ 331 /* R2: allocation size. */ \
330 /* R4: allocation stats address. */ \ 332 /* R4: allocation stats address. */ \
331 __ ldr(R3, Address(SP, kArrayLengthStackOffset)); /* Array length. */ \ 333 __ ldr(R3, Address(SP, kArrayLengthStackOffset)); /* Array length. */ \
332 __ StoreIntoObjectNoBarrier(R0, \ 334 __ InitializeFieldNoBarrier(R0, \
333 FieldAddress(R0, type_name::length_offset()), \ 335 FieldAddress(R0, type_name::length_offset()), \
334 R3); \ 336 R3); \
335 /* Initialize all array elements to 0. */ \ 337 /* Initialize all array elements to 0. */ \
336 /* R0: new object start as a tagged pointer. */ \ 338 /* R0: new object start as a tagged pointer. */ \
337 /* R1: new object end address. */ \ 339 /* R1: new object end address. */ \
338 /* R2: allocation size. */ \ 340 /* R2: allocation size. */ \
339 /* R3: iterator which initially points to the start of the variable */ \ 341 /* R3: iterator which initially points to the start of the variable */ \
340 /* R4: allocation stats address */ \ 342 /* R4: allocation stats address */ \
341 /* R6, R7: zero. */ \ 343 /* R6, R7: zero. */ \
342 /* data area to be initialized. */ \ 344 /* data area to be initialized. */ \
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after
1809 __ mov(R3, Operand(0), HI); 1811 __ mov(R3, Operand(0), HI);
1810 1812
1811 // Get the class index and insert it into the tags. 1813 // Get the class index and insert it into the tags.
1812 // R3: size and bit tags. 1814 // R3: size and bit tags.
1813 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid)); 1815 __ LoadImmediate(TMP, RawObject::ClassIdTag::encode(cid));
1814 __ orr(R3, R3, Operand(TMP)); 1816 __ orr(R3, R3, Operand(TMP));
1815 __ str(R3, FieldAddress(R0, String::tags_offset())); // Store tags. 1817 __ str(R3, FieldAddress(R0, String::tags_offset())); // Store tags.
1816 } 1818 }
1817 1819
1818 // Set the length field using the saved length (R6). 1820 // Set the length field using the saved length (R6).
1819 __ StoreIntoObjectNoBarrier(R0, 1821 __ InitializeFieldNoBarrier(R0,
1820 FieldAddress(R0, String::length_offset()), 1822 FieldAddress(R0, String::length_offset()),
1821 R6); 1823 R6);
1822 // Clear hash. 1824 // Clear hash.
1823 __ LoadImmediate(TMP, 0); 1825 __ LoadImmediate(TMP, 0);
1824 __ StoreIntoSmiField(FieldAddress(R0, String::hash_offset()), TMP); 1826 __ InitializeFieldNoBarrier(R0,
1827 FieldAddress(R0, String::hash_offset()),
1828 TMP);
1825 1829
1826 __ IncrementAllocationStatsWithSize(R4, R2, cid, space); 1830 __ IncrementAllocationStatsWithSize(R4, R2, cid, space);
1827 __ b(ok); 1831 __ b(ok);
1828 1832
1829 __ Bind(&fail); 1833 __ Bind(&fail);
1830 __ b(failure); 1834 __ b(failure);
1831 } 1835 }
1832 1836
1833 1837
1834 // Arg0: OneByteString (receiver). 1838 // Arg0: OneByteString (receiver).
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 Isolate* isolate = Isolate::Current(); 2062 Isolate* isolate = Isolate::Current();
2059 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate)); 2063 __ LoadImmediate(R1, reinterpret_cast<uword>(isolate));
2060 // Set return value to Isolate::current_tag_. 2064 // Set return value to Isolate::current_tag_.
2061 __ ldr(R0, Address(R1, Isolate::current_tag_offset())); 2065 __ ldr(R0, Address(R1, Isolate::current_tag_offset()));
2062 __ Ret(); 2066 __ Ret();
2063 } 2067 }
2064 2068
2065 } // namespace dart 2069 } // namespace dart
2066 2070
2067 #endif // defined TARGET_ARCH_ARM 2071 #endif // defined TARGET_ARCH_ARM
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698