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

Unified Diff: runtime/vm/object.h

Issue 2006793002: VM: Fix race between background compiler and guarded cid update. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/jit_optimizer.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index c5175145f9c47f76577c91c2ab47bd3b531459e4..3c74473b8b64d3a1ff28093c75771afd3b45932b 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -3125,10 +3125,15 @@ class Field : public Object {
// Return class id that any non-null value read from this field is guaranteed
// to have or kDynamicCid if such class id is not known.
// Stores to this field must update this information hence the name.
- intptr_t guarded_cid() const { return raw_ptr()->guarded_cid_; }
+ intptr_t guarded_cid() const {
+#if defined(DEGUG)
+ Thread* thread = Thread::Current();
+ ASSERT(!IsOriginal() || thread->IsMutator() || thread->IsAtSafepoint());
+#endif
+ return raw_ptr()->guarded_cid_;
+ }
void set_guarded_cid(intptr_t cid) const {
Florian Schneider 2016/05/23 19:26:32 Add the same assert as for guarded_cid()?
Vyacheslav Egorov (Google) 2016/05/24 10:57:49 Done.
- ASSERT(Thread::Current()->IsMutatorThread());
StoreNonPointer(&raw_ptr()->guarded_cid_, cid);
}
static intptr_t guarded_cid_offset() {
« no previous file with comments | « runtime/vm/jit_optimizer.cc ('k') | runtime/vm/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698