339 Commits

Author SHA1 Message Date
Chinmay Garde
cb00aac583 Allow specifying both Dart and non-Dart fixtures in engine unit-tests. (flutter/engine#9113)
* Allow specifying both Dart and non-Dart fixtures in engine unittests.

This fixes numerous issues in the way in which fixtures were managed
in the engine unit-tests.

* Instead of only being able to specify Dart fixtures, unit-tests may specify
  non-Dart fixtures as well. These are simply copied over to the fixtures
  directory known to the unit-test at runtime.
* An issue where numerous Dart files could be given to the kernel snapshotter
  has been addressed. It was anticipated that such a (legal) invocation to the
  kernel snapshotter would produce a snapshot with the contents of all the Dart
  files added to the root library. This is incorrect and the behavior in this
  case is undefined.
* Dart files referenced by the main Dart file are correctly tracked via a
  depfile.
* The snapshotter arguments have been cleaned up to get rid of unused
  arguments (`—strong`) and  the use of the VM product mode argument has been
  corrected to no longer depend on the Flutter product mode.
2019-05-28 19:11:47 -07:00
Chris Bracken
21fd6fb32a Correct typos, adopt US spellings (flutter/engine#9081)
Corects a bnuch of typeos throughout teh engien codebsae. Also makes
a couple minor Commonwealth -> US spelling adjustments for consistency
with the rest of Flutter's codebase.

Made use of `misspell` tool:
https://github.com/client9/misspell
2019-05-25 13:14:46 -07:00
Matthew Dempsky
0bca459e28 Replace ararysize macro with fml::size function (flutter/engine#8975)
This is forward compatible with std::size and similar to how Chromium
removed use of the arraysize macro.
2019-05-15 12:43:47 -07:00
Matthew Dempsky
8b4a5398ae Roll tonic and update #includes (flutter/engine#8950) 2019-05-14 11:57:09 -07:00
Jason Simmons
f1ef8c2748 Add a minimal set of symbols to the dynamic symbol table for Linux executables (flutter/engine#8937)
This will reduce executable size.
2019-05-13 16:12:58 -07:00
Dan Field
c96714ac5d new lints (flutter/engine#8849)
Dart lints added:
* Avoid optional new
* Avoid optional const
* Prefer single quotes
* Prefer default assignment `=`
2019-05-07 16:10:21 -07:00
Jason Simmons
244d864381 Log the sticky error during isolate shutdown (flutter/engine#8742)
The sticky error may be set in cases such as an unhandled asynchronous
exception.  This is similar to the logging done in the Dart command line
embedder's isolate shutdown callback.
2019-04-25 15:08:53 -07:00
Zachary Anderson
0299216745 Plumb arguments from Settings to Dart main() (flutter/engine#8710) 2019-04-25 07:57:54 -07:00
Chinmay Garde
0b2269e30e Put the testing lib in the flutter namespace. (flutter/engine#8661) 2019-04-20 20:42:46 -07:00
Chinmay Garde
572b7b80fb Allow native bindings in secondary isolates. (flutter/engine#8658)
The callbacks can be wired in via the Settings object. Both runtime and shell unit-tests have been patched to test this.
2019-04-19 17:36:36 -07:00
Chinmay Garde
1133591eeb Add factory methods to FileMapping that make it easy to create common mappings. (flutter/engine#8652)
The GetMapping calls removed in this patch had the same code and had to be repeated across different test harnesses as well as in dart_snapshot.cc. Just make this a factory method so the code is less verbose.
2019-04-19 12:48:53 -07:00
Chinmay Garde
46f575eccb Reland "Remove DartSnapshotBuffer and dry up snapshot resolution logic". (flutter/engine#8645)
This reverts commit 1c06891c101f530c1f46337b457ba02e0f6c8633.
Windows depends on referencing the snapshot symbols directly instead of
via dlsym. Something in the way these symbolsa are generated in
bin_to_assembly.py is causing them to be inaccessible at runtime.
2019-04-18 18:54:43 -07:00
Matthew Dempsky
7f196fec73 Remove unnecessary DartIO::EntropySource wrapper (flutter/engine#8635) 2019-04-18 17:15:04 -07:00
Chinmay Garde
1c06891c10 Revert "Remove DartSnapshotBuffer and dry up snapshot resolution logic. (#8640)" (flutter/engine#8644)
This reverts commit 29b322db9ecd6f8fad72b5f7ad91a64e01c89958.
2019-04-18 16:46:03 -07:00
Chinmay Garde
29b322db9e Remove DartSnapshotBuffer and dry up snapshot resolution logic. (flutter/engine#8640)
Fixes https://github.com/flutter/flutter/issues/26782.
2019-04-18 16:01:19 -07:00
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