mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[vm] Remove --verify_handles.
TEST=ci Change-Id: I22a84596f44d43133806b121a6404a41a00a38f3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/228901 Reviewed-by: Siva Annamalai <asiva@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
6bcba2529d
commit
884f765500
|
@ -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();
|
||||
|
|
|
@ -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<Dart_PersistentHandle>(object)) ||
|
||||
Dart::IsReadOnlyApiHandle(object));
|
||||
ASSERT(FinalizablePersistentHandle::ptr_offset() == 0 &&
|
||||
PersistentHandle::ptr_offset() == 0 && LocalHandle::ptr_offset() == 0);
|
||||
#endif
|
||||
|
|
|
@ -17,8 +17,6 @@
|
|||
|
||||
namespace dart {
|
||||
|
||||
DEFINE_FLAG(bool, verify_handles, false, "Verify handles.");
|
||||
|
||||
void VMHandles::VisitObjectPointers(ObjectPointerVisitor* visitor) {
|
||||
return Handles<kVMHandleSizeInWords, kVMHandlesPerChunk,
|
||||
kOffsetOfRawPtr>::VisitObjectPointers(visitor);
|
||||
|
|
|
@ -50,8 +50,6 @@ namespace dart {
|
|||
class ObjectPointerVisitor;
|
||||
class HandleVisitor;
|
||||
|
||||
DECLARE_FLAG(bool, verify_handles);
|
||||
|
||||
template <int kHandleSizeInWords, int kHandlesPerChunk, int kOffsetOfRawPtr>
|
||||
class Handles {
|
||||
public:
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue