[vm] Adds mutator thread asserts around bytecode reading
Change-Id: If5ee92e69f04da8c22983ccdb3d6d9006a2010a5 Reviewed-on: https://dart-review.googlesource.com/c/80562 Commit-Queue: Zach Anderson <zra@google.com> Reviewed-by: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
f0a116d339
commit
e9b8e24891
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user