| 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" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null())); | 1158 __ LoadImmediate(R0, reinterpret_cast<intptr_t>(Object::null())); |
| 1159 | 1159 |
| 1160 // R0: raw null. | 1160 // R0: raw null. |
| 1161 // R2: new object start. | 1161 // R2: new object start. |
| 1162 // R3: next object start. | 1162 // R3: next object start. |
| 1163 // R1: new object type arguments (if is_cls_parameterized). | 1163 // R1: new object type arguments (if is_cls_parameterized). |
| 1164 // First try inlining the initialization without a loop. | 1164 // First try inlining the initialization without a loop. |
| 1165 if (instance_size < (kInlineInstanceSize * kWordSize)) { | 1165 if (instance_size < (kInlineInstanceSize * kWordSize)) { |
| 1166 // Check if the object contains any non-header fields. | 1166 // Check if the object contains any non-header fields. |
| 1167 // Small objects are initialized using a consecutive set of writes. | 1167 // Small objects are initialized using a consecutive set of writes. |
| 1168 for (intptr_t current_offset = sizeof(RawObject); | 1168 for (intptr_t current_offset = Instance::NextFieldOffset(); |
| 1169 current_offset < instance_size; | 1169 current_offset < instance_size; |
| 1170 current_offset += kWordSize) { | 1170 current_offset += kWordSize) { |
| 1171 __ StoreToOffset(kWord, R0, R2, current_offset); | 1171 __ StoreToOffset(kWord, R0, R2, current_offset); |
| 1172 } | 1172 } |
| 1173 } else { | 1173 } else { |
| 1174 __ add(R4, R2, ShifterOperand(sizeof(RawObject))); | 1174 __ add(R4, R2, ShifterOperand(Instance::NextFieldOffset())); |
| 1175 // Loop until the whole object is initialized. | 1175 // Loop until the whole object is initialized. |
| 1176 // R0: raw null. | 1176 // R0: raw null. |
| 1177 // R2: new object. | 1177 // R2: new object. |
| 1178 // R3: next object start. | 1178 // R3: next object start. |
| 1179 // R4: next word to be initialized. | 1179 // R4: next word to be initialized. |
| 1180 // R1: new object type arguments (if is_cls_parameterized). | 1180 // R1: new object type arguments (if is_cls_parameterized). |
| 1181 Label init_loop; | 1181 Label init_loop; |
| 1182 Label done; | 1182 Label done; |
| 1183 __ Bind(&init_loop); | 1183 __ Bind(&init_loop); |
| 1184 __ cmp(R4, ShifterOperand(R3)); | 1184 __ cmp(R4, ShifterOperand(R3)); |
| (...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2140 __ ldr(left, Address(SP, 4 * kWordSize)); | 2140 __ ldr(left, Address(SP, 4 * kWordSize)); |
| 2141 __ ldr(right, Address(SP, 3 * kWordSize)); | 2141 __ ldr(right, Address(SP, 3 * kWordSize)); |
| 2142 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); | 2142 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp); |
| 2143 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); | 2143 __ PopList((1 << R0) | (1 << R1) | (1 << R2)); |
| 2144 __ Ret(); | 2144 __ Ret(); |
| 2145 } | 2145 } |
| 2146 | 2146 |
| 2147 } // namespace dart | 2147 } // namespace dart |
| 2148 | 2148 |
| 2149 #endif // defined TARGET_ARCH_ARM | 2149 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |