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_MIPS) | 6 #if defined(TARGET_ARCH_MIPS) |
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 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 __ LoadImmediate(T7, reinterpret_cast<intptr_t>(Object::null())); | 1337 __ LoadImmediate(T7, reinterpret_cast<intptr_t>(Object::null())); |
1338 | 1338 |
1339 // Initialize the remaining words of the object. | 1339 // Initialize the remaining words of the object. |
1340 // T2: new object start. | 1340 // T2: new object start. |
1341 // T3: next object start. | 1341 // T3: next object start. |
1342 // T1: new object type arguments (if is_cls_parameterized). | 1342 // T1: new object type arguments (if is_cls_parameterized). |
1343 // First try inlining the initialization without a loop. | 1343 // First try inlining the initialization without a loop. |
1344 if (instance_size < (kInlineInstanceSize * kWordSize)) { | 1344 if (instance_size < (kInlineInstanceSize * kWordSize)) { |
1345 // Check if the object contains any non-header fields. | 1345 // Check if the object contains any non-header fields. |
1346 // Small objects are initialized using a consecutive set of writes. | 1346 // Small objects are initialized using a consecutive set of writes. |
1347 for (intptr_t current_offset = sizeof(RawObject); | 1347 for (intptr_t current_offset = Instance::NextFieldOffset(); |
1348 current_offset < instance_size; | 1348 current_offset < instance_size; |
1349 current_offset += kWordSize) { | 1349 current_offset += kWordSize) { |
1350 __ sw(T7, Address(T2, current_offset)); | 1350 __ sw(T7, Address(T2, current_offset)); |
1351 } | 1351 } |
1352 } else { | 1352 } else { |
1353 __ addiu(T4, T2, Immediate(sizeof(RawObject))); | 1353 __ addiu(T4, T2, Immediate(Instance::NextFieldOffset())); |
1354 // Loop until the whole object is initialized. | 1354 // Loop until the whole object is initialized. |
1355 // T2: new object. | 1355 // T2: new object. |
1356 // T3: next object start. | 1356 // T3: next object start. |
1357 // T4: next word to be initialized. | 1357 // T4: next word to be initialized. |
1358 // T1: new object type arguments (if is_cls_parameterized). | 1358 // T1: new object type arguments (if is_cls_parameterized). |
1359 Label loop, loop_exit; | 1359 Label loop, loop_exit; |
1360 __ BranchUnsignedGreaterEqual(T4, T3, &loop_exit); | 1360 __ BranchUnsignedGreaterEqual(T4, T3, &loop_exit); |
1361 __ Bind(&loop); | 1361 __ Bind(&loop); |
1362 __ addiu(T4, T4, Immediate(kWordSize)); | 1362 __ addiu(T4, T4, Immediate(kWordSize)); |
1363 __ bne(T4, T3, &loop); | 1363 __ bne(T4, T3, &loop); |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2432 __ lw(left, Address(SP, 1 * kWordSize)); | 2432 __ lw(left, Address(SP, 1 * kWordSize)); |
2433 __ lw(temp2, Address(SP, 2 * kWordSize)); | 2433 __ lw(temp2, Address(SP, 2 * kWordSize)); |
2434 __ lw(temp1, Address(SP, 3 * kWordSize)); | 2434 __ lw(temp1, Address(SP, 3 * kWordSize)); |
2435 __ Ret(); | 2435 __ Ret(); |
2436 __ delay_slot()->addiu(SP, SP, Immediate(4 * kWordSize)); | 2436 __ delay_slot()->addiu(SP, SP, Immediate(4 * kWordSize)); |
2437 } | 2437 } |
2438 | 2438 |
2439 } // namespace dart | 2439 } // namespace dart |
2440 | 2440 |
2441 #endif // defined TARGET_ARCH_MIPS | 2441 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |