diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index 748802647c3..89c1cc2d22f 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -15053,6 +15053,7 @@ void Code::NotifyCodeObservers(const Function& function, const Code& code, bool optimized) { #if !defined(PRODUCT) + ASSERT(!function.IsNull()); ASSERT(!Thread::Current()->IsAtSafepoint()); // Calling ToLibNamePrefixedQualifiedCString is very expensive, // try to avoid it. @@ -15067,6 +15068,8 @@ void Code::NotifyCodeObservers(const char* name, const Code& code, bool optimized) { #if !defined(PRODUCT) + ASSERT(name != nullptr); + ASSERT(!code.IsNull()); ASSERT(!Thread::Current()->IsAtSafepoint()); if (CodeObservers::AreActive()) { const auto& instrs = Instructions::Handle(code.instructions()); diff --git a/runtime/vm/stub_code.cc b/runtime/vm/stub_code.cc index c578da0321f..d22df2bce68 100644 --- a/runtime/vm/stub_code.cc +++ b/runtime/vm/stub_code.cc @@ -210,7 +210,7 @@ RawCode* StubCode::GetAllocationStubForClass(const Class& cls) { // We notify code observers after finalizing the code in order to be // outside a [SafepointOperationScope]. - Code::NotifyCodeObservers(nullptr, stub, /*optimized=*/false); + Code::NotifyCodeObservers(name, stub, /*optimized=*/false); } #ifndef PRODUCT if (FLAG_support_disassembler && FLAG_disassemble_stubs) {