Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 269253aef321b781c93fbaef4c4483d02f72299e..6b4264b12231f0fa4e575757e107c4e653bbea6e 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -1826,7 +1826,9 @@ RawObject* Object::Allocate(intptr_t cls_id, |
ASSERT(Utils::IsAligned(size, kObjectAlignment)); |
Thread* thread = Thread::Current(); |
Isolate* isolate = thread->isolate(); |
- ASSERT(isolate->no_callback_scope_depth() == 0); |
+ // New space allocation allowed only in mutator thread (Dart thread); |
+ ASSERT(isolate->MutatorThreadIsCurrentThread() || (space != Heap::kNew)); |
+ ASSERT(thread->no_callback_scope_depth() == 0); |
Heap* heap = isolate->heap(); |
uword address = heap->Allocate(size, space); |