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
This commit is contained in:
Chinmay Garde 2020-03-10 12:28:24 -07:00 committed by GitHub
parent 498a34aff7
commit bcefcdb880
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 24 deletions

View File

@ -175,10 +175,7 @@ if (current_toolchain == host_toolchain) {
":ui",
":ui_unittests_fixtures",
"//flutter/common",
"//flutter/fml",
"//flutter/lib/snapshot",
"//flutter/runtime",
"//flutter/shell/common",
"//flutter/testing",
"//flutter/testing:dart",
"//flutter/testing:opengl",
"//flutter/third_party/tonic",

View File

@ -150,6 +150,7 @@ source_set("runtime_unittests_common") {
"//flutter/fml",
"//flutter/lib/snapshot",
"//flutter/shell/common",
"//flutter/testing",
"//flutter/testing:dart",
"//flutter/third_party/tonic",
"//third_party/dart/runtime/bin:elf_loader",

View File

@ -209,6 +209,7 @@ if (enable_unittests) {
"//flutter/fml/dart",
"//flutter/lib/ui:ui",
"//flutter/shell",
"//flutter/testing",
"//flutter/testing:dart",
]
@ -278,6 +279,7 @@ if (enable_unittests) {
deps = [
":shell_unittests_fixtures",
"//flutter/benchmarking",
"//flutter/testing:dart",
"//flutter/testing:testing_lib",
]
}

View File

@ -7,6 +7,7 @@
#include "flutter/runtime/dart_vm.h"
#include "flutter/shell/common/shell.h"
#include "flutter/shell/common/thread_host.h"
#include "flutter/testing/elf_loader.h"
#include "flutter/testing/testing.h"
namespace flutter {
@ -18,6 +19,8 @@ static void StartupAndShutdownShell(benchmark::State& state,
fml::FilePermission::kRead);
std::unique_ptr<Shell> shell;
std::unique_ptr<ThreadHost> thread_host;
testing::ELFAOTSymbols aot_symbols;
{
benchmarking::ScopedPauseTiming pause(state, !measure_startup);
Settings settings = {};
@ -25,25 +28,10 @@ static void StartupAndShutdownShell(benchmark::State& state,
settings.task_observer_remove = [](intptr_t) {};
if (DartVM::IsRunningPrecompiledCode()) {
settings.vm_snapshot_data = [&]() {
return fml::FileMapping::CreateReadOnly(assets_dir, "vm_snapshot_data");
};
settings.isolate_snapshot_data = [&]() {
return fml::FileMapping::CreateReadOnly(assets_dir,
"isolate_snapshot_data");
};
settings.vm_snapshot_instr = [&]() {
return fml::FileMapping::CreateReadExecute(assets_dir,
"vm_snapshot_instr");
};
settings.isolate_snapshot_instr = [&]() {
return fml::FileMapping::CreateReadExecute(assets_dir,
"isolate_snapshot_instr");
};
aot_symbols = testing::LoadELFSymbolFromFixturesIfNeccessary();
FML_CHECK(
testing::PrepareSettingsForAOTWithSymbols(settings, aot_symbols))
<< "Could not setup settings with AOT symbols.";
} else {
settings.application_kernels = [&]() {
std::vector<std::unique_ptr<const fml::Mapping>> kernel_mappings;

View File

@ -137,6 +137,7 @@ if (current_toolchain == host_toolchain) {
"//flutter/flow",
"//flutter/lib/ui",
"//flutter/runtime",
"//flutter/testing",
"//flutter/testing:dart",
"//flutter/testing:opengl",
"//flutter/testing:skia",

View File

@ -52,7 +52,7 @@ source_set("dart") {
]
public_deps = [
":testing",
":testing_lib",
"//flutter/common",
"//flutter/runtime",
"//flutter/runtime:libdart",