- 31 1月, 2020 1 次提交
-
-
由 Chinmay Garde 提交于
These add no value to engine developers anymore and are not visible to external users because of the low log severity.
-
- 11 12月, 2019 1 次提交
-
-
由 Jason Simmons 提交于
Isolate data may need to be deleted on the same thread where it was allocated. In particular, the task observer set up in the UIDartState ctor must be removed from the same message loop where it was added. The engine had been using the same DartIsolate object as the root isolate data and as the isolate group data. This object would be deleted when the isolate group was shut down. However, group shutdown may occur on a thread associated with a secondary isolate. When this happens, cleanup of any state tied to the root isolate's thread will fail. This change adds a DartIsolateGroupData object holding state that is common among all isolates in a group. DartIsolateGroupData can be deleted on any thread. See https://github.com/flutter/flutter/issues/45578
-
- 16 11月, 2019 1 次提交
-
-
由 Alexander Aprelev 提交于
* Revert "Revert "Provide dart vm initalize isolate callback so that children isolates belong to parent's isolate group. (#9888)" (#12327)" * Ensure that when isolate shuts down it calls isolate_data, rather than isolage_group_data callback.
-
- 01 11月, 2019 1 次提交
-
-
由 gaaclarke 提交于
Put `Picture.toImage` back on the GPU thread. Left the unit tests intact.
-
- 23 10月, 2019 1 次提交
-
-
由 Ryan Macnak 提交于
Remove dead shared snapshot arguments to Dart_CreateIsolateGroup. 6a65ea9cad4b [vm] Remove shared snapshot and reused instructions features. db8370e36147 [gardening] Fix frontend-server dartdevc windows test. 4601bd7bffea Modified supertype check error message to be more descriptive. 0449905e2de6 [CFE] Add a serialization-and-unserialization step to strong test c8b903c2f94f Update CHANGELOG.md 2a12a13d9684 [Test] Skips emit_aot_size_info_flag_test on crossword. b26127fe01a5 [cfe] Add reachability test skeleton
-
- 22 10月, 2019 1 次提交
-
-
由 Jason Simmons 提交于
Obtaining the SkiaUnrefQueue through the IOManager is unsafe because UIDartState has a weak pointer to the IOManager that can not be dereferenced on the UI thread.
-
- 11 10月, 2019 2 次提交
-
-
由 Chinmay Garde 提交于
This reverts commit e96c7404.
-
由 Gary Qian 提交于
-
- 24 9月, 2019 1 次提交
-
-
由 Alexander Aprelev 提交于
* Update secondary-isolate-launch test to verify that secondary isolate gets shutdown before root isolate exits. * ci/format.sh
-
- 24 8月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
We will end up creating fewer threads in tests.
-
- 16 7月, 2019 1 次提交
-
-
由 gaaclarke 提交于
Made Picture::toImage happen on the IO thread with no need for a surface.
-
- 10 7月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
This patch reworks image decompression and collection in the following ways because of misbehavior in the described edge cases. The current flow for realizing a texture on the GPU from a blob of compressed bytes is to first pass it to the IO thread for image decompression and then upload to the GPU. The handle to the texture on the GPU is then passed back to the UI thread so that it can be included in subsequent layer trees for rendering. The GPU contexts on the Render & IO threads are in the same sharegroup so the texture ends up being visible to the Render Thread context during rendering. This works fine and does not block the UI thread. All references to the image are owned on UI thread by Dart objects. When the final reference to the image is dropped, the texture cannot be collected on the UI thread (because it has not GPU context). Instead, it must be passed to either the GPU or IO threads. The GPU thread is usually in the middle of a frame workload so we redirect the same to the IO thread for eventual collection. While texture collections are usually (comparatively) fast, texture decompression and upload are slow (order of magnitude of frame intervals). For application that end up creating (by not necessarily using) numerous large textures in straight-line execution, it could be the case that texture collection tasks are pending on the IO task runner after all the image decompressions (and upload) are done. Put simply, the collection of the first image could be waiting for the decompression and upload of the last image in the queue. This is exacerbated by two other hacks added to workaround unrelated issues. * First, creating a codec with a single image frame immediately kicks of decompression and upload of that frame image (even if the frame was never request from the codec). This hack was added because we wanted to get rid of the compressed image allocation ASAP. The expectation was codecs would only be created with the sole purpose of getting the decompressed image bytes. However, for applications that only create codecs to get image sizes (but never actually decompress the same), we would end up replacing the compressed image allocation with a larger allocation (device resident no less) for no obvious use. This issue is particularly insidious when you consider that the codec is usually asked for the native image size first before the frame is requested at a smaller size (usually using a new codec with same data but new targetsize). This would cause the creation of a whole extra texture (at 1:1) when the caller was trying to “optimize” for memory use by requesting a texture of a smaller size. * Second, all image collections we delayed in by the unref queue by 250ms because of observations that the calling thread (the UI thread) was being descheduled unnecessarily when a task with a timeout of zero was posted from the same (recall that a task has to be posted to the IO thread for the collection of that texture). 250ms is multiple frame intervals worth of potentially unnecessary textures. The net result of these issues is that we may end up creating textures when all that the application needs is to ask it’s codec for details about the same (but not necessarily access its bytes). Texture collection could also be delayed behind other jobs to decompress the textures on the IO thread. Also, all texture collections are delayed for an arbitrary amount of time. These issues cause applications to be susceptible to OOM situations. These situations manifest in various ways. Host memory exhaustion causes the usual OOM issues. Device memory exhaustion seems to manifest in different ways on iOS and Android. On Android, allocation of a new texture seems to be causing an assertion (in the driver). On iOS, the call hangs (presumably waiting for another thread to release textures which we won’t do because those tasks are blocked behind the current task completing). To address peak memory usage, the following changes have been made: * Image decompression and upload/collection no longer happen on the same thread. All image decompression will now be handled on a workqueue. The number of worker threads in this workqueue is equal to the number of processors on the device. These threads have a lower priority that either the UI or Render threads. These workers are shared between all Flutter applications in the process. * Both the images and their codec now report the correct allocation size to Dart for GC purposes. The Dart VM uses this to pick objects for collection. Earlier the image allocation was assumed to 32bpp with no mipmapping overhead reported. Now, the correct image size is reported and the mipmapping overhead is accounted for. Image codec sizes were not reported to the VM earlier and now are. Expect “External” VM allocations to be higher than previously reported and the numbers in Observatory to line up more closely with actual memory usage (device and host). * Decoding images to a specific size used to decode to 1:1 before performing a resize to the correct dimensions before texture upload. This has now been reworked so that images are first decompressed to a smaller size supported natively by the codec before final resizing to the requested target size. The intermediate copy is now smaller and more promptly collected. Resizing also happens on the workqueue worker. * The drain interval of the unref queue is now sub-frame-interval. I am hesitant to remove the delay entirely because I have not been able to instrument the performance overhead of the same. That is next on my list. But now, multiple frame intervals worth of textures no longer stick around. The following issues have been addressed: * https://github.com/flutter/flutter/issues/34070 Since this was the first usage of the concurrent message loops, the number of idle wakes were determined to be too high and this component has been rewritten to be simpler and not use the existing task runner and MessageLoopImpl interface. * Image decoding had no tests. The new `ui_unittests` harness has been added that sets up a GPU test harness on the host using SwiftShader. Tests have been added for image decompression, upload and resizing. * The device memory exhaustion in this benchmark has been addressed. That benchmark is still not viable for inclusion in any harness however because it creates 9 million codecs in straight-line execution. Because these codecs are destroyed in the microtask callbacks, these are referenced till those callbacks are executed. So now, instead of device memory exhaustion, this will lead to (slower) exhaustion of host memory. This is expected and working as intended. This patch only addresses peak memory use and makes collection of unused images and textures more prompt. It does NOT address memory use by images referenced strongly by the application or framework.
-
- 25 4月, 2019 1 次提交
-
-
由 Zachary Anderson 提交于
-
- 21 4月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
-
- 20 4月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
The callbacks can be wired in via the Settings object. Both runtime and shell unit-tests have been patched to test this.
-
- 18 4月, 2019 2 次提交
-
-
由 Chinmay Garde 提交于
-
由 Chinmay Garde 提交于
The failing tests were depending on the old assumption that the VM would never shutdown.
-
- 10 4月, 2019 2 次提交
-
-
由 Chinmay Garde 提交于
-
由 Chinmay Garde 提交于
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.
-
- 09 4月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
-
- 04 4月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
Revert "Revert "Separate the data required to bootstrap the VM into its own class. (#8397)" (#8406)" (#8414) This reverts commit f7b4903d.
-
- 03 4月, 2019 1 次提交
-
-
由 Zachary Anderson 提交于
This reverts commit c9916474.
-
- 02 4月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
When attempting to shutdown and subsequently restart the VM, having the VM own this data introduces lifecycle issues due to circular references.
-
- 30 3月, 2019 2 次提交
-
-
由 Chinmay Garde 提交于
-
由 Chinmay Garde 提交于
Previously, only the most basic tests were run in AOT mode.
-
- 21 2月, 2019 1 次提交
-
-
由 Dan Field 提交于
* Test profile build and unit tests * update googletest, skip JIT tests on non-debug builds
-
- 20 2月, 2019 1 次提交
-
- 16 2月, 2019 1 次提交
-
-
由 Chinmay Garde 提交于
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.
-
- 16 1月, 2019 2 次提交
-
-
由 Chinmay Garde 提交于
-
由 Chinmay Garde 提交于
-
- 15 1月, 2019 1 次提交
-
-
由 Dan Field 提交于
* Make IOManager own resource context
-
- 08 11月, 2018 1 次提交
-
-
由 Michael Goderbauer 提交于
-
- 23 10月, 2018 1 次提交
-
-
由 Chinmay Garde 提交于
TL;DR: Offscreen surface is created on the render thread and device to host transfer performed there before task completion on the UI thread. While attempting to snapshot layer trees, the engine was attempting to use the IO thread context. The reasoning was that this would be safe to do because any textures uploaded to the GPU as a result of async texture upload would have originated from this context and hence the handles would be valid in either context. As it turns out, while the handles are valid, Skia does not support this use-case because cross-context images transfer ownership of the image from one context to another. So, when we made the hop from the UI thread to the IO thread (for snapshotting), if either the UI or GPU threads released the last reference to the texture backed image, the image would be invalid. This led to such images being absent from the layer tree snapshot. Simply referencing the images as they are being used on the IO thread is not sufficient because accessing images on one context after their ownership has already been transferred to another is not safe behavior (from Skia's perspective, the handles are still valid in the sharegroup). To work around these issues, it was decided that an offscreen render target would be created on the render thread. The color attachment of this render target could then be transferred as a cross context image to the IO thread for the device to host tranfer. Again, this is currently not quite possible because the only way to create cross context images is from encoded data. Till Skia exposes the functionality to create cross-context images from textures in one context, we do a device to host transfer on the GPU thread. The side effect of this is that this is now part of the frame workload (image compression, which dominate the wall time, is still done of the IO thread). A minor side effect of this patch is that the GPU latch needs to be waited on before the UI thread tasks can be completed before shell initialization.
-
- 18 10月, 2018 1 次提交
-
-
由 Chinmay Garde 提交于
-
- 15 9月, 2018 1 次提交
-
-
由 Ryan Macnak 提交于
Following fixes in dart-lang/sdk@91cbb57cd5cd012d5aa66bfb6eb3a1306271f431
-
- 12 9月, 2018 1 次提交
-
-
由 Michael Goderbauer 提交于
This reverts commit e3133e0e.
-
- 11 9月, 2018 1 次提交
-
-
由 Ryan Macnak 提交于
- Add missing Dart 2 flags to gen_snapshot invocation. - Disable brittle service test.
-
- 08 9月, 2018 2 次提交
-
-
由 Ryan Macnak 提交于
This reverts commit 4c2448d1.
-
由 Ryan Macnak 提交于
- Switch core snapshot to Dart 2 and remove support for loading platform.dill. - Remove support for loading script snapshots. - Remove support for loading source. - Remove settings and fix names to reflect the above. - Remove support for loading the service isolate from source.
-
- 27 7月, 2018 1 次提交
-
-
由 Chinmay Garde 提交于
-