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 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2206 // Set the length field. | 2206 // Set the length field. |
2207 __ StoreIntoObjectNoBarrier(R0, | 2207 __ StoreIntoObjectNoBarrier(R0, |
2208 FieldAddress(R0, Array::length_offset()), | 2208 FieldAddress(R0, Array::length_offset()), |
2209 kLengthReg); | 2209 kLengthReg); |
2210 | 2210 |
2211 // Initialize all array elements to raw_null. | 2211 // Initialize all array elements to raw_null. |
2212 // R0: new object start as a tagged pointer. | 2212 // R0: new object start as a tagged pointer. |
2213 // R3: new object end address. | 2213 // R3: new object end address. |
2214 // R8: iterator which initially points to the start of the variable | 2214 // R8: iterator which initially points to the start of the variable |
2215 // data area to be initialized. | 2215 // data area to be initialized. |
2216 // R6, R7: null | 2216 // R6: null |
2217 if (num_elements > 0) { | 2217 if (num_elements > 0) { |
2218 const intptr_t array_size = instance_size - sizeof(RawArray); | 2218 const intptr_t array_size = instance_size - sizeof(RawArray); |
2219 __ LoadImmediate(R6, reinterpret_cast<intptr_t>(Object::null())); | 2219 __ LoadImmediate(R6, reinterpret_cast<intptr_t>(Object::null())); |
2220 __ mov(R7, Operand(R6)); | 2220 if (num_elements >= 2) { |
2221 __ mov(R7, Operand(R6)); | |
2222 } | |
Ivan Posva
2014/12/08 19:27:56
Can you make sure to clobber R7 with RAW_NULL (0x1
koda
2014/12/08 22:23:42
Done.
| |
2221 __ AddImmediate(R8, R0, sizeof(RawArray) - kHeapObjectTag); | 2223 __ AddImmediate(R8, R0, sizeof(RawArray) - kHeapObjectTag); |
2222 if (array_size < (kInlineArraySize * kWordSize)) { | 2224 if (array_size < (kInlineArraySize * kWordSize)) { |
2223 __ InitializeFieldsNoBarrierUnrolled(R0, R8, num_elements, R6, R7); | 2225 __ InitializeFieldsNoBarrierUnrolled(R0, R8, 0, num_elements * kWordSize, |
2226 R6, R7); | |
2224 } else { | 2227 } else { |
2225 __ InitializeFieldsNoBarrier(R0, R8, R3, R6, R7); | 2228 __ InitializeFieldsNoBarrier(R0, R8, R3, R6, R7); |
2226 } | 2229 } |
2227 } | 2230 } |
2228 __ b(done); | 2231 __ b(done); |
2229 } | 2232 } |
2230 | 2233 |
2231 | 2234 |
2232 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2235 void CreateArrayInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2233 const Register kLengthReg = R2; | 2236 const Register kLengthReg = R2; |
(...skipping 4502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6736 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); | 6739 compiler->GenerateCall(token_pos(), &label, stub_kind_, locs()); |
6737 #if defined(DEBUG) | 6740 #if defined(DEBUG) |
6738 __ LoadImmediate(R4, kInvalidObjectPointer); | 6741 __ LoadImmediate(R4, kInvalidObjectPointer); |
6739 __ LoadImmediate(R5, kInvalidObjectPointer); | 6742 __ LoadImmediate(R5, kInvalidObjectPointer); |
6740 #endif | 6743 #endif |
6741 } | 6744 } |
6742 | 6745 |
6743 } // namespace dart | 6746 } // namespace dart |
6744 | 6747 |
6745 #endif // defined TARGET_ARCH_ARM | 6748 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |