diff --git a/runtime/lib/isolate.cc b/runtime/lib/isolate.cc index a908fedb8a3..907828da43c 100644 --- a/runtime/lib/isolate.cc +++ b/runtime/lib/isolate.cc @@ -885,7 +885,6 @@ class SpawnIsolateTask : public ThreadPool::Task { auto thread = Thread::Current(); TransitionNativeToVM transition(thread); StackZone zone(thread); - HandleScope hs(thread); success = EnqueueEntrypointInvocationAndNotifySpawner(thread); diff --git a/runtime/vm/compiler/backend/il.cc b/runtime/vm/compiler/backend/il.cc index e630c400f21..b12dbdd23ec 100644 --- a/runtime/vm/compiler/backend/il.cc +++ b/runtime/vm/compiler/backend/il.cc @@ -171,7 +171,6 @@ class CidCheckerForRanges : public ValueObject { subtype_ = to_check_.RareType(); // Create local zone because deep hierarchies may allocate lots of handles. StackZone stack_zone(thread_); - HANDLESCOPE(thread_); return subtype_.IsSubtypeOf(supertype_, Heap::kNew); } diff --git a/runtime/vm/compiler/jit/compiler.cc b/runtime/vm/compiler/jit/compiler.cc index 14b98c6a5b5..35e40f50f2e 100644 --- a/runtime/vm/compiler/jit/compiler.cc +++ b/runtime/vm/compiler/jit/compiler.cc @@ -1015,7 +1015,6 @@ void BackgroundCompiler::Run() { Thread* thread = Thread::Current(); StackZone stack_zone(thread); Zone* zone = stack_zone.GetZone(); - HANDLESCOPE(thread); Function& function = Function::Handle(zone); QueueElement* element = nullptr; { diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc index 01498aa6216..e32f9a0fb63 100644 --- a/runtime/vm/dart.cc +++ b/runtime/vm/dart.cc @@ -406,7 +406,6 @@ char* Dart::DartInit(const Dart_InitializeParams* params) { Thread* T = Thread::Current(); ASSERT(T != nullptr); StackZone zone(T); - HandleScope handle_scope(T); Object::InitNullAndBool(vm_isolate_->group()); vm_isolate_->isolate_group_->set_object_store(new ObjectStore()); vm_isolate_->isolate_object_store()->Init(); diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index fec5d63f9ce..55dca4bfd3f 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -1208,7 +1208,6 @@ static Dart_Isolate CreateIsolate(IsolateGroup* group, bool success = false; { StackZone zone(T); - HandleScope handle_scope(T); #if defined(SUPPORT_TIMELINE) TimelineBeginEndScope tbes(T, Timeline::GetIsolateStream(), @@ -1408,7 +1407,6 @@ DART_EXPORT void Dart_ShutdownIsolate() { { StackZone zone(T); - HandleScope handle_scope(T); Dart::RunShutdownCallback(); } Dart::ShutdownIsolate(T); diff --git a/runtime/vm/ffi_callback_metadata_test.cc b/runtime/vm/ffi_callback_metadata_test.cc index 982e65d7063..c2c5ad7b0b9 100644 --- a/runtime/vm/ffi_callback_metadata_test.cc +++ b/runtime/vm/ffi_callback_metadata_test.cc @@ -87,7 +87,6 @@ VM_UNIT_TEST_CASE(FfiCallbackMetadata_CreateSyncFfiCallback) { ASSERT(isolate == isolate_scope.isolate()); TransitionNativeToVM transition(thread); StackZone stack_zone(thread); - HandleScope handle_scope(thread); auto* zone = thread->zone(); @@ -182,7 +181,6 @@ VM_UNIT_TEST_CASE(FfiCallbackMetadata_CreateAsyncFfiCallback) { ASSERT(thread->isolate() == isolate_scope.isolate()); TransitionNativeToVM transition(thread); StackZone stack_zone(thread); - HandleScope handle_scope(thread); auto* zone = thread->zone(); @@ -279,7 +277,6 @@ VM_UNIT_TEST_CASE(FfiCallbackMetadata_CreateIsolateLocalFfiCallback) { ASSERT(thread->isolate() == isolate_scope.isolate()); TransitionNativeToVM transition(thread); StackZone stack_zone(thread); - HandleScope handle_scope(thread); auto* zone = thread->zone(); @@ -439,7 +436,6 @@ VM_UNIT_TEST_CASE(FfiCallbackMetadata_DeleteTrampolines) { ASSERT(isolate == isolate_scope.isolate()); TransitionNativeToVM transition(thread); StackZone stack_zone(thread); - HandleScope handle_scope(thread); auto* fcm = FfiCallbackMetadata::Instance(); std::unordered_set tramps; @@ -513,7 +509,6 @@ static void RunBigRandomMultithreadedTest(uint64_t seed) { ASSERT(isolate == isolate_scope.isolate()); TransitionNativeToVM transition(thread); StackZone stack_zone(thread); - HandleScope handle_scope(thread); struct TrampolineWithPort { FfiCallbackMetadata::Trampoline tramp; diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc index 0d3532d7934..d49bce7dfe3 100644 --- a/runtime/vm/isolate.cc +++ b/runtime/vm/isolate.cc @@ -1446,7 +1446,6 @@ MessageHandler::MessageStatus IsolateMessageHandler::HandleMessage( Thread* thread = Thread::Current(); StackZone stack_zone(thread); Zone* zone = stack_zone.GetZone(); - HandleScope handle_scope(thread); #if defined(SUPPORT_TIMELINE) TimelineBeginEndScope tbes( thread, Timeline::GetIsolateStream(), @@ -1575,7 +1574,6 @@ void IsolateMessageHandler::NotifyPauseOnStart() { if (Service::debug_stream.enabled() || FLAG_warn_on_pause_with_no_debugger) { StartIsolateScope start_isolate(I); StackZone zone(T); - HandleScope handle_scope(T); ServiceEvent pause_event(I, ServiceEvent::kPauseStart); Service::HandleEvent(&pause_event); } else if (FLAG_trace_service) { @@ -1591,7 +1589,6 @@ void IsolateMessageHandler::NotifyPauseOnExit() { if (Service::debug_stream.enabled() || FLAG_warn_on_pause_with_no_debugger) { StartIsolateScope start_isolate(I); StackZone zone(T); - HandleScope handle_scope(T); ServiceEvent pause_event(I, ServiceEvent::kPauseExit); Service::HandleEvent(&pause_event); } else if (FLAG_trace_service) { @@ -2478,7 +2475,6 @@ void Isolate::RunAndCleanupFinalizersOnShutdown() { // but we no longer allocate new heap objects. Thread* thread = Thread::Current(); StackZone stack_zone(thread); - HandleScope handle_scope(thread); NoSafepointScope no_safepoint_scope; // Set live finalizers isolate to null, before deleting the message handler. @@ -2526,7 +2522,6 @@ void Isolate::LowLevelShutdown() { // but we no longer allocate new heap objects. Thread* thread = Thread::Current(); StackZone stack_zone(thread); - HandleScope handle_scope(thread); NoSafepointScope no_safepoint_scope; // Notify exit listeners that this isolate is shutting down. @@ -2612,7 +2607,6 @@ void Isolate::Shutdown() { StackZone zone(thread); ServiceIsolate::SendIsolateShutdownMessage(); #if !defined(PRODUCT) - HandleScope handle_scope(thread); debugger()->Shutdown(); #endif diff --git a/runtime/vm/kernel_isolate.cc b/runtime/vm/kernel_isolate.cc index 0468d8a81a3..ecf7983d286 100644 --- a/runtime/vm/kernel_isolate.cc +++ b/runtime/vm/kernel_isolate.cc @@ -125,7 +125,6 @@ class RunKernelTask : public ThreadPool::Task { auto T = Thread::Current(); TransitionNativeToVM transition(T); StackZone zone(T); - HandleScope handle_scope(T); auto I = T->isolate(); ASSERT(I->is_kernel_isolate()); diff --git a/runtime/vm/service_isolate.cc b/runtime/vm/service_isolate.cc index 03924ebf65c..4a9181e1452 100644 --- a/runtime/vm/service_isolate.cc +++ b/runtime/vm/service_isolate.cc @@ -419,7 +419,6 @@ class RunServiceTask : public ThreadPool::Task { auto T = Thread::Current(); TransitionNativeToVM transition(T); StackZone zone(T); - HandleScope handle_scope(T); auto I = T->isolate(); ASSERT(I->is_service_isolate()); diff --git a/runtime/vm/snapshot_test.cc b/runtime/vm/snapshot_test.cc index f6090633d73..8e481092f3c 100644 --- a/runtime/vm/snapshot_test.cc +++ b/runtime/vm/snapshot_test.cc @@ -752,7 +752,6 @@ VM_UNIT_TEST_CASE(FullSnapshot) { Thread* thread = Thread::Current(); TransitionNativeToVM transition(thread); StackZone zone(thread); - HandleScope scope(thread); Dart_Handle result = Api::CheckAndFinalizePendingClasses(thread); { @@ -1010,7 +1009,6 @@ VM_UNIT_TEST_CASE(DartGeneratedListMessages) { { CHECK_API_SCOPE(thread); TransitionNativeToVM transition(thread); - HANDLESCOPE(thread); StackZone zone(thread); { // Generate a list of nulls from Dart code. @@ -1134,7 +1132,6 @@ VM_UNIT_TEST_CASE(DartGeneratedArrayLiteralMessages) { { CHECK_API_SCOPE(thread); TransitionNativeToVM transition(thread); - HANDLESCOPE(thread); StackZone zone(thread); { // Generate a list of nulls from Dart code. @@ -1367,7 +1364,6 @@ VM_UNIT_TEST_CASE(DartGeneratedListMessagesWithBackref) { { CHECK_API_SCOPE(thread); TransitionNativeToVM transition(thread); - HANDLESCOPE(thread); StackZone zone(thread); { // Generate a list of strings from Dart code. @@ -1566,7 +1562,6 @@ VM_UNIT_TEST_CASE(DartGeneratedArrayLiteralMessagesWithBackref) { { CHECK_API_SCOPE(thread); TransitionNativeToVM transition(thread); - HANDLESCOPE(thread); StackZone zone(thread); { // Generate a list of strings from Dart code. @@ -1807,7 +1802,6 @@ VM_UNIT_TEST_CASE(DartGeneratedListMessagesWithTypedData) { { CHECK_API_SCOPE(thread); TransitionNativeToVM transition(thread); - HANDLESCOPE(thread); StackZone zone(thread); { // Generate a list of Uint8Lists from Dart code. diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc index d91af35fdb8..3937401aa5e 100644 --- a/runtime/vm/thread.cc +++ b/runtime/vm/thread.cc @@ -583,7 +583,6 @@ void Thread::EnterIsolateGroupAsMutator(IsolateGroup* isolate_group, thread->AssertDartMutatorInvariants(); StackZone zone(thread); - HANDLESCOPE(thread); if (isolate_group->object_store()->tag_table() != GrowableObjectArray::null()) { // Set up default UserTag. diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc index 20c5757ac77..822b2558f55 100644 --- a/runtime/vm/timeline.cc +++ b/runtime/vm/timeline.cc @@ -2703,7 +2703,6 @@ void Timeline::DrainCompletedSampleBlocksIntoRecorder( DisableThreadInterruptsScope dtis(thread); StackZone zone(thread); - HandleScope handle_scope(thread); Profile profile; NoAllocationSampleFilter filter(isolate->main_port(), Thread::kMutatorTask, streaming_start_micros, diff --git a/runtime/vm/unit_test.h b/runtime/vm/unit_test.h index 1d1942b8ca9..cc6d47603e4 100644 --- a/runtime/vm/unit_test.h +++ b/runtime/vm/unit_test.h @@ -56,7 +56,6 @@ ASSERT(__thread__->isolate() == __test_isolate__.isolate()); \ TransitionNativeToVM transition(__thread__); \ StackZone __zone__(__thread__); \ - HandleScope __hs__(__thread__); \ Dart_TestHelper##name(__thread__); \ } \ static void Dart_TestHelper##name(Thread* thread) @@ -76,7 +75,6 @@ ASSERT(__thread__->isolate() == __test_isolate__.isolate()); \ TransitionNativeToVM transition1(__thread__); \ StackZone __zone__(__thread__); \ - HandleScope __hs__(__thread__); \ TransitionVMToNative transition2(__thread__); \ Dart_TestHelper##name(__thread__); \ } \