Chromium Code Reviews| Index: runtime/vm/raw_object.cc |
| =================================================================== |
| --- runtime/vm/raw_object.cc (revision 43879) |
| +++ runtime/vm/raw_object.cc (working copy) |
| @@ -216,6 +216,17 @@ |
| #if defined(DEBUG) |
| uword tags = ptr()->tags_; |
| intptr_t tags_size = SizeTag::decode(tags); |
| + if ((instance_size > tags_size && tags_size > 0) && (class_id == kArrayCid)) { |
|
Ivan Posva
2015/02/19 22:43:56
"if ((class_id == kArrayCid) && ...) {"
is a bit
koda
2015/02/19 22:48:49
Agreed.
Slightly less efficient, but OK since thi
|
| + // TODO(22501): Array::MakeArray could be in the process of shrinking |
| + // the array (see comment therein). Wait a millisecond and try again. |
| + int retries_remaining = 1000; // ... but not forever. |
| + do { |
| + OS::Sleep(1); |
| + const RawArray* raw_array = reinterpret_cast<const RawArray*>(this); |
| + intptr_t array_length = Smi::Value(raw_array->ptr()->length_); |
| + instance_size = Array::InstanceSize(array_length); |
|
Ivan Posva
2015/02/19 22:43:56
Might need a comment why you are only reloading th
koda
2015/02/19 22:48:49
Done.
|
| + } while ((instance_size > tags_size) && (--retries_remaining > 0)); |
| + } |
| if ((instance_size != tags_size) && (tags_size != 0)) { |
| FATAL3("Size mismatch: %" Pd " from class vs %" Pd " from tags %" Px "\n", |
| instance_size, tags_size, tags); |