dart-sdk/tools
Martin Kustermann 67ab3be10d Reland "[vm/concurrency] Introduce concept of Isolate Groups"
An Isolate Group (IG) is a collection of isolates which were spawned from the
same source. This allows the VM to:

  * have a guarantee that all isolates within one IG can safely exchange
    structured objects (currently we rely on embedder for this
    guarantee)

  * hot-reload all isolates together (currently we only reload one
    isolate, leaving same-source isolates in inconsistent state)

  * make a shared heap for all isolates from the same IG, which paves
    the way for faster communication and sharing of immutable objects.

All isolates within one IG will share the same IsolateGroupSource.

**Embedder changes**

This change makes breaking embedder API changes to support this new
concept of Isolate Groups: The existing isolate lifecycle callbacks
given to Dart_Initialize will become Isolate Group lifecycle callbacks.
A new callback `initialize_isolate` callback will be added which can
initialize a new isolate within an existing IG.

Existing embedders can be updated by performing the following renames

  Dart_CreateIsolate -> Dart_CreateIsolateGroup
  Dart_IsolateCreateCallback -> Dart_IsolateGroupCreateCallback
  Dart_IsolateCleanupCallback -> Dart_IsolateGroupShutdownCallback
  Dart_CreateIsolateFromKernel -> Dart_CreateIsolateGroupFromKernel
  Dart_CurrentIsolateData -> Dart_CurrentIsolateGroupData
  Dart_IsolateData -> Dart_IsolateGroupData
  Dart_GetNativeIsolateData -> Dart_GetNativeIsolateGroupData
  Dart_InitializeParams.create -> Dart_InitializeParams.create_group
  Dart_InitializeParams.cleanup -> Dart_InitializeParams.shutdown_group
  Dart_InitializeParams.shutdown -> Dart_InitializeParams.shutdown_isolate

By default `Isolate.spawn` will cause the creation of a new IG.

Though an embedder can opt-into supporting multiple isolates within one IG by
providing a callback to the newly added `Dart_InitializeParams.initialize_isolate`.
The responsibility of this new callback is to initialize an existing
isolate (which was setup by re-using source code from the spawning
isolate - i.e. the one which used `Isolate.spawn`) by setting native
resolvers, initializing global state, etc.

Issue https://github.com/dart-lang/sdk/issues/36648
Issue https://github.com/dart-lang/sdk/issues/36097

Original review: https://dart-review.googlesource.com/c/sdk/+/105241

Difference to original review:

  * Give each isolate it's own [Loader] (for now)
  * Sort classes during initialization for spawned isolates if app-jit is used (to match main isolate)
  * Fix IsolateData memory leak if isolate startup fails

Change-Id: I98277d3d10fe275aa9b8a16b6bdd446bbea0b100
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/107506
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
2019-06-29 18:45:11 +00:00
..
abiversions Reland https://dart-review.googlesource.com/c/sdk/+/96500 2019-03-13 21:03:01 +00:00
android Cherry-pick 031e77eea1 to the analyzer branch. 2018-11-29 22:14:23 +00:00
apps/update_homebrew Generate homebrew script compatible with latest changes 2019-01-10 16:43:34 +00:00
bots Revert "[infra] Add error check when adding builder data to test results." 2019-06-28 16:49:40 +00:00
buildtools Cherry-pick 031e77eea1 to the analyzer branch. 2018-11-29 22:14:23 +00:00
dart2js Update File.openRead to return Stream<Uint8List> 2019-06-27 00:22:17 +00:00
dom Normalize status files 2019-06-19 23:04:01 +00:00
gardening Update HttpRequest and HttpClientResponse to be Stream<Uint8List> 2019-06-27 00:21:07 +00:00
linux_dist_support/debian Add new AOT build steps to deb package build script. 2019-05-29 08:45:00 +00:00
migration
patches Reland "[vm/concurrency] Introduce concept of Isolate Groups" 2019-06-29 18:45:11 +00:00
sdks
spec_parser Dart.g fixes, not including nnbd updates. 2019-06-06 12:07:40 +00:00
test_generators
testing [infra] Remove obsolete webdriver/selenium support from testing 2019-06-18 06:59:09 +00:00
.gitignore Reland https://dart-review.googlesource.com/c/sdk/+/96500 2019-03-13 21:03:01 +00:00
3xhead_flutter_hooks.sh [infra] Extend 3head patching to apply patches for flutter/flutter depending on pinned engine commit 2019-02-04 12:37:10 +00:00
addlatexhash.dart Support latest pkg:html in analyzer, analyzer_plugin 2019-04-09 02:06:09 +00:00
approve_results.dart Update HttpRequest and HttpClientResponse to be Stream<Uint8List> 2019-06-27 00:21:07 +00:00
archive_crash.py
build.py [vm/compiler] Instroduce SIMARM_X64 build architecture. 2019-05-06 10:48:08 +00:00
canary.dart
clean_output_directory.py
copy_dart.py
copy_tree.py Fix build when python=python3 2019-04-23 07:48:15 +00:00
create_debian_chroot.sh
create_debian_packages.py
create_pkg_manifest.py [fuchsia] Handle host_{cpu,os} vars in DEPS 2019-01-02 16:17:22 +00:00
create_tarball.py
create_timestamp_file.py
diff_results.dart [Gardening] Add tools/diff_results.dart which can query the test results database and report a diff in test results from two commits 2019-03-07 12:50:10 +00:00
disguised_test.py [infra] Prevent front end unit tests from being approved. 2019-05-03 12:38:22 +00:00
download_abi_dills.py Fix build when python=python3 2019-04-23 07:48:15 +00:00
download_chromium_sysroot.sh
download_latest_dev_sdk.py
execute_recorded_testcases.py
experimental_features.yaml remove retired experimental flags from kernel 2019-06-27 18:19:55 +00:00
FAKE_COMMITS [infra] Switch benchmark builders to Ubuntu 16.04. 2019-04-03 11:42:11 +00:00
find_depot_tools.py
gen_fuchsia_test_manifest.py
generate_buildfiles.py Fix build when python=python3 2019-04-23 07:48:15 +00:00
generate_idefiles.py [tools] add target os option to tools/generate_idefiles.py 2019-06-04 08:13:38 +00:00
gn.py [vm/compiler] Instroduce SIMARM_X64 build architecture. 2019-05-06 10:48:08 +00:00
gn_helpers.py
line_doc_comments.dart
list_dart_files.py
list_files.py
make_bundle_unittest.py
make_version.py [infra] Always produce a proper Dart version string on release channels 2019-06-12 18:24:03 +00:00
minidump.py Fix build when python=python3 2019-04-23 07:48:15 +00:00
only_in_release_mode.py
presubmit.sh
promote.py [infra] Make promote.py work with newer versions of gsutil 2019-03-06 12:43:07 +00:00
publish_pkg.py
revert.py
run_abi_tests.py Don't run ABI test on non-existent ABI versions 2019-06-27 22:09:33 +00:00
run_debian_build.sh [infra] Fix debianpackage build 2019-04-01 08:26:46 +00:00
run_offsets_extractor.sh Reland "[vm] Create offsets_extractor tool." 2019-06-03 22:14:16 +00:00
safari_factory_reset.py
set_ia32_sysroot.sh [build] Move to Jessie sysroots from Wheezy sysroots. 2018-10-25 15:05:22 +00:00
set_x64_sysroot.sh [build] Move to Jessie sysroots from Wheezy sysroots. 2018-10-25 15:05:22 +00:00
spec_parse.py Updated spec_parser such that it runs with ANTLR v4 2019-03-19 14:06:26 +00:00
task_kill.py [Gardening] Kill any leaked flutter_tester processes before/after 3-head builder work 2019-01-03 15:30:11 +00:00
test.dart Update HttpRequest and HttpClientResponse to be Stream<Uint8List> 2019-06-27 00:21:07 +00:00
test.py Move the test runner (i.e. "test.dart"/"test.py") to pkg/. 2019-06-14 23:35:10 +00:00
upload_abi_dills.sh Include gen_kernel_bytecode in create_sdk so that it can be uploaded by the builders 2019-03-19 19:36:59 +00:00
utils.py Move the test runner (i.e. "test.dart"/"test.py") to pkg/. 2019-06-14 23:35:10 +00:00
VERSION [vm/bytecode] Support native extensions 2019-06-27 20:24:25 +00:00
write_dartdoc_options_file.py Add source links to dartdoc output. 2019-02-07 18:46:31 +00:00
write_revision_file.py
write_version_file.py
yaml2json.dart
yaml2json.py