[fuchsia] core-jit (flutter/engine#3753)
This commit is contained in:
@@ -31,6 +31,8 @@ def main():
|
||||
help='Where to output dependency information')
|
||||
parser.add_argument('--root-build-dir', type=str, required=True,
|
||||
help='The root build dir for --depfile and --snapshot')
|
||||
parser.add_argument('--checked', default=False, action='store_true',
|
||||
help='Enable checked mode')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -48,6 +50,11 @@ def main():
|
||||
cmd.append("--url_mapping=" + url_mapping)
|
||||
for entry_points_manifest in args.entry_points_manifest:
|
||||
cmd.append("--embedder_entry_points_manifest=" + entry_points_manifest)
|
||||
if args.checked:
|
||||
cmd.append('--enable_asserts')
|
||||
cmd.append('--enable_type_checks')
|
||||
cmd.append('--error_on_bad_type')
|
||||
cmd.append('--error_on_bad_override')
|
||||
cmd.append(args.main_dart)
|
||||
|
||||
result = subprocess.call(cmd, cwd=args.root_build_dir)
|
||||
|
||||
@@ -135,6 +135,9 @@ template("flutter_app") {
|
||||
"--root-build-dir",
|
||||
rebase_path(root_build_dir),
|
||||
]
|
||||
if (is_debug) {
|
||||
args += [ "--checked" ]
|
||||
}
|
||||
|
||||
deps = [
|
||||
":$dart_package_name",
|
||||
@@ -286,6 +289,9 @@ template("flutter_aot_app") {
|
||||
"--root-build-dir",
|
||||
rebase_path(root_build_dir),
|
||||
]
|
||||
if (is_debug) {
|
||||
args += [ "--checked" ]
|
||||
}
|
||||
|
||||
deps = [
|
||||
":$dart_package_name",
|
||||
|
||||
@@ -32,11 +32,16 @@ def main():
|
||||
help='Where to output dependency information')
|
||||
parser.add_argument('--root-build-dir', type=str, required=True,
|
||||
help='The root build dir for --depfile and --snapshot')
|
||||
parser.add_argument('--checked', default=False, action='store_true',
|
||||
help='Enable checked mode')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
cmd = [
|
||||
args.snapshotter_path,
|
||||
'--enable_mirrors=false',
|
||||
'--await_is_keyword',
|
||||
'--assert_initializer',
|
||||
'--snapshot_kind=script',
|
||||
'--vm_snapshot_data=%s' % args.vm_snapshot_data,
|
||||
'--vm_snapshot_instructions=%s' % args.vm_snapshot_instructions,
|
||||
@@ -45,8 +50,13 @@ def main():
|
||||
'--packages=%s' % args.packages,
|
||||
'--script_snapshot=%s' % args.snapshot,
|
||||
'--dependencies=%s' % args.depfile,
|
||||
args.main_dart
|
||||
]
|
||||
if args.checked:
|
||||
cmd.append('--enable_asserts')
|
||||
cmd.append('--enable_type_checks')
|
||||
cmd.append('--error_on_bad_type')
|
||||
cmd.append('--error_on_bad_override')
|
||||
cmd.append(args.main_dart)
|
||||
|
||||
result = subprocess.call(cmd, cwd=args.root_build_dir)
|
||||
if result != 0:
|
||||
|
||||
@@ -22,11 +22,55 @@ copy("generate_dart_ui") {
|
||||
]
|
||||
}
|
||||
|
||||
if (target_is_fuchsia) {
|
||||
action("generate_package_map") {
|
||||
dart_deps = [
|
||||
"//lib/fidl/dart:dart",
|
||||
"//lib/flutter/packages/flutter:flutter",
|
||||
"//lib/widgets/packages/widgets:lib.widgets",
|
||||
"//application/lib/app/dart:dart",
|
||||
]
|
||||
|
||||
dot_packages_file = "$target_gen_dir/snapshot.packages"
|
||||
outputs = [
|
||||
dot_packages_file
|
||||
]
|
||||
deps = dart_deps
|
||||
depfile = "$dot_packages_file.d"
|
||||
|
||||
script = "//build/dart/gen_dot_packages.py"
|
||||
args = [
|
||||
"--out",
|
||||
rebase_path(dot_packages_file, root_build_dir),
|
||||
"--source-dir",
|
||||
rebase_path("."),
|
||||
"--root-build-dir",
|
||||
rebase_path(root_build_dir),
|
||||
"--root-gen-dir",
|
||||
rebase_path(root_gen_dir),
|
||||
"--package-name",
|
||||
"snapshot_root",
|
||||
"--depfile",
|
||||
rebase_path(depfile),
|
||||
"--deps",
|
||||
] + dart_deps
|
||||
}
|
||||
}
|
||||
|
||||
action("generate_snapshot_bin") {
|
||||
if (target_is_fuchsia) {
|
||||
snapshot_dart = "snapshot_fuchsia.dart"
|
||||
# TODO(rmacnak): Fuchsia cross builds use the wrong Dart target
|
||||
# architecture, and have added steps that depend on this error for
|
||||
# reasonable build times (e.g., invoking the analyzer).
|
||||
if (target_cpu == host_cpu) {
|
||||
snapshot_kind = "core-jit"
|
||||
} else {
|
||||
snapshot_kind = "core"
|
||||
}
|
||||
} else {
|
||||
snapshot_dart = "snapshot.dart"
|
||||
snapshot_kind = "core"
|
||||
}
|
||||
|
||||
deps = [
|
||||
@@ -37,6 +81,10 @@ action("generate_snapshot_bin") {
|
||||
"//dart/runtime/tools/create_snapshot_bin.py",
|
||||
snapshot_dart,
|
||||
] + dart_ui_files
|
||||
if (target_is_fuchsia) {
|
||||
deps += [ ":generate_package_map" ]
|
||||
inputs += [ "fuchsia_compilation_trace.txt" ]
|
||||
}
|
||||
|
||||
vm_snapshot_data = "$target_gen_dir/vm_isolate_snapshot.bin"
|
||||
vm_snapshot_instructions = "$target_gen_dir/vm_snapshot_instructions.bin"
|
||||
@@ -60,12 +108,16 @@ action("generate_snapshot_bin") {
|
||||
args = [
|
||||
"--executable",
|
||||
rebase_path("$gen_snapshot_dir/gen_snapshot"),
|
||||
"--package_root",
|
||||
rebase_path("$root_gen_dir"),
|
||||
"--script",
|
||||
rebase_path(snapshot_dart),
|
||||
"--snapshot_kind",
|
||||
"core",
|
||||
snapshot_kind,
|
||||
"--vm_flag",
|
||||
"--await_is_keyword",
|
||||
"--vm_flag",
|
||||
"--assert_initializer",
|
||||
"--vm_flag",
|
||||
"--enable_mirrors=false",
|
||||
"--vm_output_bin",
|
||||
rebase_path(vm_snapshot_data, root_build_dir),
|
||||
"--vm_instructions_output_bin",
|
||||
@@ -77,6 +129,19 @@ action("generate_snapshot_bin") {
|
||||
"--url_mapping=dart:ui,$rebased_dart_ui_path",
|
||||
]
|
||||
|
||||
if (is_debug) {
|
||||
args += [
|
||||
"--vm_flag",
|
||||
"--enable_asserts",
|
||||
"--vm_flag",
|
||||
"--enable_type_checks",
|
||||
"--vm_flag",
|
||||
"--error_on_bad_type",
|
||||
"--vm_flag",
|
||||
"--error_on_bad_override",
|
||||
]
|
||||
}
|
||||
|
||||
if (target_is_fuchsia) {
|
||||
inputs += fidl_dart_sdk_ext_files + mozart_dart_sdk_ext_files
|
||||
fidl_internal_path = rebase_path(fidl_dart_sdk_ext_lib)
|
||||
@@ -84,6 +149,10 @@ action("generate_snapshot_bin") {
|
||||
args += [
|
||||
"--url_mapping=dart:fidl.internal,$fidl_internal_path",
|
||||
"--url_mapping=dart:mozart.internal,$mozart_internal_path",
|
||||
"--packages",
|
||||
rebase_path("$target_gen_dir/snapshot.packages"),
|
||||
"--load_compilation_trace",
|
||||
rebase_path("fuchsia_compilation_trace.txt"),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
4601
engine/src/flutter/lib/snapshot/fuchsia_compilation_trace.txt
Normal file
4601
engine/src/flutter/lib/snapshot/fuchsia_compilation_trace.txt
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// These libraries are required. Only the core snapshot knows how to resolve
|
||||
// them.
|
||||
import 'dart:async';
|
||||
import 'dart:collection';
|
||||
import 'dart:convert';
|
||||
@@ -14,3 +16,22 @@ import 'dart:math';
|
||||
import 'dart:mozart.internal';
|
||||
import 'dart:typed_data';
|
||||
import 'dart:ui';
|
||||
|
||||
// These libraries are optional. They are included in the core snapshot and
|
||||
// partially compiled to avoid repeating them in each application and improve
|
||||
// startup time.
|
||||
import 'package:application.lib.app.dart/app.dart';
|
||||
import 'package:flutter/animation.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/painting.dart';
|
||||
import 'package:flutter/physics.dart';
|
||||
import 'package:flutter/rendering.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:lib.fidl.dart/bindings.dart';
|
||||
import 'package:lib.fidl.dart/core.dart';
|
||||
import 'package:lib.widgets/model.dart';
|
||||
import 'package:lib.widgets/modular.dart';
|
||||
import 'package:lib.widgets/widgets.dart';
|
||||
|
||||
Reference in New Issue
Block a user