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

Unified Diff: runtime/vm/stub_code_x64.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index cbda5c38f6fd8a561f22b4a9a48b5dab92efa4ec..c032e673491c6be052f1aea438e6fa6429d146d6 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -1033,21 +1033,23 @@ void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
// RDX: Address being stored
Label reload;
__ Bind(&reload);
- __ movq(RAX, FieldAddress(RDX, Object::tags_offset()));
- __ testq(RAX, Immediate(1 << RawObject::kRememberedBit));
+ __ movl(RAX, FieldAddress(RDX, Object::tags_offset()));
+ __ testl(RAX, Immediate(1 << RawObject::kRememberedBit));
__ j(EQUAL, &add_to_buffer, Assembler::kNearJump);
__ popq(RCX);
__ popq(RAX);
__ ret();
// Update the tags that this object has been remembered.
+ // Note that we use 32 bit operations here to match the size of the
+ // background sweeper which is also manipulating this 32 bit word.
// RDX: Address being stored
// RAX: Current tag value
__ Bind(&add_to_buffer);
- __ movq(RCX, RAX);
- __ orq(RCX, Immediate(1 << RawObject::kRememberedBit));
+ __ movl(RCX, RAX);
+ __ orl(RCX, Immediate(1 << RawObject::kRememberedBit));
// Compare the tag word with RAX, update to RCX if unchanged.
- __ LockCmpxchgq(FieldAddress(RDX, Object::tags_offset()), RCX);
+ __ LockCmpxchgl(FieldAddress(RDX, Object::tags_offset()), RCX);
__ j(NOT_EQUAL, &reload);
// Load the StoreBuffer block out of the thread. Then load top_ out of the
@@ -1131,10 +1133,11 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
// RBX: next object start.
// RDX: new object type arguments (if is_cls_parameterized).
// Set the tags.
- 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);
+ // 64 bit store also zeros the identity hash field.
__ movq(Address(RAX, Instance::tags_offset()), Immediate(tags));
__ addq(RAX, Immediate(kHeapObjectTag));
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698