Commit Graph

299 Commits

Author SHA1 Message Date
Ben Konyi fb1c543dd4 Link dart:* sources into engine for debugger source support (#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 39f7066b69 Test profile and release build and unit tests (#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 572fea361c Revert "Shut down and restart the Dart VM as needed. (#7832)" (#7877)
This reverts commit 0d6ff1669c.
2019-02-19 16:14:18 -08:00
Chinmay Garde 0d6ff1669c Shut down and restart the Dart VM as needed. (#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 79dc315dc4 Allow the engine to redirect traces to systrace via settings. (#7617) 2019-01-28 17:39:31 -08:00
Chinmay Garde 23b7e29f04 Re-land "Wrap the user entrypoint function in a zone with native exception callback. (#7512)" (#7551)
This reverts commit 4c135c298a and applies relevant fixes.
2019-01-24 13:42:51 -08:00
Chinmay Garde 898b4f8da4 Allow embedders to specify AOT snapshot buffers. (#7538) 2019-01-18 16:32:35 -08:00
Vyacheslav Egorov 4c135c298a Revert "Wrap the user entrypoint function in a zone with native exception callback. (#7512)" (#7522)
This reverts commit 25559ed077.

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 25559ed077 Wrap the user entrypoint function in a zone with native exception callback. (#7512) 2019-01-16 16:08:51 -08:00
Chinmay Garde 5983e34a3c Add unittest that runs Dart code synchronously. (#7495) 2019-01-15 16:22:57 -08:00
Chinmay Garde 55974d686a Add runttime unittest that loads and runs an isolate from the kernel. (#7493) 2019-01-15 15:28:30 -08:00
Alexander Markov 840164b2bb Cleanup Dart sticky errors API and roll tonic to 4634b29a24ccfc0fcfafcc8196ef30131185ad88 (#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 43fa420b04 Make IOManager own resource context (#7272)
* Make IOManager own resource context
2019-01-14 13:46:38 -08:00
Dan Field 6179ac6377 fix up analysis for Dart in Engine (#7404)
* fix up analysis for Dart in Engine, particularly for tests
2019-01-11 13:50:58 -08:00
Jason Simmons 358a24c499 Make SetLocales more consistent with other RuntimeController methods (#7447) 2019-01-10 17:30:58 -08:00
Zachary Anderson b7f6bf0192 Pass deadline to embedder idle notification callback (#7444) 2019-01-10 14:08:43 -08:00
Chinmay Garde b972f75db5 Allow embedders to add per shell idle notification callbacks. (#7427) 2019-01-09 14:33:56 -08:00
Chris Bracken 67cd7d4d3b Compile embedder unit test Dart to kernel (#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 ac9e521a1d, which was
reverted in commit 4941125829. 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 4941125829 Revert "Compile embedder unit test Dart to kernel (#7227)" (#7230)
This reverts commit ac9e521a1d.

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 ac9e521a1d Compile embedder unit test Dart to kernel (#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 0ea994a649 Minor Docs to runtime controller WindowData (#6991) 2018-12-12 17:25:56 -08:00
liyuqian 2bd75ae8ba Support querying display refresh rate in 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 08922e112d Rename dart-non-checked-mode: disable-dart-asserts (#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 cebde437a1 Guard the service protocol's global handlers list with a reader/writer lock. (#6900)
* Revert "Revert "Guard the service protocol's global handlers list with a reader/writer lock (#6888) #6895" (#6899)"

This reverts commit b6e93759fa 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 b6e93759fa Revert "Guard the service protocol's global handlers list with a reader/writer lock (#6888) #6895" (#6899) 2018-11-18 09:28:26 -08:00