324 Commits

Author SHA1 Message Date
Chinmay Garde
bc51cf62bb Merge runtime lifecycle unittests into the base test target. (flutter/engine#8634)
`//flutter/runtime: runtime_lifecycle_unittests` was added because the these assumed that there was no VM already running in the process. Running other tests in the base target would mess up that assumption. Now that all test targets have been updated to make sure the VM instance does not leak, the tests in this target can be merged.

LUCI bots don’t need to be patched as these tests were only ever run on the trybots.
2019-04-18 12:15:45 -07:00
Chinmay Garde
24ee83dbde Test saving compilation traces. (flutter/engine#8618) 2019-04-17 19:42:33 -07:00
Chinmay Garde
bc238390cc Avoid leaking the VM in runtime_unittests and update failing tests. (flutter/engine#8626)
The failing tests were depending on the old assumption that the VM would never
shutdown.
2019-04-17 19:06:03 -07:00
Chinmay Garde
22a0517fb6 Assert that all VM launches in the process have the same opinion on whether the VM should be leaked in the process. (flutter/engine#8622)
There is a possibility for a VM launch to not have a requisite shutdown if a previous launch asked to leak the VM instance in the process. Embedders have to ensure (via their Embedding APIs) that all instances of VM launch use consistent settings.
2019-04-17 17:25:16 -07:00
Chinmay Garde
54927647c6 Avoid manually shutting down engine managed isolates. (flutter/engine#8621)
These are now shutdown by the VM and cleanup waits for their shutdown.
2019-04-17 16:11:47 -07:00
liyuqian
27e4dac06b Rename flow namespace to flutter (flutter/engine#8615)
This follows our namespace change from shell to flutter: https://github.com/flutter/engine/pull/8520.
2019-04-17 14:38:45 -07:00
Ben Konyi
c1a253633c Added support for authentication codes for the VM service (flutter/engine#8527) 2019-04-10 14:38:58 -07:00
Chinmay Garde
72111314cb Remove redundant specification of the |flutter| namespace in the engine. (flutter/engine#8523) 2019-04-09 17:50:06 -07:00
Chinmay Garde
1fd28a143a Rename the blink namespace to flutter. (flutter/engine#8517)
Some components in the Flutter engine were derived from the forked blink codebase. While the forked components have either been removed or rewritten, the use of the blink namespace has mostly (and inconsistently) remained. This renames the blink namesapce to flutter for consistency. There are no functional changes in this patch.
2019-04-09 12:44:42 -07:00
Chinmay Garde
650a39ae7d Get rid of the macro for accessing the current test name. (flutter/engine#8500) 2019-04-08 16:11:21 -07:00
Chinmay Garde
19d5a39d24 Enable shutting down all root isolates in a VM. (flutter/engine#8457)
This reverts commit 9cd2e8351c47b7a78c1005341f4b5e1a2f125695.
2019-04-05 13:34:40 -07:00
Chinmay Garde
9cd2e8351c Revert "Enable shutting down all root isolates in a VM. (#8402)" (flutter/engine#8431)
This reverts commit 56252a8aacaf29a17853e3ade6978972689dff18.
2019-04-03 17:08:56 -07:00
Chinmay Garde
56252a8aac Enable shutting down all root isolates in a VM. (flutter/engine#8402) 2019-04-03 15:44:29 -07:00
Chinmay Garde
736277e9c7 Revert "Revert "Separate the data required to bootstrap the VM into its own class. (#8397)" (#8406)" (flutter/engine#8414)
This reverts commit 8a0076fdddc96b4ec2fb67f45051aa490827fc02.
2019-04-03 13:38:12 -07:00
Zachary Anderson
8a0076fddd Revert "Separate the data required to bootstrap the VM into its own class. (#8397)" (flutter/engine#8406)
This reverts commit 38f5fc418a08ed43945ad21d19494d6b352e1443.
2019-04-02 09:12:56 -07:00
Chinmay Garde
38f5fc418a Separate the data required to bootstrap the VM into its own class. (flutter/engine#8397)
When attempting to shutdown and subsequently restart the VM, having the
VM own this data introduces lifecycle issues due to circular references.
2019-04-01 14:58:05 -07:00
Chinmay Garde
59ae3ba236 Remove unused DartVM::IsKernelMapping (flutter/engine#8381) 2019-03-29 20:53:40 -07:00
Chinmay Garde
18af29469e Allow native entrypoint registration for runtime unittests. (flutter/engine#8379) 2019-03-29 17:53:49 -07:00
Chinmay Garde
39fb01b459 Allow running runtime_unittests in AOT mode. (flutter/engine#8375)
Previously, only the most basic tests were run in AOT mode.
2019-03-29 17:15:38 -07:00
Chinmay Garde
9a54dbc65a Move libdart selection into its own target in //flutter/runtime. (flutter/engine#8373)
Cleanup repeated rules.
2019-03-29 14:29:09 -07:00
Chinmay Garde
1a7c5d7bf3 GN Format all files in the engine. (flutter/engine#8369) 2019-03-29 12:44:57 -07:00
Ben Konyi
af75dc6f01 Fixed service isolate not being initialized correctly due to bad name (flutter/engine#8251)
* Fixed service isolate not being initialized correctly due to bad name

The name for the service isolate was being set to the empty string,
causing the microtask loop to not be run on the service isolate leading
to the service hanging on the first 'await'. See
https://dart-review.googlesource.com/c/sdk/+/97107 for revert due to
this issue.

* Removed unnecessary params from DartCreateAndStartServiceIsolate
2019-03-26 14:36:51 -07:00
Gary Qian
1d587c84cb Re-land "Buffer lifecycle in WindowData" (flutter/engine#8032) 2019-03-06 15:38:34 -08:00
Gary Qian
d689b45ab1 Revert "Buffer lifecycle in WindowData (#7999)" (flutter/engine#8010)
This reverts commit 03bec0d1b68ff57b6bf31d7cb8586837443b05fd.
2019-03-01 15:14:20 -08:00
Gary Qian
03bec0d1b6 Buffer lifecycle in WindowData (flutter/engine#7999) 2019-03-01 10:43:09 -08:00
Ben Konyi
0669ddc849 Link dart:* sources into engine for debugger source support (flutter/engine#7908)
Link dart:* sources into engine for debugger source support

Currently, dart:* libraries appear to have no source in
debuggers like Observatory. With this change, these sources will be
available in debug mode applications. Sources for dart:* libraries are
lazily loaded on a script-by-script basis.

Refer to https://dart-review.googlesource.com/c/sdk/+/93375 for the Dart
SDK change.
2019-02-26 13:28:04 -08:00
Dan Field
53102bd3a2 Test profile and release build and unit tests (flutter/engine#7880)
* Test profile build and unit tests

* update googletest, skip JIT tests on non-debug builds
2019-02-20 20:13:02 -08:00
Dan Field
4206f443f7 Revert "Shut down and restart the Dart VM as needed. (#7832)" (flutter/engine#7877)
This reverts commit 75a66f31dc2a02ccb54f10fb4477233086f4906b.
2019-02-19 16:14:18 -08:00
Chinmay Garde
75a66f31dc Shut down and restart the Dart VM as needed. (flutter/engine#7832)
The shell was already designed to cleanly shut down the VM but it couldnt
earlier as |Dart_Initialize| could never be called after a |Dart_Cleanup|. This
meant that shutting down an engine instance could not shut down the VM to save
memory because newly created engines in the process after that point couldn't
restart the VM. There can only be one VM running in a process at a time.

This patch separate the previous DartVM object into one that references a
running instance of the DartVM and a set of immutable dependencies that
components can reference even as the VM is shutting down.

Unit tests have been added to assert that non-overlapping engine launches use
difference VM instances.
2019-02-15 14:16:17 -08:00
Chinmay Garde
e361547b05 Allow the engine to redirect traces to systrace via settings. (flutter/engine#7617) 2019-01-28 17:39:31 -08:00
Chinmay Garde
3a5bd32ed8 Re-land "Wrap the user entrypoint function in a zone with native exception callback. (#7512)" (flutter/engine#7551)
This reverts commit 32ae75d8847612c26c67315104b76f3c9212e7b2 and applies relevant fixes.
2019-01-24 13:42:51 -08:00
Chinmay Garde
1f528fef75 Allow embedders to specify AOT snapshot buffers. (flutter/engine#7538) 2019-01-18 16:32:35 -08:00
Vyacheslav Egorov
32ae75d884 Revert "Wrap the user entrypoint function in a zone with native exception callback. (#7512)" (flutter/engine#7522)
This reverts commit 524a12d0468e1a536d74f866796e1cdd7ccaa35e.

Reason for revert: broken in AOT mode.

@pragma('vm:entry-point') placed on a function only instructs
the compiler to retain the function itself, but does not tell
compiler to generate and retain tear-off for this function.

In this PR _runMainZoned was marked as an entry-point but C++
code was trying to tear it off and use a closure, instead of
invoking it directly, which is not supported.
2019-01-17 11:49:20 +01:00
Chinmay Garde
524a12d046 Wrap the user entrypoint function in a zone with native exception callback. (flutter/engine#7512) 2019-01-16 16:08:51 -08:00
Chinmay Garde
a28c25617c Add unittest that runs Dart code synchronously. (flutter/engine#7495) 2019-01-15 16:22:57 -08:00
Chinmay Garde
dad7c0ddf2 Add runttime unittest that loads and runs an isolate from the kernel. (flutter/engine#7493) 2019-01-15 15:28:30 -08:00
Alexander Markov
b96edf5b9d Cleanup Dart sticky errors API and roll tonic to 4634b29a24ccfc0fcfafcc8196ef30131185ad88 (flutter/engine#7492)
This PR prepares Flutter engine for the cleanup of Dart API Dart_GetStickyError/Dart_SetStickyError/Dart_HasStickyError.
2019-01-15 15:26:20 -08:00
Dan Field
a9728ab07a Make IOManager own resource context (flutter/engine#7272)
* Make IOManager own resource context
2019-01-14 13:46:38 -08:00
Dan Field
2eae3feaaf fix up analysis for Dart in Engine (flutter/engine#7404)
* fix up analysis for Dart in Engine, particularly for tests
2019-01-11 13:50:58 -08:00
Jason Simmons
c937fa2a71 Make SetLocales more consistent with other RuntimeController methods (flutter/engine#7447) 2019-01-10 17:30:58 -08:00
Zachary Anderson
6bd9431a0c Pass deadline to embedder idle notification callback (flutter/engine#7444) 2019-01-10 14:08:43 -08:00
Chinmay Garde
074da7fd65 Allow embedders to add per shell idle notification callbacks. (flutter/engine#7427) 2019-01-09 14:33:56 -08:00
Chris Bracken
8a0cc94b1a Compile embedder unit test Dart to kernel (flutter/engine#7231)
As of the migration to Dart 2, it has been necessary to compile Dart to
kernel prior to execution. The embedder currently requires that the
resulting kernel file be named `kernel_blob.bin` and be located at the
root of the assets directory passed to the embedder API.

This patch updates the test_fixtures build rule to perform a kernel
compile using frontend_server, outputting `kernel_blob.bin` to
`fixtures/test_target_name` directory, and updates the embedder
unittests to specify the kernel file rather than the Dart source file.

Since the kernel compiler requires a `main()` function to be defined, it
also updates `simple_main.dart` from runtime_unittests to define
`main()` rather than `simple_main()`.

This also updates all existing sub-targets to be testonly.

This relands commit 4e4fb4608da95d198b0e796478462285ab974a3c, which was
reverted in commit 566db0ecb8f293bb9f7ff1fc39076b08336e0148. Rather than
running as prebuilt_dart_action, we use dart_action to ensure the
frontend snapshot it compatible with the VM on which it's executed.
2018-12-16 12:23:18 -08:00
Chris Bracken
566db0ecb8 Revert "Compile embedder unit test Dart to kernel (#7227)" (flutter/engine#7230)
This reverts commit 4e4fb4608da95d198b0e796478462285ab974a3c.

This broke dynamic release mode builds of
//flutter/runtime:runtime_fixtures_kernel (likely all product-mode
builds).
2018-12-15 14:43:26 -08:00
Chris Bracken
4e4fb4608d Compile embedder unit test Dart to kernel (flutter/engine#7227)
Compile embedder unit test Dart to kernel

As of the migration to Dart 2, it has been necessary to compile Dart to
kernel prior to execution. The embedder currently requires that the
resulting kernel file be named `kernel_blob.bin` and be located at the
root of the assets directory passed to the embedder API.

This patch updates the test_fixtures build rule to perform a kernel
compile using frontend_server, outputting `kernel_blob.bin` to
`fixtures/test_target_name` directory, and updates the embedder
unittests to specify the kernel file rather than the Dart source file.

Since the kernel compiler requires a `main()` function to be defined, it
also updates `simple_main.dart` from runtime_unittests to define
`main()` rather than `simple_main()`.

This also updates all existing sub-targets to be testonly.
2018-12-15 13:59:58 -08:00
Gary Qian
28bc1c1212 Minor Docs to runtime controller WindowData (flutter/engine#6991) 2018-12-12 17:25:56 -08:00
liyuqian
efc116e72c Support querying display refresh rate in engine (flutter/engine#7002)
The current implementation only deals with Android devices and we'll add iOS devices support soon.
2018-12-12 10:28:44 -08:00
Chris Bracken
f604da6409 Rename dart-non-checked-mode: disable-dart-asserts (flutter/engine#6977)
In Dart 2, runtime checked mode has been eliminated. Many of these type
checks have been moved to static compile-time checks, the remainder are
enforced at runtime, and are no longer optional.
2018-12-10 12:36:09 -08:00
Alexander Aprelev
839fd8348a Guard the service protocol's global handlers list with a reader/writer lock. (flutter/engine#6900)
* Revert "Revert "Guard the service protocol's global handlers list with a reader/writer lock (#6888) #6895" (#6899)"

This reverts commit bcf5e1eae123478564468b77251a2674bd0e773e and applies fix for tests on Windows.

* Reland guard the service protocol's global handlers list with a reader/writer lock.

* Remove blank line
2018-11-18 14:36:15 -08:00
Todd Volkert
bcf5e1eae1 Revert "Guard the service protocol's global handlers list with a reader/writer lock (#6888) #6895" (flutter/engine#6899) 2018-11-18 09:28:26 -08:00