Find a file
Martin Kustermann b75057b687 [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

Change-Id: I82437ac017ca33018d45e02f353b0672db155f6a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/105241
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
2019-06-26 11:34:48 +00:00
.github Update new issue template. 2019-04-30 18:14:21 +00:00
build Fix builds targeting Android from a Windows host gen_snapshot. 2019-06-07 00:49:33 +00:00
client Remove old annotated_steps buildbot scripts and dispatcher 2017-05-23 16:17:02 +02:00
docs Updated spec_parser such that it runs with ANTLR v4 2019-03-19 14:06:26 +00:00
pkg Refactor how test metadata is managed in test.dart. 2019-06-25 22:21:49 +00:00
runtime [vm/concurrency] Introduce concept of Isolate Groups 2019-06-26 11:34:48 +00:00
samples Remove appJit and precompiled compiler options 2019-06-24 16:07:27 +00:00
samples-dev Fix runtime type error in Swarm 2019-04-24 06:57:16 +00:00
sdk [dart2js] Remove unnecessary arrayPush(). 2019-06-25 23:37:04 +00:00
tests [vm/ffi] SimDBC on Arm64 Android 2019-06-26 10:43:45 +00:00
third_party [dart2js] Add support for BabelJS to test.py 2019-05-29 08:39:44 +00:00
tools [vm/concurrency] Introduce concept of Isolate Groups 2019-06-26 11:34:48 +00:00
utils [tools] Remove patch_sdk tool which is no longer used. 2019-06-25 11:46:37 +00:00
.clang-format VM: Re-format to use at most one newline between functions 2017-07-13 08:08:37 -07:00
.gitattributes Remove the Dart 1 tests. 2018-10-11 23:45:18 +00:00
.gitconfig [infra] Add documentation to .gitconfig 2018-06-11 18:24:16 +00:00
.gitignore Add an analysis_options.yaml file for test_runner. 2019-06-20 18:58:51 +00:00
.gn Starting work on full GN build 2016-09-23 07:47:36 -07:00
.mailmap fix my name in .mailmap 2018-09-11 01:45:52 +00:00
.packages Move the test runner (i.e. "test.dart"/"test.py") to pkg/. 2019-06-14 23:35:10 +00:00
.vpython [infra] Add .vpython spec to fix gsutil on the bots (#31065) 2018-10-11 15:11:35 +00:00
AUTHORS [ VM ] Updated splay-tree licenses, added V8 project authors to AUTHORS 2019-04-30 19:50:46 +00:00
BUILD.gn [vm / library] Foreign function interface prototype 2019-02-13 12:42:47 +00:00
CHANGELOG.md bump linter to 0.1.92 2019-06-25 21:56:44 +00:00
codereview.settings Update codereview.settings to Gerrit (dart-review.googlesource.com) 2017-09-04 12:52:09 +00:00
CONTRIBUTING.md Change wiki link to follow contents moved. 2019-01-12 18:46:22 +00:00
DEPS bump linter to 0.1.92 2019-06-25 21:56:44 +00:00
LICENSE Remove the Dromaeo and TodoMVC samples. 2016-01-11 13:09:26 -08:00
PATENTS Move LICENSE, AUTHORS, PATENTS into the dart directory. 2014-02-10 06:48:47 +00:00
PRESUBMIT.py Allow lints in status file tests and front_end 2019-06-25 17:45:12 +00:00
README.dart-sdk remove docgen from the sdk 2015-09-18 13:18:10 -07:00
README.md Update README.md 2019-05-21 19:21:51 +00:00
WATCHLISTS Add fishythefish@ to dart2js watchlist. 2019-06-18 02:36:48 +00:00

Dart

A client-optimized language for fast apps on any platform

Dart is:

  • Optimized for UI: Develop with a programming language specialized around the needs of user interface creation

  • Productive: Make changes iteratively: use hot reload to see the result instantly in your running app

  • Fast on all platforms: Compile to ARM & x64 machine code for mobile, desktop, and backend. Or compile to JavaScript for the web

Dart has flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:

  • Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.

  • Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).

Dart platforms illustration

License & patents

Dart is free and open source.

See LICENSE and PATENTS.

Using Dart

Visit the dart.dev to learn more about the language, tools, getting started, and more.

Browse pub.dev for more packages and libraries contributed by the community and the Dart team.

Building Dart

If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.

There are more documents on our wiki.

Contributing to Dart

The easiest way to contribute to Dart is to file issues.

You can also contribute patches, as described in Contributing.