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" // NOLINT | 5 #include "vm/globals.h" // NOLINT |
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/longjump.h" | 9 #include "vm/longjump.h" |
10 #include "vm/runtime_entry.h" | 10 #include "vm/runtime_entry.h" |
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
992 // Fail if heap end unsigned less than or equal to instance_reg. | 992 // Fail if heap end unsigned less than or equal to instance_reg. |
993 BranchUnsignedLessEqual(TMP, instance_reg, failure); | 993 BranchUnsignedLessEqual(TMP, instance_reg, failure); |
994 | 994 |
995 // Successfully allocated the object, now update top to point to | 995 // Successfully allocated the object, now update top to point to |
996 // next object start and store the class in the class field of object. | 996 // next object start and store the class in the class field of object. |
997 sw(instance_reg, Address(temp_reg, Heap::TopOffset(space))); | 997 sw(instance_reg, Address(temp_reg, Heap::TopOffset(space))); |
998 | 998 |
999 ASSERT(instance_size >= kHeapObjectTag); | 999 ASSERT(instance_size >= kHeapObjectTag); |
1000 AddImmediate(instance_reg, -instance_size + kHeapObjectTag); | 1000 AddImmediate(instance_reg, -instance_size + kHeapObjectTag); |
1001 NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), temp_reg, space)); | 1001 NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), temp_reg, space)); |
1002 uint32_t tags = 0; | 1002 uword tags = 0; |
1003 tags = RawObject::SizeTag::update(instance_size, tags); | 1003 tags = RawObject::SizeTag::update(instance_size, tags); |
1004 ASSERT(cls.id() != kIllegalCid); | 1004 ASSERT(cls.id() != kIllegalCid); |
1005 tags = RawObject::ClassIdTag::update(cls.id(), tags); | 1005 tags = RawObject::ClassIdTag::update(cls.id(), tags); |
1006 LoadImmediate(TMP, tags); | 1006 LoadImmediate(TMP, tags); |
1007 sw(TMP, FieldAddress(instance_reg, Object::tags_offset())); | 1007 sw(TMP, FieldAddress(instance_reg, Object::tags_offset())); |
1008 } else { | 1008 } else { |
1009 b(failure); | 1009 b(failure); |
1010 } | 1010 } |
1011 } | 1011 } |
1012 | 1012 |
(...skipping 29 matching lines...) Expand all Loading... |
1042 | 1042 |
1043 // Successfully allocated the object(s), now update top to point to | 1043 // Successfully allocated the object(s), now update top to point to |
1044 // next object start and initialize the object. | 1044 // next object start and initialize the object. |
1045 sw(end_address, Address(temp1, Heap::TopOffset(space))); | 1045 sw(end_address, Address(temp1, Heap::TopOffset(space))); |
1046 addiu(instance, instance, Immediate(kHeapObjectTag)); | 1046 addiu(instance, instance, Immediate(kHeapObjectTag)); |
1047 LoadImmediate(temp1, instance_size); | 1047 LoadImmediate(temp1, instance_size); |
1048 NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, temp1, temp2, space)); | 1048 NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, temp1, temp2, space)); |
1049 | 1049 |
1050 // Initialize the tags. | 1050 // Initialize the tags. |
1051 // instance: new object start as a tagged pointer. | 1051 // instance: new object start as a tagged pointer. |
1052 uint32_t tags = 0; | 1052 uword tags = 0; |
1053 tags = RawObject::ClassIdTag::update(cid, tags); | 1053 tags = RawObject::ClassIdTag::update(cid, tags); |
1054 tags = RawObject::SizeTag::update(instance_size, tags); | 1054 tags = RawObject::SizeTag::update(instance_size, tags); |
1055 LoadImmediate(temp1, tags); | 1055 LoadImmediate(temp1, tags); |
1056 sw(temp1, FieldAddress(instance, Array::tags_offset())); // Store tags. | 1056 sw(temp1, FieldAddress(instance, Array::tags_offset())); // Store tags. |
1057 } else { | 1057 } else { |
1058 b(failure); | 1058 b(failure); |
1059 } | 1059 } |
1060 } | 1060 } |
1061 | 1061 |
1062 | 1062 |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 Label stop; | 1401 Label stop; |
1402 b(&stop); | 1402 b(&stop); |
1403 Emit(reinterpret_cast<int32_t>(message)); | 1403 Emit(reinterpret_cast<int32_t>(message)); |
1404 Bind(&stop); | 1404 Bind(&stop); |
1405 break_(Instr::kStopMessageCode); | 1405 break_(Instr::kStopMessageCode); |
1406 } | 1406 } |
1407 | 1407 |
1408 } // namespace dart | 1408 } // namespace dart |
1409 | 1409 |
1410 #endif // defined TARGET_ARCH_MIPS | 1410 #endif // defined TARGET_ARCH_MIPS |
OLD | NEW |