Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(621)

Side by Side Diff: runtime/vm/assembler_arm64.cc

Issue 2912863006: Inline instance object hash code into object header on 64 bit. (Closed)
Patch Set: Add assembler tests and other feedback from Ryan Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_arm64_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 uword tags = 0; 1366 uint32_t 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.
1370 LoadImmediate(TMP, tags); 1372 LoadImmediate(TMP, tags);
1371 StoreFieldToOffset(TMP, instance_reg, Object::tags_offset()); 1373 StoreFieldToOffset(TMP, instance_reg, Object::tags_offset());
1372 } else { 1374 } else {
1373 b(failure); 1375 b(failure);
1374 } 1376 }
1375 } 1377 }
1376 1378
1377 1379
1378 void Assembler::TryAllocateArray(intptr_t cid, 1380 void Assembler::TryAllocateArray(intptr_t cid,
1379 intptr_t instance_size, 1381 intptr_t instance_size,
(...skipping 23 matching lines...) Expand all
1403 1405
1404 // Successfully allocated the object(s), now update top to point to 1406 // Successfully allocated the object(s), now update top to point to
1405 // next object start and initialize the object. 1407 // next object start and initialize the object.
1406 str(end_address, Address(temp1, Heap::TopOffset(space))); 1408 str(end_address, Address(temp1, Heap::TopOffset(space)));
1407 add(instance, instance, Operand(kHeapObjectTag)); 1409 add(instance, instance, Operand(kHeapObjectTag));
1408 LoadImmediate(temp2, instance_size); 1410 LoadImmediate(temp2, instance_size);
1409 NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, temp2, space)); 1411 NOT_IN_PRODUCT(UpdateAllocationStatsWithSize(cid, temp2, space));
1410 1412
1411 // Initialize the tags. 1413 // Initialize the tags.
1412 // instance: new object start as a tagged pointer. 1414 // instance: new object start as a tagged pointer.
1413 uword tags = 0; 1415 uint32_t tags = 0;
1414 tags = RawObject::ClassIdTag::update(cid, tags); 1416 tags = RawObject::ClassIdTag::update(cid, tags);
1415 tags = RawObject::SizeTag::update(instance_size, tags); 1417 tags = RawObject::SizeTag::update(instance_size, tags);
1418 // Extends the 32 bit tags with zeros, which is the uninitialized
1419 // hash code.
1416 LoadImmediate(temp2, tags); 1420 LoadImmediate(temp2, tags);
1417 str(temp2, FieldAddress(instance, Array::tags_offset())); // Store tags. 1421 str(temp2, FieldAddress(instance, Array::tags_offset())); // Store tags.
1418 } else { 1422 } else {
1419 b(failure); 1423 b(failure);
1420 } 1424 }
1421 } 1425 }
1422 1426
1423 1427
1424 Address Assembler::ElementAddressForIntIndex(bool is_external, 1428 Address Assembler::ElementAddressForIntIndex(bool is_external,
1425 intptr_t cid, 1429 intptr_t cid,
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 str(tmp, Address(addr, 7), kUnsignedByte); 1575 str(tmp, Address(addr, 7), kUnsignedByte);
1572 if (sz == kDoubleWord) { 1576 if (sz == kDoubleWord) {
1573 return; 1577 return;
1574 } 1578 }
1575 UNIMPLEMENTED(); 1579 UNIMPLEMENTED();
1576 } 1580 }
1577 1581
1578 } // namespace dart 1582 } // namespace dart
1579 1583
1580 #endif // defined TARGET_ARCH_ARM64 1584 #endif // defined TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « runtime/vm/assembler_arm64.h ('k') | runtime/vm/assembler_arm64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698