466 Commits

Author SHA1 Message Date
Chris Bracken
08dabe9601
Clean up C++ includes (#21127)
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes.

Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively.

Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676

This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
2020-09-11 21:18:35 -07:00
Chris Bracken
16b900b63e
Prefer C++ standard headers to their C counterpart (#21091)
We currently use a mix of C standard includes (e.g. limits.h) and their
C++ variants (e.g. climits). This migrates to a consistent style for all
cases where the C++ variants are acceptable, but leaves the C
equivalents in place where they are required, such as in the embedder
API and other headers that may be used from C.
2020-09-11 17:10:00 -07:00
Zachary Anderson
f7c7b41f0a
Revert "Enable lazy-async-stacks by-default in all modes (Take 3) (#20895)" (#21043)
This reverts commit 575a51948d81756c778352b40f639fa557325fd7.
2020-09-09 09:25:17 -07:00
Chinmay Garde
f0fb74b8fb
Avoid crashing and display error if the process cannot be prepared for JIT mode Dart VM. (#20980) 2020-09-08 13:41:31 -07:00
Clement Skau
575a51948d
Enable lazy-async-stacks by-default in all modes (Take 3) (#20895)
Lazy async stacks were already enabled by-default in AOT mode in [0] - which made the
gen_snapshot invocations use "--lazy-async-stacks --no-causal-async-stacks".

This change does the same with the engine defaults, which makes this be enabled
by-default in JIT mode as well.

See go/dart-10x-faster-async for more information.

This is a re-land: A fix for what we believe to have caused the last revert has landed upstream in Dart in dart-lang/sdk@0004589

[0] flutter/flutter@3478232
2020-09-07 10:55:48 +02:00
Nathan Rogers
68b7b8401a
[fuchsia] Send trace events to system tracing on all configurations (#20974)
This change reverts https://github.com/flutter/engine/pull/15900.  The
design of the expected consumer of the original PR changed, and the
feature ended up going unused.  Since the unexpected difference in trace
event routing behavior has mostly ended up as a source of confusion,
change things back to route trace events to Fuchsia system tracing on
all configurations.
2020-09-03 10:21:36 -07:00
Dan Field
634e499bcc
Use hint freed specifically for image disposal (#20754)
* Use hint freed specifically for image disposal
2020-09-02 13:41:58 -07:00
Yuqian Li
5585ed9903
Revert "Create root isolate asynchronously (#20142)" (#20937)
This reverts commit 95f2b72728ee7e51800f1784e458e45dac675b3a.
2020-09-01 22:05:53 -07:00
chenjianguang
95f2b72728
Create root isolate asynchronously (#20142)
## Description
As the related issue refer, the application may be doing too much work on its main thread even in a simple hello_world demo.
That is because the creation of `Engine` on the ui thread takes a noticeable time, and it is blocking the platform thread in order to run `Shell::Setup` synchronously.
The cost of `Engine`'s constructor is mainly about the creating of root isolate. Actually, there used to be another time-consuming process, the default font manager setup, which was resolved by https://github.com/flutter/engine/pull/18225. 
Similar to https://github.com/flutter/engine/pull/18225, this pr move the creation of root isolate out from creating `Engine`. After this action, the main thread blocking is quite an acceptable slice.

## Related Issues
https://github.com/flutter/flutter/issues/40563 could be resolved by this pr.
2020-09-01 13:31:00 -07:00
Dan Field
4a88d5e109
Revert hint_freed (#20746)
This caused over-aggressive GCs, which vastly increased CPU usage benchmarks.

* Revert "fix build (#20644)"

This reverts commit b59793ee20be29463fac7a79635bf20253f04107.

* Revert "Hint freed (#19842)"

This reverts commit 3930ac1b25820baee3c67d921a0b009606cb3dae.
2020-08-25 11:55:40 -07:00
David Worsham
4dc866283d
fuchsia: Convert legacy permutations to build flag (#20647) 2020-08-19 19:09:51 -07:00
Dan Field
3930ac1b25
Hint freed (#19842)
* Hint the VM when a layer or picture goes out of scope
2020-08-19 14:04:31 -07:00
Yuqian Li
f644d03500
Add a service protocol for raster cache memory (#20466)
Related issue: https://github.com/flutter/flutter/issues/56719
2020-08-13 20:11:47 -07:00
Mehmet Fidanboylu
dd2c5a1b8b
Plumbing for setting domain network policy (#20218) 2020-08-13 07:26:43 -07:00
gaaclarke
2ea8396860
Added unit tests to the engine. (#20216) 2020-08-07 15:55:58 -07:00
Mehmet Fidanboylu
a765090dd8
Fix inconsistent import. (#20206) 2020-08-03 10:29:52 -07:00
Zachary Anderson
7dd092dd31
Enable more linting (#20187) 2020-07-31 21:30:58 -07:00
Greg Spencer
98cfd1db78
Move platform specific information to PlatformConfiguration class (#19652) 2020-07-31 17:21:02 -07:00
Jason Simmons
ee4d50cd07
Revert "Enable lazy-async-stacks by-default in all modes (2) (#19270)" (#20165)
This reverts commit 06fef5e36360e61a557fed546d12048427eb2340.
2020-07-30 18:34:51 -07:00
Siva
b955e15ee9
Manual roll of Dart from 24c7666def...40fd1c456e (#20092)
* Manual roll of Dart from 24c7666def...40fd1c456e

dart-lang/sdk@40fd1c456e Revert "[dart:io] Add Abort() on HttpClientRequest"
dart-lang/sdk@17d7296a42 [vm/nnbd/bytecode] Fix reuse of type arguments in bytecode
dart-lang/sdk@58b6f40c73 Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns. (reland)
dart-lang/sdk@fc8a6d9f9b [VM/compiler] Dereference TypeRef literal when propagating constants.
dart-lang/sdk@0689ec527a Move "test.dart" (well, most of its contents) into pkg/test_runner.
dart-lang/sdk@1094b3c61d Prepare static error test updater tool to handle web tests.
dart-lang/sdk@b258585f2f [observatory] Migrate from deprecated isInstanceOf to isA.
dart-lang/sdk@dfe1d9b682 Disable OverrideContributor for Cider.
dart-lang/sdk@aea99b2f5c scope debug property assist to Diagnosticables
dart-lang/sdk@4b96f20a79 [dart:io] Add Abort() on HttpClientRequest
dart-lang/sdk@1b1a39708c [build] Use frameworks instead of libs
dart-lang/sdk@3fef522496 Revert "Reland "[vm] Replaces fuchsia.deprecatedtimezone""
dart-lang/sdk@8c664d4f3f Revert "Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns."
dart-lang/sdk@2efb5bebc7 [ dart:_http ] Fix typo in HTTP response timeline event
dart-lang/sdk@0884dae36c Revert "Fix the #include path for ICU headers"
dart-lang/sdk@5171534e81 Scope tweaks. Report REFERENCED_BEFORE_DECLARATION in more places.
dart-lang/sdk@6bba75079a Issue 42797. Understand in legacy libraries that a function returning Never (in Null Safety library) never returns.
dart-lang/sdk@b4ebbb7f5c [build] Update gn to match Fuchsia
dart-lang/sdk@cb428a7a02 [dart2js] Remove old bug work around in collector.
dart-lang/sdk@08663c20ab Change flutter patch to match existing DEPS on master branch
dart-lang/sdk@146ad014d9 update js/meta for the 2.10 dev sdk
dart-lang/sdk@488c718793 [co19] Roll co19 to d79951e06e443213243e54c2c32694b79a221b65
dart-lang/sdk@ba20edd7be Add patch for flutter-engine when changing to version 2.10

* Rev buildroot to latest version.

* Update license.

* update.

* Update gn revision.

* Format BUILD.gn files as the gn revision has been updated.
2020-07-29 13:10:15 -07:00
Clement Skau
06fef5e363
Enable lazy-async-stacks by-default in all modes (2) (#19270) 2020-07-29 12:25:30 +02:00
gaaclarke
21efd7325e
Made the linter print out more information in its output and fixed bugs (#19895) 2020-07-22 15:38:09 -07:00
David Worsham
9353692cdb
fuchsia: Enable most unittests (#19583)
Tweak the primary flutter build rule so that fuchsia is more similar to
other platforms in how tests and the shell are built.

Only embedder_unittests and GLFW tests are disabled on Fuchsia now.

TEST: Ran unittests on host/fuchsia; workstation on fuchsia
BUG: fxb/53847, fxb/54056
2020-07-13 17:36:19 -07:00
liyuqian
e9e59f4e2b
Use FixtureTest to remove duplicate code (#19219)
Fixes https://github.com/flutter/flutter/issues/59109
2020-06-30 10:55:38 -07:00
David Worsham
220a831028
Move fuchsia/scenic integration behind #define (#19003)
Additionally create "_next" permutations for all of the test binaries
on Fuchsia, in order to test both code-paths.

Using the #define follow-up CLs can also create a flutter_runner_next
binary that does not contain any legacy integration code.

BUG: 53847
2020-06-26 14:03:18 -07:00
Gary Qian
637a8e7cd0
Revert method channel platform resolved locale (#19136) 2020-06-19 17:40:22 -07:00
Gary Qian
3a96741247
Platform resolved locale and Android localization refactor (#18645) 2020-06-16 04:29:50 -07:00
stuartmorgan
903ef0892f
Support AOT mode for Windows (#18589)
- Adds a way to provide an AOT library to the C API.
- Adds app.so to the information provided by DartProject.
- Fixes the engine to only do static snapshot linking for Windows in
  debug mode, not all modes, so that the provided library is used.

Engine side of https://github.com/flutter/flutter/issues/38477
2020-05-26 11:01:48 -07:00
Jason Simmons
88b9d42400
Remove the global engine entry timestamp (#18182)
The engine was using a global to store a timestamp representing the
launch of the engine.  This timestamp is initialized with a JNI call
on Android and during shell setup on other platforms.  Later the
timestamp is added to a FlutterEngineMainEnter timeline event used to
measure engine startup time in benchmarks.

This PR removes the global and the JNI call and moves the timestamp
into the settings object.
2020-05-07 11:29:28 -07:00
Alexander Aprelev
1c8ee9856b
Introduce runtime check that it is root isolate that makes UI native calls. (#18050)
* Revert "Do not register UI-related native functions in secondary isolates (#6401)"

This reverts commit 69ae5694de54d2a163743dcec727fcea1c7bc8e1 as it doesn't work when root and secondary isolates run in the same isolate group.

* Confirm it is root isolate that makes UI native calls.

* Fix format, UIDartState reference from Fuchsia source

* No UI isolate check for fuchsia calls

* Fix typo. Remove redundant runtime calls
2020-05-01 09:05:41 -07:00
Gary Qian
8dc91229b4
PlatformResolvedLocale localization message channel (#17755) 2020-04-21 15:34:44 -07:00
Mehmet Fidanboylu
47a88e8ea3
Add support for setting allow http flag in Dart VM (#17653) 2020-04-11 11:55:05 -07:00
Chris Bracken
e55b4476f1
Use const refs in for loops where reasonable (#17484)
This patch optimizes C++11 range-based for loops where the variable is
copied in each iteration but it would suffice to obtain it by const
reference. This is only applied to loop variables of types that are
expensive to copy which means they are not trivially copyable or have a
non-trivial copy constructor or destructor.

To ensure that it is safe to replace the copy with a const reference
only the following cases are modified:
  * The loop variable is const-qualified.
  * The loop variable is not const, but only const methods or operators
    are invoked on it, or it is used as const reference or value argument
    in constructors or function calls.

This is an application of the internal performance-for-range-copy
clang-tidy analysis.
2020-04-03 11:44:35 -07:00
liyuqian
807ca8543c
More rename from GPU thread to raster thread (#17408)
This PR touches variable names, class names, and file names so it's significantly more risky than its predecessor https://github.com/flutter/engine/pull/17329

Due to file name changes, this PR is expected to change the license files.

We haven't rename `shell/gpu` to `shell/raster` yet. It should be optional but I think it's better to have `raster_surface_software.cc` than `gpu_surface_software.cc`.
2020-03-31 14:05:28 -07:00
Chinmay Garde
10887c2abe
Document flutter::SkiaConcurrentExecutor. (#17394) 2020-03-30 16:45:51 -07:00
Chinmay Garde
70f5a07fe6
Document flutter::DartVMData. (#17392) 2020-03-30 00:20:54 -07:00
liyuqian
bb35963050
Add service protocol to get SkSLs (#17300)
Fixes https://github.com/flutter/flutter/issues/53114
2020-03-24 21:42:12 -07:00
Chinmay Garde
3a68f68999
Document flutter::DartServiceIsolate. (#17301) 2020-03-24 12:49:13 -07:00
Chinmay Garde
9c64029758
Documentation cleanups to RuntimeController. (#17256)
Based on feedback gather in https://github.com/flutter/engine/pull/17250 after it landed.
2020-03-22 14:03:22 -07:00
Chinmay Garde
31c47278ba
Document flutter::RuntimeController. (#17250) 2020-03-21 22:12:54 -07:00
Chinmay Garde
a37560a074
Use the standard [[nodiscard]] attribute instead of an FML macro. (#17100) 2020-03-11 13:36:01 -07:00
Chinmay Garde
bcefcdb880
Use the ELF loader to setup AOT symbols in benchmark runner. (#17051)
We no longer package AOT artifacts as discrete blobs. The portable ELF loader
from the testing library may be used instead.

Fixes https://github.com/flutter/flutter/issues/52263
2020-03-10 12:28:24 -07:00
Dan Field
b77f509e0b
Refactor isolate test (#16933)
Make the test harness reusable for other tests that want to launch a Dart VM
2020-03-04 11:10:39 -08:00
Dan Field
888a62cf22
Revert "Enable lazy-async-stacks by-default in all modes (#16556)" (#16781)
This reverts commit fdabcaddf45deaf93a5238c99c2acbeb25a3a027.
2020-02-24 20:04:40 -08:00
Martin Kustermann
fdabcaddf4
Enable lazy-async-stacks by-default in all modes (#16556)
This was already enabled by-default in AOT mode in [0] - which made the
gen_snapshot invocations use "--lazy-async-stacks --no-causal-async-stacks".

See go/dart-10x-faster-async for more information.

[0] https://github.com/flutter/flutter/commit/347823234fd
2020-02-20 18:31:26 +01:00
George Wright
0517627988 Enable runtime_unittests on Fuchsia 2020-02-06 13:52:33 -08:00
stuartmorgan
9ad81dae16
Wrap strdup to use compliant name on Windows (#16372)
A number of POSIX methods were renamed on Windows to match standards
requirements, giving deprecation warnings when calling strdup on Windows.
This adds a wrapper, to allow calling _strdup on Windows instead.

Part of #16256
2020-02-05 22:32:56 -08:00
Jonah Williams
7e1d1440a3
Expose enable-service-port-fallback switch (#16366) 2020-02-04 12:00:58 -08:00
Chinmay Garde
f7b78e001d
Remove all uses of the redundant flutter_root variable. (#16311)
This was only necessary when the Engine had to build in multiple buildroots
where the sources where checked out at different paths relative to the
buildroot. This is no longer the case and there are already cases GN rules
have been written that mix and match variable usage with the direct
specification of the path to the Flutter sources relative to the sole buildroot.
2020-01-31 21:49:48 -08:00
Chinmay Garde
dffe3fb276
Isolate and move common portable ELF loading from fixtures into //flutter/testing. (#16305)
Also update all known test harnesses to use this and fixes the broken shell_unittests harness.

Fixes https://github.com/flutter/flutter/issues/49853
2020-01-31 12:52:00 -08:00