diff --git a/runtime/vm/custom_isolate_test.cc b/runtime/vm/custom_isolate_test.cc index 21fbaec95f8..278039a604d 100644 --- a/runtime/vm/custom_isolate_test.cc +++ b/runtime/vm/custom_isolate_test.cc @@ -306,7 +306,6 @@ static void CustomIsolateImpl_start(Dart_NativeArguments args) { VM_UNIT_TEST_CASE(CustomIsolates) { bool saved_flag = FLAG_trace_shutdown; FLAG_trace_shutdown = true; - FLAG_verify_handles = true; event_queue = new EventQueue(); Dart_Isolate dart_isolate = TestCase::CreateTestIsolate(); diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index 42021bd0fbe..1f0baa6a676 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -66,7 +66,6 @@ namespace dart { #define Z (T->zone()) DECLARE_FLAG(bool, print_class_table); -DECLARE_FLAG(bool, verify_handles); #if defined(DEBUG) && !defined(DART_PRECOMPILED_RUNTIME) DEFINE_FLAG(bool, check_function_fingerprints, @@ -372,10 +371,6 @@ ObjectPtr Api::UnwrapHandle(Dart_Handle object) { ASSERT(thread->execution_state() == Thread::kThreadInVM); ASSERT(thread->IsMutatorThread()); ASSERT(thread->isolate() != NULL); - ASSERT(!FLAG_verify_handles || thread->IsValidLocalHandle(object) || - thread->isolate()->group()->api_state()->IsActivePersistentHandle( - reinterpret_cast(object)) || - Dart::IsReadOnlyApiHandle(object)); ASSERT(FinalizablePersistentHandle::ptr_offset() == 0 && PersistentHandle::ptr_offset() == 0 && LocalHandle::ptr_offset() == 0); #endif diff --git a/runtime/vm/handles.cc b/runtime/vm/handles.cc index b088957cf16..8b44b788c73 100644 --- a/runtime/vm/handles.cc +++ b/runtime/vm/handles.cc @@ -17,8 +17,6 @@ namespace dart { -DEFINE_FLAG(bool, verify_handles, false, "Verify handles."); - void VMHandles::VisitObjectPointers(ObjectPointerVisitor* visitor) { return Handles::VisitObjectPointers(visitor); diff --git a/runtime/vm/handles.h b/runtime/vm/handles.h index f2f900527ea..d59a1ba22b0 100644 --- a/runtime/vm/handles.h +++ b/runtime/vm/handles.h @@ -50,8 +50,6 @@ namespace dart { class ObjectPointerVisitor; class HandleVisitor; -DECLARE_FLAG(bool, verify_handles); - template class Handles { public: diff --git a/runtime/vm/heap/verifier.cc b/runtime/vm/heap/verifier.cc index 71ea299b6d2..1a726dd99dd 100644 --- a/runtime/vm/heap/verifier.cc +++ b/runtime/vm/heap/verifier.cc @@ -107,16 +107,6 @@ VerifyCanonicalVisitor::VerifyCanonicalVisitor(Thread* thread) : thread_(thread), instanceHandle_(Instance::Handle(thread->zone())) {} void VerifyCanonicalVisitor::VisitObject(ObjectPtr obj) { - // The caller of this function is walking heap pages using the - // ExclusivePageIterator - which holds the pages lock. - // - // If we allow handle verification, then any assignment to a handle will call - // `heap()->Contains()` for heap objects, which in return is implemented by - // walking pages using ExclusivePageIterator, which can cause a deadlock. - // - // Therefore we disable the handle verification here. - const bool old_verify_flag = FLAG_verify_handles; - FLAG_verify_handles = false; if (!IsInternalOnlyClassId(obj->GetClassId()) && (obj->GetClassId() != kTypeArgumentsCid)) { if (obj->untag()->IsCanonical()) { @@ -129,7 +119,6 @@ void VerifyCanonicalVisitor::VisitObject(ObjectPtr obj) { ASSERT(is_canonical); } } - FLAG_verify_handles = old_verify_flag; } #endif // defined(DEBUG) diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index b2b35a6eff0..093014b2cb3 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -2510,15 +2510,6 @@ ErrorPtr Object::Init(IsolateGroup* isolate_group, #if defined(DEBUG) bool Object::InVMIsolateHeap() const { - if (FLAG_verify_handles && ptr()->untag()->InVMIsolateHeap()) { - Heap* vm_isolate_heap = Dart::vm_isolate_group()->heap(); - uword addr = UntaggedObject::ToAddr(ptr()); - if (!vm_isolate_heap->Contains(addr)) { - ASSERT(FLAG_write_protect_code); - addr = UntaggedObject::ToAddr(OldPage::ToWritable(ptr())); - ASSERT(vm_isolate_heap->Contains(addr)); - } - } return ptr()->untag()->InVMIsolateHeap(); } #endif // DEBUG @@ -2610,19 +2601,6 @@ void Object::CheckHandle() const { cid = kInstanceCid; } ASSERT(vtable() == builtin_vtables_[cid]); - if (FLAG_verify_handles && ptr_->IsHeapObject()) { - Heap* isolate_heap = IsolateGroup::Current()->heap(); - if (!isolate_heap->new_space()->scavenging()) { - Heap* vm_isolate_heap = Dart::vm_isolate_group()->heap(); - uword addr = UntaggedObject::ToAddr(ptr_); - if (!isolate_heap->Contains(addr) && !vm_isolate_heap->Contains(addr)) { - ASSERT(FLAG_write_protect_code); - addr = UntaggedObject::ToAddr(OldPage::ToWritable(ptr_)); - ASSERT(isolate_heap->Contains(addr) || - vm_isolate_heap->Contains(addr)); - } - } - } } #endif } diff --git a/runtime/vm/object.h b/runtime/vm/object.h index 99c91df06b8..b830f12f97f 100644 --- a/runtime/vm/object.h +++ b/runtime/vm/object.h @@ -12134,22 +12134,6 @@ void Object::SetPtr(ObjectPtr value, intptr_t default_cid) { cid = kInstanceCid; } set_vtable(builtin_vtables_[cid]); -#if defined(DEBUG) - if (FLAG_verify_handles && ptr_->IsHeapObject() && (ptr_ != Object::null())) { - Heap* isolate_heap = IsolateGroup::Current()->heap(); - // TODO(rmacnak): Remove after rewriting StackFrame::VisitObjectPointers - // to not use handles. - if (!isolate_heap->new_space()->scavenging()) { - Heap* vm_isolate_heap = Dart::vm_isolate_group()->heap(); - uword addr = UntaggedObject::ToAddr(ptr_); - if (!isolate_heap->Contains(addr) && !vm_isolate_heap->Contains(addr)) { - ASSERT(FLAG_write_protect_code); - addr = UntaggedObject::ToAddr(OldPage::ToWritable(ptr_)); - ASSERT(isolate_heap->Contains(addr) || vm_isolate_heap->Contains(addr)); - } - } - } -#endif } intptr_t Field::HostOffset() const {