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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 2965723002: VM: Reland Inline instance object hash code into object header on 64bit. (Closed)
Patch Set: Fix snapshot incompatibility that sank Flutter Gallery 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/assembler_x64.cc
diff --git a/runtime/vm/assembler_x64.cc b/runtime/vm/assembler_x64.cc
index 341a2e6efdfab62e6491a4eefc65a473ae437c12..0a3f6dcfa91a6fcb76c0bdeb4b34bac9327fffad 100644
--- a/runtime/vm/assembler_x64.cc
+++ b/runtime/vm/assembler_x64.cc
@@ -3433,10 +3433,12 @@ void Assembler::TryAllocate(const Class& cls,
NOT_IN_PRODUCT(UpdateAllocationStats(cls.id(), space));
ASSERT(instance_size >= kHeapObjectTag);
AddImmediate(instance_reg, Immediate(kHeapObjectTag - instance_size));
- uword tags = 0;
+ uint32_t tags = 0;
tags = RawObject::SizeTag::update(instance_size, tags);
ASSERT(cls.id() != kIllegalCid);
tags = RawObject::ClassIdTag::update(cls.id(), tags);
+ // Extends the 32 bit tags with zeros, which is the uninitialized
+ // hash code.
MoveImmediate(FieldAddress(instance_reg, Object::tags_offset()),
Immediate(tags));
} else {
@@ -3480,9 +3482,11 @@ void Assembler::TryAllocateArray(intptr_t cid,
// Initialize the tags.
// instance: new object start as a tagged pointer.
- uword tags = 0;
+ uint32_t tags = 0;
tags = RawObject::ClassIdTag::update(cid, tags);
tags = RawObject::SizeTag::update(instance_size, tags);
+ // Extends the 32 bit tags with zeros, which is the uninitialized
+ // hash code.
movq(FieldAddress(instance, Array::tags_offset()), Immediate(tags));
} else {
jmp(failure);

Powered by Google App Engine
This is Rietveld 408576698