Index: runtime/vm/raw_object.h |
diff --git a/runtime/vm/raw_object.h b/runtime/vm/raw_object.h |
index 19622b7001b385c6e170d2cd36799f0d40b6776b..aefed02a1605615208b9fbab5d3c6d5d63750011 100644 |
--- a/runtime/vm/raw_object.h |
+++ b/runtime/vm/raw_object.h |
@@ -581,6 +581,18 @@ CLASS_LIST_TYPED_DATA(DEFINE_IS_CID) |
} |
} |
+ template<typename type> |
+ void AtomicStorePointer(type const* addr, type value) { |
+ AtomicOperations::StoreRelease(const_cast<type*>(addr), value); |
+ // Filter stores based on source and target. |
+ if (!value->IsHeapObject()) return; |
+ if (value->IsNewObject() && this->IsOldObject() && |
+ !this->IsRemembered()) { |
+ this->SetRememberedBit(); |
+ Thread::Current()->StoreBufferAddObject(this); |
+ } |
+ } |
+ |
// Use for storing into an explicitly Smi-typed field of an object |
// (i.e., both the previous and new value are Smis). |
void StoreSmi(RawSmi* const* addr, RawSmi* value) { |