| 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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 __ lw(CMPRES1, Address(T0, Scavenger::end_offset())); | 670 __ lw(CMPRES1, Address(T0, Scavenger::end_offset())); |
| 671 __ BranchUnsignedGreaterEqual(T2, CMPRES1, &slow_case); | 671 __ BranchUnsignedGreaterEqual(T2, CMPRES1, &slow_case); |
| 672 | 672 |
| 673 // Successfully allocated the object(s), now update top to point to | 673 // Successfully allocated the object(s), now update top to point to |
| 674 // next object start and initialize the object. | 674 // next object start and initialize the object. |
| 675 // V0: potential new object start. | 675 // V0: potential new object start. |
| 676 // T2: potential next object start. | 676 // T2: potential next object start. |
| 677 // T0: Points to new space object. | 677 // T0: Points to new space object. |
| 678 __ sw(T2, Address(T0, Scavenger::top_offset())); | 678 __ sw(T2, Address(T0, Scavenger::top_offset())); |
| 679 __ addiu(V0, V0, Immediate(kHeapObjectTag)); | 679 __ addiu(V0, V0, Immediate(kHeapObjectTag)); |
| 680 // T1: Size of allocation in bytes. |
| 681 __ subu(T1, T2, V0); |
| 682 __ BumpAllocationCount(Heap::kNew, kArrayCid, T1, T5); |
| 680 | 683 |
| 681 // V0: new object start as a tagged pointer. | 684 // V0: new object start as a tagged pointer. |
| 682 // A0: array element type. | 685 // A0: array element type. |
| 683 // A1: Array length as Smi. | 686 // A1: Array length as Smi. |
| 684 // T2: new object end address. | 687 // T2: new object end address. |
| 685 | 688 |
| 686 // Store the type argument field. | 689 // Store the type argument field. |
| 687 __ StoreIntoObjectNoBarrier( | 690 __ StoreIntoObjectNoBarrier( |
| 688 V0, | 691 V0, |
| 689 FieldAddress(V0, Array::type_arguments_offset()), | 692 FieldAddress(V0, Array::type_arguments_offset()), |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1072 } | 1075 } |
| 1073 | 1076 |
| 1074 // Successfully allocated the object, now update top to point to | 1077 // Successfully allocated the object, now update top to point to |
| 1075 // next object start and initialize the object. | 1078 // next object start and initialize the object. |
| 1076 // V0: new object. | 1079 // V0: new object. |
| 1077 // T1: number of context variables. | 1080 // T1: number of context variables. |
| 1078 // T2: object size. | 1081 // T2: object size. |
| 1079 // T3: next object start. | 1082 // T3: next object start. |
| 1080 __ sw(T3, Address(T5, 0)); | 1083 __ sw(T3, Address(T5, 0)); |
| 1081 __ addiu(V0, V0, Immediate(kHeapObjectTag)); | 1084 __ addiu(V0, V0, Immediate(kHeapObjectTag)); |
| 1085 __ BumpAllocationCount(Heap::kNew, context_class.id(), T2, T5); |
| 1082 | 1086 |
| 1083 // Calculate the size tag. | 1087 // Calculate the size tag. |
| 1084 // V0: new object. | 1088 // V0: new object. |
| 1085 // T1: number of context variables. | 1089 // T1: number of context variables. |
| 1086 // T2: object size. | 1090 // T2: object size. |
| 1087 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; | 1091 const intptr_t shift = RawObject::kSizeTagBit - kObjectAlignmentLog2; |
| 1088 __ LoadImmediate(TMP, RawObject::SizeTag::kMaxSizeTag); | 1092 __ LoadImmediate(TMP, RawObject::SizeTag::kMaxSizeTag); |
| 1089 __ sltu(CMPRES1, TMP, T2); // CMPRES1 = T2 > TMP ? 1 : 0. | 1093 __ sltu(CMPRES1, TMP, T2); // CMPRES1 = T2 > TMP ? 1 : 0. |
| 1090 __ movn(T2, ZR, CMPRES1); // T2 = CMPRES1 != 0 ? 0 : T2. | 1094 __ movn(T2, ZR, CMPRES1); // T2 = CMPRES1 != 0 ? 0 : T2. |
| 1091 __ sll(TMP, T2, shift); // TMP = T2 << shift. | 1095 __ sll(TMP, T2, shift); // TMP = T2 << shift. |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 __ addiu(T4, T4, Immediate(kWordSize)); | 1358 __ addiu(T4, T4, Immediate(kWordSize)); |
| 1355 __ bne(T4, T3, &loop); | 1359 __ bne(T4, T3, &loop); |
| 1356 __ delay_slot()->sw(T7, Address(T4, -kWordSize)); | 1360 __ delay_slot()->sw(T7, Address(T4, -kWordSize)); |
| 1357 __ Bind(&loop_exit); | 1361 __ Bind(&loop_exit); |
| 1358 } | 1362 } |
| 1359 if (is_cls_parameterized) { | 1363 if (is_cls_parameterized) { |
| 1360 // R1: new object type arguments. | 1364 // R1: new object type arguments. |
| 1361 // Set the type arguments in the new object. | 1365 // Set the type arguments in the new object. |
| 1362 __ sw(T1, Address(T2, cls.type_arguments_field_offset())); | 1366 __ sw(T1, Address(T2, cls.type_arguments_field_offset())); |
| 1363 } | 1367 } |
| 1368 __ BumpAllocationCount(Heap::kNew, cls.id(), T5); |
| 1364 // Done allocating and initializing the instance. | 1369 // Done allocating and initializing the instance. |
| 1365 // T2: new object still missing its heap tag. | 1370 // T2: new object still missing its heap tag. |
| 1366 __ Ret(); | 1371 __ Ret(); |
| 1367 __ delay_slot()->addiu(V0, T2, Immediate(kHeapObjectTag)); | 1372 __ delay_slot()->addiu(V0, T2, Immediate(kHeapObjectTag)); |
| 1368 | 1373 |
| 1369 __ Bind(&slow_case); | 1374 __ Bind(&slow_case); |
| 1370 } | 1375 } |
| 1371 if (is_cls_parameterized) { | 1376 if (is_cls_parameterized) { |
| 1372 __ lw(T1, Address(SP, 1 * kWordSize)); | 1377 __ lw(T1, Address(SP, 1 * kWordSize)); |
| 1373 __ lw(T0, Address(SP, 0 * kWordSize)); | 1378 __ lw(T0, Address(SP, 0 * kWordSize)); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 __ lw(CMPRES1, Address(TMP)); | 1448 __ lw(CMPRES1, Address(TMP)); |
| 1444 if (FLAG_use_slow_path) { | 1449 if (FLAG_use_slow_path) { |
| 1445 __ b(&slow_case); | 1450 __ b(&slow_case); |
| 1446 } else { | 1451 } else { |
| 1447 __ BranchUnsignedGreaterEqual(T3, CMPRES1, &slow_case); | 1452 __ BranchUnsignedGreaterEqual(T3, CMPRES1, &slow_case); |
| 1448 } | 1453 } |
| 1449 | 1454 |
| 1450 // Successfully allocated the object, now update top to point to | 1455 // Successfully allocated the object, now update top to point to |
| 1451 // next object start and initialize the object. | 1456 // next object start and initialize the object. |
| 1452 __ sw(T3, Address(T5)); | 1457 __ sw(T3, Address(T5)); |
| 1458 // T3: Size of allocation in bytes. |
| 1459 __ subu(T3, T3, T2); |
| 1460 __ BumpAllocationCount(Heap::kNew, cls.id(), T3, T5); |
| 1453 | 1461 |
| 1454 // T2: new closure object. | 1462 // T2: new closure object. |
| 1455 // T4: new context object (only if is_implicit_closure). | 1463 // T4: new context object (only if is_implicit_closure). |
| 1456 // Set the tags. | 1464 // Set the tags. |
| 1457 uword tags = 0; | 1465 uword tags = 0; |
| 1458 tags = RawObject::SizeTag::update(closure_size, tags); | 1466 tags = RawObject::SizeTag::update(closure_size, tags); |
| 1459 tags = RawObject::ClassIdTag::update(cls.id(), tags); | 1467 tags = RawObject::ClassIdTag::update(cls.id(), tags); |
| 1460 __ LoadImmediate(T0, tags); | 1468 __ LoadImmediate(T0, tags); |
| 1461 __ sw(T0, Address(T2, Instance::tags_offset())); | 1469 __ sw(T0, Address(T2, Instance::tags_offset())); |
| 1462 | 1470 |
| (...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2411 const Register right = T0; | 2419 const Register right = T0; |
| 2412 __ lw(left, Address(SP, 1 * kWordSize)); | 2420 __ lw(left, Address(SP, 1 * kWordSize)); |
| 2413 __ lw(right, Address(SP, 0 * kWordSize)); | 2421 __ lw(right, Address(SP, 0 * kWordSize)); |
| 2414 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); | 2422 GenerateIdenticalWithNumberCheckStub(assembler, left, right, temp1, temp2); |
| 2415 __ Ret(); | 2423 __ Ret(); |
| 2416 } | 2424 } |
| 2417 | 2425 |
| 2418 } // namespace dart | 2426 } // namespace dart |
| 2419 | 2427 |
| 2420 #endif // defined TARGET_ARCH_MIPS | 2428 #endif // defined TARGET_ARCH_MIPS |
| OLD | NEW |