OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
7 | 7 |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/longjump.h" | 10 #include "vm/longjump.h" |
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 b(failure, LS); | 1356 b(failure, LS); |
1357 | 1357 |
1358 // Successfully allocated the object, now update top to point to | 1358 // Successfully allocated the object, now update top to point to |
1359 // next object start and store the class in the class field of object. | 1359 // next object start and store the class in the class field of object. |
1360 str(instance_reg, Address(temp_reg, Heap::TopOffset(space))); | 1360 str(instance_reg, Address(temp_reg, Heap::TopOffset(space))); |
1361 | 1361 |
1362 ASSERT(instance_size >= kHeapObjectTag); | 1362 ASSERT(instance_size >= kHeapObjectTag); |
1363 AddImmediate(instance_reg, -instance_size + kHeapObjectTag); | 1363 AddImmediate(instance_reg, -instance_size + kHeapObjectTag); |
1364 NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), space)); | 1364 NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), space)); |
1365 | 1365 |
1366 uint32_t tags = 0; | 1366 uword tags = 0; |
1367 tags = RawObject::SizeTag::update(instance_size, tags); | 1367 tags = RawObject::SizeTag::update(instance_size, tags); |
1368 ASSERT(cls.id() != kIllegalCid); | 1368 ASSERT(cls.id() != kIllegalCid); |
1369 tags = RawObject::ClassIdTag::update(cls.id(), tags); | 1369 tags = RawObject::ClassIdTag::update(cls.id(), tags); |
1370 // Extends the 32 bit tags with zeros, which is the uninitialized | |
1371 // hash code. | |
1372 LoadImmediate(TMP, tags); | 1370 LoadImmediate(TMP, tags); |
1373 StoreFieldToOffset(TMP, instance_reg, Object::tags_offset()); | 1371 StoreFieldToOffset(TMP, instance_reg, Object::tags_offset()); |
1374 } else { | 1372 } else { |
1375 b(failure); | 1373 b(failure); |
1376 } | 1374 } |
1377 } | 1375 } |
1378 | 1376 |
1379 | 1377 |
1380 void Assembler::TryAllocateArray(intptr_t cid, | 1378 void Assembler::TryAllocateArray(intptr_t cid, |
1381 intptr_t instance_size, | 1379 intptr_t instance_size, |
(...skipping 23 matching lines...) Expand all Loading... |
1405 | 1403 |
1406 // Successfully allocated the object(s), now update top to point to | 1404 // Successfully allocated the object(s), now update top to point to |
1407 // next object start and initialize the object. | 1405 // next object start and initialize the object. |
1408 str(end_address, Address(temp1, Heap::TopOffset(space))); | 1406 str(end_address, Address(temp1, Heap::TopOffset(space))); |
1409 add(instance, instance, Operand(kHeapObjectTag)); | 1407 add(instance, instance, Operand(kHeapObjectTag)); |
1410 LoadImmediate(temp2, instance_size); | 1408 LoadImmediate(temp2, instance_size); |
1411 NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, temp2, space)); | 1409 NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, temp2, space)); |
1412 | 1410 |
1413 // Initialize the tags. | 1411 // Initialize the tags. |
1414 // instance: new object start as a tagged pointer. | 1412 // instance: new object start as a tagged pointer. |
1415 uint32_t tags = 0; | 1413 uword tags = 0; |
1416 tags = RawObject::ClassIdTag::update(cid, tags); | 1414 tags = RawObject::ClassIdTag::update(cid, tags); |
1417 tags = RawObject::SizeTag::update(instance_size, tags); | 1415 tags = RawObject::SizeTag::update(instance_size, tags); |
1418 // Extends the 32 bit tags with zeros, which is the uninitialized | |
1419 // hash code. | |
1420 LoadImmediate(temp2, tags); | 1416 LoadImmediate(temp2, tags); |
1421 str(temp2, FieldAddress(instance, Array::tags_offset())); // Store tags. | 1417 str(temp2, FieldAddress(instance, Array::tags_offset())); // Store tags. |
1422 } else { | 1418 } else { |
1423 b(failure); | 1419 b(failure); |
1424 } | 1420 } |
1425 } | 1421 } |
1426 | 1422 |
1427 | 1423 |
1428 Address Assembler::ElementAddressForIntIndex(bool is_external, | 1424 Address Assembler::ElementAddressForIntIndex(bool is_external, |
1429 intptr_t cid, | 1425 intptr_t cid, |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1575 str(tmp, Address(addr, 7), kUnsignedByte); | 1571 str(tmp, Address(addr, 7), kUnsignedByte); |
1576 if (sz == kDoubleWord) { | 1572 if (sz == kDoubleWord) { |
1577 return; | 1573 return; |
1578 } | 1574 } |
1579 UNIMPLEMENTED(); | 1575 UNIMPLEMENTED(); |
1580 } | 1576 } |
1581 | 1577 |
1582 } // namespace dart | 1578 } // namespace dart |
1583 | 1579 |
1584 #endif // defined TARGET_ARCH_ARM64 | 1580 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |