Skip to content

Commit d9561e5

Browse files
mkustermanncommit-bot@chromium.org
authored andcommitted
[vm/concurrency] Move Isolate.spawn()-related logic out of runtime/vm/ into runtime/lib
The Isolate.spawn() is part of our dart:isolate library implementation, it should therefore preferrably live under runtime/lib folder. This CL does that as well as removing some special message handling logic by using the new `Dart_RunLoopAsync()` C API, which results in net removal of code. As a nice side-effect it also makes isolate spawning slightly faster due to avoiding extra safepoint/vm<->native transitions. Issue #44088 TEST=Changes existing implementation, have existing test coverage for it. Change-Id: I00607a1436946552bbe12e8e23062e8f743d4f11 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/171731 Commit-Queue: Martin Kustermann <[email protected]> Reviewed-by: Ryan Macnak <[email protected]> Reviewed-by: Alexander Aprelev <[email protected]>
1 parent a39ea25 commit d9561e5

File tree

8 files changed

+457
-533
lines changed

8 files changed

+457
-533
lines changed

runtime/bin/dartdev_isolate.cc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,12 @@ void DartDevIsolate::DartDevRunner::RunCallback(uword args) {
213213
Dart_Handle send_port = Dart_NewSendPort(send_port_id);
214214
CHECK_RESULT(send_port);
215215

216-
const intptr_t kNumIsolateArgs = 7;
216+
const intptr_t kNumIsolateArgs = 4;
217217
Dart_Handle isolate_args[kNumIsolateArgs];
218-
isolate_args[0] = Dart_Null(); // parentPort
219-
isolate_args[1] = main_closure; // entryPoint
220-
isolate_args[2] = runner->dart_options_->CreateRuntimeOptions(); // args
221-
isolate_args[3] = send_port; // message
222-
isolate_args[4] = Dart_True(); // isSpawnUri
223-
isolate_args[5] = Dart_Null(); // controlPort
224-
isolate_args[6] = Dart_Null(); // capabilities
218+
isolate_args[0] = main_closure; // entryPoint
219+
isolate_args[1] = runner->dart_options_->CreateRuntimeOptions(); // args
220+
isolate_args[2] = send_port; // message
221+
isolate_args[3] = Dart_True(); // isSpawnUri
225222

226223
Dart_Handle isolate_lib =
227224
Dart_LookupLibrary(Dart_NewStringFromCString("dart:isolate"));

0 commit comments

Comments
 (0)