diff --git a/runtime/vm/compiler/frontend/bytecode_reader.cc b/runtime/vm/compiler/frontend/bytecode_reader.cc index 0e9c427a89d..587eb27f41d 100644 --- a/runtime/vm/compiler/frontend/bytecode_reader.cc +++ b/runtime/vm/compiler/frontend/bytecode_reader.cc @@ -57,6 +57,8 @@ void BytecodeMetadataHelper::ReadMetadata(const Function& function) { return; } + ASSERT(Thread::Current()->IsMutatorThread()); + AlternativeReadingScope alt(&helper_->reader_, &H.metadata_payloads(), md_offset); @@ -766,6 +768,7 @@ RawError* BytecodeReader::ReadFunctionBytecode(Thread* thread, ASSERT(!FLAG_precompiled_mode); ASSERT(!function.HasBytecode()); ASSERT(thread->sticky_error() == Error::null()); + ASSERT(Thread::Current()->IsMutatorThread()); LongJumpScope jump; if (setjmp(*jump.Set()) == 0) { diff --git a/runtime/vm/compiler/jit/compiler.cc b/runtime/vm/compiler/jit/compiler.cc index e90f251eb96..83c5fe9e5d3 100644 --- a/runtime/vm/compiler/jit/compiler.cc +++ b/runtime/vm/compiler/jit/compiler.cc @@ -228,6 +228,7 @@ CompilationPipeline* CompilationPipeline::New(Zone* zone, // Compile a function. Should call only if the function has not been compiled. // Arg0: function object. DEFINE_RUNTIME_ENTRY(CompileFunction, 1) { + ASSERT(thread->IsMutatorThread()); const Function& function = Function::CheckedHandle(arguments.ArgAt(0)); Object& result = Object::Handle(zone); @@ -1329,6 +1330,7 @@ RawError* Compiler::CompileAllFunctions(const Class& cls) { RawError* Compiler::ReadAllBytecode(const Class& cls) { Thread* thread = Thread::Current(); + ASSERT(thread->IsMutatorThread()); Zone* zone = thread->zone(); Error& error = Error::Handle(zone, cls.EnsureIsFinalized(thread)); ASSERT(error.IsNull()); @@ -1370,6 +1372,7 @@ RawObject* Compiler::EvaluateStaticInitializer(const Field& field) { LongJumpScope jump; if (setjmp(*jump.Set()) == 0) { Thread* const thread = Thread::Current(); + ASSERT(thread->IsMutatorThread()); NoOOBMessageScope no_msg_scope(thread); NoReloadScope no_reload_scope(thread->isolate(), thread); // Under lazy compilation initializer has not yet been created, so create diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index f6bf794bba9..44f95e8d121 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -12505,6 +12505,7 @@ RawError* Library::CompileAll() { #if !defined(DART_PRECOMPILED_RUNTIME) RawError* Library::ReadAllBytecode() { Thread* thread = Thread::Current(); + ASSERT(thread->IsMutatorThread()); Zone* zone = thread->zone(); Error& error = Error::Handle(zone); const GrowableObjectArray& libs = GrowableObjectArray::Handle(