[vm/concurrency] Remove --(no-)enable-isolate-groups flag in Dart VM
The --enable-isolate-groups flag has been turned on by-default for months now. In this CL we're going to remove the opt-out of this (which was possible by explicitly passing --no-enable-isolate-groups to the VM) TEST=Existing CI. Removes flag and simplifies runtime. Change-Id: I8706b9e30df437548a81846e75e67a658d6d49d4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/219480 Reviewed-by: Alexander Aprelev <aam@google.com> Commit-Queue: Martin Kustermann <kustermann@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
c1d4af3049
commit
f8df8ca78e
+16
-25
@@ -111,9 +111,8 @@ DEFINE_NATIVE_ENTRY(SendPortImpl_sendInternal_, 0, 2) {
|
||||
// We have to check whether the reciever has the same isolate group (e.g.
|
||||
// native message handlers such as an IOService handler does not but does
|
||||
// share the same origin port).
|
||||
const bool same_group =
|
||||
FLAG_enable_isolate_groups && PortMap::IsReceiverInThisIsolateGroup(
|
||||
destination_port_id, isolate->group());
|
||||
const bool same_group = PortMap::IsReceiverInThisIsolateGroup(
|
||||
destination_port_id, isolate->group());
|
||||
// TODO(turnidge): Throw an exception when the return value is false?
|
||||
PortMap::PostMessage(WriteMessage(can_send_any_object, same_group, obj,
|
||||
destination_port_id,
|
||||
@@ -639,7 +638,7 @@ class SpawnIsolateTask : public ThreadPool::Task {
|
||||
ASSERT(name != nullptr);
|
||||
|
||||
auto group = state_->isolate_group();
|
||||
if (!FLAG_enable_isolate_groups || group == nullptr) {
|
||||
if (group == nullptr) {
|
||||
RunHeavyweight(name);
|
||||
} else {
|
||||
RunLightweight(name);
|
||||
@@ -676,8 +675,7 @@ class SpawnIsolateTask : public ThreadPool::Task {
|
||||
}
|
||||
|
||||
void RunLightweight(const char* name) {
|
||||
// The create isolate initialize callback is mandatory if
|
||||
// --enable-isolate-groups was passed.
|
||||
// The create isolate initialize callback is mandatory.
|
||||
auto initialize_callback = Isolate::InitializeCallback();
|
||||
if (initialize_callback == nullptr) {
|
||||
FailedSpawn(
|
||||
@@ -934,22 +932,16 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnFunction, 0, 10) {
|
||||
const auto& func = Function::Handle(zone, GetTopLevelFunction(zone, closure));
|
||||
PersistentHandle* closure_tuple_handle = nullptr;
|
||||
if (func.IsNull()) {
|
||||
if (!FLAG_enable_isolate_groups) {
|
||||
const String& msg = String::Handle(String::New(
|
||||
"Isolate.spawn expects to be passed a static or top-level function"));
|
||||
Exceptions::ThrowArgumentError(msg);
|
||||
} else {
|
||||
// We have a non-toplevel closure that we might need to copy.
|
||||
// Result will be [<closure-copy>, <objects-in-msg-to-rehash>]
|
||||
const auto& closure_copy_tuple = Object::Handle(
|
||||
zone, CopyMutableObjectGraph(closure)); // Throws if it fails.
|
||||
ASSERT(closure_copy_tuple.IsArray());
|
||||
ASSERT(Object::Handle(zone, Array::Cast(closure_copy_tuple).At(0))
|
||||
.IsClosure());
|
||||
closure_tuple_handle =
|
||||
isolate->group()->api_state()->AllocatePersistentHandle();
|
||||
closure_tuple_handle->set_ptr(closure_copy_tuple.ptr());
|
||||
}
|
||||
// We have a non-toplevel closure that we might need to copy.
|
||||
// Result will be [<closure-copy>, <objects-in-msg-to-rehash>]
|
||||
const auto& closure_copy_tuple = Object::Handle(
|
||||
zone, CopyMutableObjectGraph(closure)); // Throws if it fails.
|
||||
ASSERT(closure_copy_tuple.IsArray());
|
||||
ASSERT(Object::Handle(zone, Array::Cast(closure_copy_tuple).At(0))
|
||||
.IsClosure());
|
||||
closure_tuple_handle =
|
||||
isolate->group()->api_state()->AllocatePersistentHandle();
|
||||
closure_tuple_handle->set_ptr(closure_copy_tuple.ptr());
|
||||
}
|
||||
|
||||
bool fatal_errors = fatalErrors.IsNull() ? true : fatalErrors.value();
|
||||
@@ -960,9 +952,8 @@ DEFINE_NATIVE_ENTRY(Isolate_spawnFunction, 0, 10) {
|
||||
// serializable this will throw an exception.
|
||||
SerializedObjectBuffer message_buffer;
|
||||
message_buffer.set_message(WriteMessage(
|
||||
/* can_send_any_object */ true,
|
||||
/* same_group */ FLAG_enable_isolate_groups, message, ILLEGAL_PORT,
|
||||
Message::kNormalPriority));
|
||||
/*can_send_any_object=*/true,
|
||||
/*same_group=*/true, message, ILLEGAL_PORT, Message::kNormalPriority));
|
||||
|
||||
const char* utf8_package_config =
|
||||
packageConfig.IsNull() ? NULL : String2UTF8(packageConfig);
|
||||
|
||||
@@ -211,7 +211,7 @@ DEFINE_RUNTIME_ENTRY(CompileFunction, 1) {
|
||||
ASSERT(thread->IsMutatorThread());
|
||||
const Function& function = Function::CheckedHandle(zone, arguments.ArgAt(0));
|
||||
|
||||
if (FLAG_enable_isolate_groups) {
|
||||
{
|
||||
// Another isolate's mutator thread may have created [function] and
|
||||
// published it via an ICData, MegamorphicCache etc. Entering the lock below
|
||||
// is an acquire operation that pairs with the release operation when the
|
||||
@@ -220,12 +220,6 @@ DEFINE_RUNTIME_ENTRY(CompileFunction, 1) {
|
||||
SafepointReadRwLocker ml(thread, thread->isolate_group()->program_lock());
|
||||
}
|
||||
|
||||
// In single-isolate scenarios the lazy compile stub is only invoked if
|
||||
// there's no existing code. In multi-isolate scenarios with shared JITed code
|
||||
// we can end up in the lazy compile runtime entry here with code being
|
||||
// installed.
|
||||
ASSERT(!function.HasCode() || FLAG_enable_isolate_groups);
|
||||
|
||||
// Will throw if compilation failed (e.g. with compile-time error).
|
||||
function.EnsureHasCode();
|
||||
}
|
||||
|
||||
@@ -1463,13 +1463,6 @@ Dart_CreateIsolateInGroup(Dart_Isolate group_member,
|
||||
|
||||
*error = nullptr;
|
||||
|
||||
if (!FLAG_enable_isolate_groups) {
|
||||
*error = Utils::StrDup(
|
||||
"Lightweight isolates need to be explicitly enabled by passing "
|
||||
"--enable-isolate-groups.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Isolate* isolate;
|
||||
isolate = CreateWithinExistingIsolateGroup(member->group(), name, error);
|
||||
if (isolate != nullptr) {
|
||||
|
||||
@@ -194,7 +194,6 @@ constexpr bool FLAG_support_il_printer = false;
|
||||
P(retain_code_objects, bool, true, \
|
||||
"Serialize all code objects even if not otherwise " \
|
||||
"needed in the precompiled runtime.") \
|
||||
P(enable_isolate_groups, bool, true, "Enable isolate group support.") \
|
||||
P(show_invisible_frames, bool, false, \
|
||||
"Show invisible frames in stack traces.") \
|
||||
D(trace_cha, bool, false, "Trace CHA operations") \
|
||||
|
||||
@@ -574,9 +574,6 @@ class SendAndExitMessagesHandler : public MessageHandler {
|
||||
};
|
||||
|
||||
VM_UNIT_TEST_CASE(CleanupBequestNeverReceived) {
|
||||
// This test uses features from isolate groups
|
||||
FLAG_enable_isolate_groups = true;
|
||||
|
||||
const char* TEST_MESSAGE = "hello, world";
|
||||
Dart_Isolate parent = TestCase::CreateTestIsolate("parent");
|
||||
EXPECT_EQ(parent, Dart_CurrentIsolate());
|
||||
@@ -608,9 +605,6 @@ VM_UNIT_TEST_CASE(CleanupBequestNeverReceived) {
|
||||
}
|
||||
|
||||
VM_UNIT_TEST_CASE(ReceivesSendAndExitMessage) {
|
||||
// This test uses features from isolate groups
|
||||
FLAG_enable_isolate_groups = true;
|
||||
|
||||
const char* TEST_MESSAGE = "hello, world";
|
||||
Dart_Isolate parent = TestCase::CreateTestIsolate("parent");
|
||||
EXPECT_EQ(parent, Dart_CurrentIsolate());
|
||||
|
||||
+3
-10
@@ -2638,11 +2638,9 @@ void Isolate::LowLevelCleanup(Isolate* isolate) {
|
||||
Dart::thread_pool()->Run<ShutdownGroupTask>(isolate_group);
|
||||
}
|
||||
} else {
|
||||
if (FLAG_enable_isolate_groups) {
|
||||
// TODO(dartbug.com/36097): An isolate just died. A significant amount of
|
||||
// memory might have become unreachable. We should evaluate how to best
|
||||
// inform the GC about this situation.
|
||||
}
|
||||
// TODO(dartbug.com/36097): An isolate just died. A significant amount of
|
||||
// memory might have become unreachable. We should evaluate how to best
|
||||
// inform the GC about this situation.
|
||||
}
|
||||
} // namespace dart
|
||||
|
||||
@@ -2807,11 +2805,6 @@ void IsolateGroup::RunWithStoppedMutatorsCallable(
|
||||
auto thread = Thread::Current();
|
||||
StoppedMutatorsScope stopped_mutators_scope(thread);
|
||||
|
||||
if (thread->IsMutatorThread() && !FLAG_enable_isolate_groups) {
|
||||
single_current_mutator->Call();
|
||||
return;
|
||||
}
|
||||
|
||||
if (thread->IsAtSafepoint()) {
|
||||
RELEASE_ASSERT(safepoint_handler()->IsOwnedByTheThread(thread));
|
||||
single_current_mutator->Call();
|
||||
|
||||
@@ -869,9 +869,6 @@ static void UpdateTypeTestCache(
|
||||
new_cache.WriteEntryToBuffer(zone, &buffer, colliding_index, " ");
|
||||
THR_Print("%s\n", buffer.buffer());
|
||||
}
|
||||
if (!FLAG_enable_isolate_groups) {
|
||||
FATAL("Duplicate subtype test cache entry");
|
||||
}
|
||||
if (old_result.ptr() != result.ptr()) {
|
||||
FATAL("Existing subtype test cache entry has result %s, not %s",
|
||||
old_result.ToCString(), result.ToCString());
|
||||
@@ -1246,9 +1243,6 @@ DEFINE_RUNTIME_ENTRY(PatchStaticCall, 0) {
|
||||
const Code& target_code = Code::Handle(zone, target_function.EnsureHasCode());
|
||||
// Before patching verify that we are not repeatedly patching to the same
|
||||
// target.
|
||||
ASSERT(FLAG_enable_isolate_groups ||
|
||||
target_code.ptr() != CodePatcher::GetStaticCallTargetAt(
|
||||
caller_frame->pc(), caller_code));
|
||||
if (target_code.ptr() !=
|
||||
CodePatcher::GetStaticCallTargetAt(caller_frame->pc(), caller_code)) {
|
||||
GcSafepointOperationScope safepoint(thread);
|
||||
@@ -3018,10 +3012,6 @@ DEFINE_RUNTIME_ENTRY(FixCallersTarget, 0) {
|
||||
current_target_code.EntryPoint(),
|
||||
current_target_code.is_optimized() ? "optimized" : "unoptimized");
|
||||
}
|
||||
// With isolate groups enabled, it is possible that the target code
|
||||
// has been deactivated just now(as a result of re-optimizatin for example),
|
||||
// which will result in another run through FixCallersTarget.
|
||||
ASSERT(!current_target_code.IsDisabled() || FLAG_enable_isolate_groups);
|
||||
arguments.SetReturn(current_target_code);
|
||||
#else
|
||||
UNREACHABLE();
|
||||
|
||||
@@ -401,11 +401,6 @@ StringPtr Symbols::Lookup(Thread* thread, const StringType& str) {
|
||||
// cases.
|
||||
if (thread->IsAtSafepoint()) {
|
||||
RELEASE_ASSERT(group->safepoint_handler()->IsOwnedByTheThread(thread));
|
||||
// In DEBUG mode the snapshot writer also calls this method inside a
|
||||
// safepoint.
|
||||
#if !defined(DEBUG)
|
||||
RELEASE_ASSERT(FLAG_enable_isolate_groups || !USING_PRODUCT);
|
||||
#endif
|
||||
data = object_store->symbol_table();
|
||||
CanonicalStringSet table(&key, &value, &data);
|
||||
symbol ^= table.GetOrNull(str);
|
||||
|
||||
Reference in New Issue
Block a user