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

Unified Diff: runtime/vm/object.cc

Issue 936393003: Work around race condition in MakeArray for ASSERTs and document assumptions. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 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 | « no previous file | runtime/vm/raw_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 43879)
+++ runtime/vm/object.cc (working copy)
@@ -19179,9 +19179,18 @@
uword new_tags = RawObject::SizeTag::update(used_size, old_tags);
tags = array.CompareAndSwapTags(old_tags, new_tags);
} while (tags != old_tags);
+ // TODO(22501): For the heap to remain walkable by the sweeper, it must
+ // observe the creation of the filler object no later than the new length
+ // of the array. This assumption holds on ia32/x64 or if the CAS above is a
+ // full memory barrier.
+ //
+ // Also, between the CAS of the header above and the SetLength below,
+ // the array is temporarily in an inconsistent state. The header is considered
+ // the overriding source of object size by RawObject::Size, but the ASSERTs
+ // in RawObject::SizeFromClass must handle this special case.
array.SetLength(used_len);
- // Null the GrowableObjectArray, we are removing it's backing array.
+ // Null the GrowableObjectArray, we are removing its backing array.
growable_array.SetLength(0);
growable_array.SetData(Object::empty_array());
« no previous file with comments | « no previous file | runtime/vm/raw_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698