| 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 2239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2250 __ StoreIntoObjectNoBarrier(R0, | 2250 __ StoreIntoObjectNoBarrier(R0, |
| 2251 FieldAddress(R0, Array::length_offset()), | 2251 FieldAddress(R0, Array::length_offset()), |
| 2252 kLengthReg); | 2252 kLengthReg); |
| 2253 | 2253 |
| 2254 // Initialize all array elements to raw_null. | 2254 // Initialize all array elements to raw_null. |
| 2255 // R0: new object start as a tagged pointer. | 2255 // R0: new object start as a tagged pointer. |
| 2256 // R7: new object end address. | 2256 // R7: new object end address. |
| 2257 // R8: iterator which initially points to the start of the variable | 2257 // R8: iterator which initially points to the start of the variable |
| 2258 // data area to be initialized. | 2258 // data area to be initialized. |
| 2259 // R3: null | 2259 // R3: null |
| 2260 __ LoadImmediate(R3, reinterpret_cast<intptr_t>(Object::null())); | 2260 if (num_elements > 0) { |
| 2261 __ AddImmediate(R8, R0, sizeof(RawArray) - kHeapObjectTag); | 2261 __ LoadImmediate(R3, reinterpret_cast<intptr_t>(Object::null())); |
| 2262 __ AddImmediate(R8, R0, sizeof(RawArray) - kHeapObjectTag); |
| 2262 | 2263 |
| 2263 Label init_loop; | 2264 Label init_loop; |
| 2264 __ Bind(&init_loop); | 2265 __ Bind(&init_loop); |
| 2265 __ cmp(R8, Operand(R7)); | 2266 __ cmp(R8, Operand(R7)); |
| 2266 __ str(R3, Address(R8, 0), CC); | 2267 __ str(R3, Address(R8, 0), CC); |
| 2267 __ AddImmediate(R8, kWordSize, CC); | 2268 __ AddImmediate(R8, kWordSize, CC); |
| 2268 __ b(&init_loop, CC); | 2269 __ b(&init_loop, CC); |
| 2270 } |
| 2269 __ b(done); | 2271 __ b(done); |
| 2270 } | 2272 } |
| 2271 | 2273 |
| 2272 | 2274 |
| 2273 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2275 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 2274 const Register kLengthReg = R2; | 2276 const Register kLengthReg = R2; |
| 2275 const Register kElemTypeReg = R1; | 2277 const Register kElemTypeReg = R1; |
| 2276 const Register kResultReg = R0; | 2278 const Register kResultReg = R0; |
| 2277 | 2279 |
| 2278 ASSERT(locs()->in(kElementTypePos).reg() == kElemTypeReg); | 2280 ASSERT(locs()->in(kElementTypePos).reg() == kElemTypeReg); |
| (...skipping 4333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6612 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 6614 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
| 6613 #if defined(DEBUG) | 6615 #if defined(DEBUG) |
| 6614 __ LoadImmediate(R4, kInvalidObjectPointer); | 6616 __ LoadImmediate(R4, kInvalidObjectPointer); |
| 6615 __ LoadImmediate(R5, kInvalidObjectPointer); | 6617 __ LoadImmediate(R5, kInvalidObjectPointer); |
| 6616 #endif | 6618 #endif |
| 6617 } | 6619 } |
| 6618 | 6620 |
| 6619 } // namespace dart | 6621 } // namespace dart |
| 6620 | 6622 |
| 6621 #endif // defined TARGET_ARCH_ARM | 6623 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |