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

Unified Diff: runtime/vm/stub_code_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_arm64.cc
diff --git a/runtime/vm/stub_code_arm64.cc b/runtime/vm/stub_code_arm64.cc
index 71ebe70d2f6f10ebe3a6d1fc45b8b4e645f5d0cb..1a38e96ba8607101d405a7b5e03664955a23184a 100644
--- a/runtime/vm/stub_code_arm64.cc
+++ b/runtime/vm/stub_code_arm64.cc
@@ -1089,7 +1089,7 @@ void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
Label add_to_buffer;
// Check whether this object has already been remembered. Skip adding to the
// store buffer if the object is in the store buffer already.
- __ LoadFieldFromOffset(TMP, R0, Object::tags_offset());
+ __ LoadFieldFromOffset(TMP, R0, Object::tags_offset(), kWord);
__ tsti(TMP, Immediate(1 << RawObject::kRememberedBit));
__ b(&add_to_buffer, EQ);
__ ret();
@@ -1104,11 +1104,13 @@ void StubCode::GenerateUpdateStoreBufferStub(Assembler* assembler) {
ASSERT(Object::tags_offset() == 0);
__ sub(R3, R0, Operand(kHeapObjectTag));
// R3: Untagged address of header word (ldxr/stxr do not support offsets).
+ // Note that we use 32 bit operations here to match the size of the
+ // background sweeper which is also manipulating this 32 bit word.
Label retry;
__ Bind(&retry);
- __ ldxr(R2, R3);
+ __ ldxr(R2, R3, kWord);
__ orri(R2, R2, Immediate(1 << RawObject::kRememberedBit));
- __ stxr(R1, R2, R3);
+ __ stxr(R1, R2, R3, kWord);
__ cmp(R1, Operand(1));
__ b(&retry, EQ);
@@ -1195,11 +1197,12 @@ void StubCode::GenerateAllocationStubForClass(Assembler* assembler,
// R3: next object start.
// R1: 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);
__ LoadImmediate(R0, tags);
+ // 64 bit store also zeros the hash_field.
__ StoreToOffset(R0, R2, Instance::tags_offset());
// Initialize the remaining words of the object.
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698