Chromium Code Reviews| 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() { |