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

Unified Diff: runtime/vm/raw_object.h

Issue 2176803003: Add new atomic operations and use them in two places. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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/os_thread.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « runtime/vm/os_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698