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

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: rework how we invalidate background compiled code 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/object.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..0f6491243d6b2290c0fca9d0211b0b81cefddd0d 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -3125,10 +3125,19 @@ 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 {
- ASSERT(Thread::Current()->IsMutatorThread());
+#if defined(DEGUG)
+ Thread* thread = Thread::Current();
+ ASSERT(!IsOriginal() || thread->IsMutator() || thread->IsAtSafepoint());
+#endif
StoreNonPointer(&raw_ptr()->guarded_cid_, cid);
}
static intptr_t guarded_cid_offset() {
@@ -3213,6 +3222,10 @@ class Field : public Object {
// Deoptimize all dependent code objects.
void DeoptimizeDependentCode() const;
+ // Used by background compiler to check consistency of field copy with its
+ // original.
+ bool IsConsistentWith(const Field& field) const;
+
bool IsUninitialized() const;
void EvaluateInitializer() const;
« no previous file with comments | « runtime/vm/jit_optimizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698