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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 2954453002: VM: Reland Inline instance object hash code into object header on 64bit. (Closed)
Patch Set: Incorporate last minute code review feedback 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 58520becc4e98a7cd200a1bd7678a2281f7c22d3..67a1832ad08cfa12456f29e12328b1232dfad6a9 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -1034,21 +1034,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
@@ -1132,10 +1134,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