From bdcb07c85feeccca136d1e040b2b36e425ca043b Mon Sep 17 00:00:00 2001 From: Martin Kustermann Date: Wed, 12 May 2021 07:55:38 +0000 Subject: [PATCH] [vm/concurrency] Speed up debug runs of isolate tests Running isolates tests in debug mode is currently very slow due to heap verification and related code on isolate startup & shutdown. This CL limits those verifications to only run on the first isolate of an isolate group. Issue https://github.com/dart-lang/sdk/issues/36097 TEST=Existing test suite. Change-Id: I1f329bca9e4c1d56ab60f36ffa8b9cc037b818f2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199249 Reviewed-by: Alexander Aprelev Reviewed-by: Ryan Macnak Commit-Queue: Martin Kustermann --- runtime/vm/dart.cc | 4 +++- runtime/vm/dart_api_impl.cc | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc index 53250c5b75a..cf63124cc08 100644 --- a/runtime/vm/dart.cc +++ b/runtime/vm/dart.cc @@ -861,7 +861,9 @@ ErrorPtr Dart::InitializeIsolate(const uint8_t* snapshot_data, } Object::VerifyBuiltinVtables(); - DEBUG_ONLY(IG->heap()->Verify(kForbidMarked)); + if (T->isolate()->origin_id() == 0) { + DEBUG_ONLY(IG->heap()->Verify(kForbidMarked)); + } #if defined(DART_PRECOMPILED_RUNTIME) const bool kIsAotRuntime = true; diff --git a/runtime/vm/dart_api_impl.cc b/runtime/vm/dart_api_impl.cc index 842bc8f7771..2e26b486c42 100644 --- a/runtime/vm/dart_api_impl.cc +++ b/runtime/vm/dart_api_impl.cc @@ -1499,7 +1499,9 @@ DART_EXPORT void Dart_ShutdownIsolate() { StackZone zone(T); HandleScope handle_scope(T); #if defined(DEBUG) - T->isolate_group()->ValidateConstants(); + if (T->isolate()->origin_id() == 0) { + T->isolate_group()->ValidateConstants(); + } #endif Dart::RunShutdownCallback(); }