Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
3f8eddf3
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3f8eddf3
编写于
6月 07, 2017
作者:
R
Ryan Macnak
提交者:
GitHub
6月 07, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Plumbing for a core snapshot with code (currently empty). (#3749)
上级
72e8a763
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
115 addition
and
65 deletion
+115
-65
build/flutter_app.gni
build/flutter_app.gni
+12
-0
build/script_snapshot.py
build/script_snapshot.py
+7
-1
lib/snapshot/BUILD.gn
lib/snapshot/BUILD.gn
+92
-30
lib/snapshot/snapshot.c.tmpl
lib/snapshot/snapshot.c.tmpl
+0
-29
lib/snapshot/snapshot.h
lib/snapshot/snapshot.h
+4
-4
travis/licenses_golden/licenses_flutter
travis/licenses_golden/licenses_flutter
+0
-1
未找到文件。
build/flutter_app.gni
浏览文件 @
3f8eddf3
...
...
@@ -75,8 +75,12 @@ template("flutter_app") {
get_label_info(flutter_core_snapshot_label, "target_gen_dir")
flutter_core_snapshot_vm_data =
"$flutter_core_snapshot_gen_dir/vm_isolate_snapshot.bin"
flutter_core_snapshot_vm_instructions =
"$flutter_core_snapshot_gen_dir/vm_snapshot_instructions.bin"
flutter_core_snapshot_isolate_data =
"$flutter_core_snapshot_gen_dir/isolate_snapshot.bin"
flutter_core_snapshot_isolate_instructions =
"$flutter_core_snapshot_gen_dir/isolate_snapshot_instructions.bin"
dot_packages = "$target_gen_dir/$dart_package_name.packages"
bundle_path = "$target_gen_dir/$bundle_name"
...
...
@@ -93,6 +97,10 @@ template("flutter_app") {
inputs = [
main_dart,
flutter_core_snapshot_vm_data,
flutter_core_snapshot_vm_instructions,
flutter_core_snapshot_isolate_data,
flutter_core_snapshot_isolate_instructions,
]
outputs = [
...
...
@@ -110,8 +118,12 @@ template("flutter_app") {
rebase_path(gen_snapshot),
"--vm-snapshot-data",
rebase_path(flutter_core_snapshot_vm_data),
"--vm-snapshot-instructions",
rebase_path(flutter_core_snapshot_vm_instructions),
"--isolate-snapshot-data",
rebase_path(flutter_core_snapshot_isolate_data),
"--isolate-snapshot-instructions",
rebase_path(flutter_core_snapshot_isolate_instructions),
"--main-dart",
rebase_path(main_dart),
"--packages",
...
...
build/script_snapshot.py
浏览文件 @
3f8eddf3
...
...
@@ -16,8 +16,12 @@ def main():
help
=
'The Flutter snapshotter'
)
parser
.
add_argument
(
'--vm-snapshot-data'
,
type
=
str
,
required
=
True
,
help
=
'Path to vm_isolate_snapshot.bin'
)
parser
.
add_argument
(
'--vm-snapshot-instructions'
,
type
=
str
,
required
=
True
,
help
=
'Path to vm_isolate_snapshot.bin'
)
parser
.
add_argument
(
'--isolate-snapshot-data'
,
type
=
str
,
required
=
True
,
help
=
'Path to isolate_snapshot.bin'
)
parser
.
add_argument
(
'--isolate-snapshot-instructions'
,
type
=
str
,
required
=
True
,
help
=
'Path to isolate_snapshot.bin'
)
parser
.
add_argument
(
'--main-dart'
,
type
=
str
,
required
=
True
,
help
=
'The main.dart file to use'
)
parser
.
add_argument
(
'--packages'
,
type
=
str
,
required
=
True
,
...
...
@@ -35,11 +39,13 @@ def main():
args
.
snapshotter_path
,
'--snapshot_kind=script'
,
'--vm_snapshot_data=%s'
%
args
.
vm_snapshot_data
,
'--vm_snapshot_instructions=%s'
%
args
.
vm_snapshot_instructions
,
'--isolate_snapshot_data=%s'
%
args
.
isolate_snapshot_data
,
'--isolate_snapshot_instructions=%s'
%
args
.
isolate_snapshot_instructions
,
'--packages=%s'
%
args
.
packages
,
'--script_snapshot=%s'
%
args
.
snapshot
,
'--dependencies=%s'
%
args
.
depfile
,
args
.
main_dart
,
args
.
main_dart
]
result
=
subprocess
.
call
(
cmd
,
cwd
=
args
.
root_build_dir
)
...
...
lib/snapshot/BUILD.gn
浏览文件 @
3f8eddf3
...
...
@@ -38,11 +38,16 @@ action("generate_snapshot_bin") {
snapshot_dart,
] + dart_ui_files
vm_isolate_snapshot = "$target_gen_dir/vm_isolate_snapshot.bin"
isolate_snapshot = "$target_gen_dir/isolate_snapshot.bin"
vm_snapshot_data = "$target_gen_dir/vm_isolate_snapshot.bin"
vm_snapshot_instructions = "$target_gen_dir/vm_snapshot_instructions.bin"
isolate_snapshot_data = "$target_gen_dir/isolate_snapshot.bin"
isolate_snapshot_instructions =
"$target_gen_dir/isolate_snapshot_instructions.bin"
outputs = [
vm_isolate_snapshot,
isolate_snapshot,
vm_snapshot_data,
vm_snapshot_instructions,
isolate_snapshot_data,
isolate_snapshot_instructions,
]
rebased_dart_ui_path = rebase_path(dart_ui_path)
...
...
@@ -62,9 +67,13 @@ action("generate_snapshot_bin") {
"--snapshot_kind",
"core",
"--vm_output_bin",
rebase_path(vm_isolate_snapshot, root_build_dir),
rebase_path(vm_snapshot_data, root_build_dir),
"--vm_instructions_output_bin",
rebase_path(vm_snapshot_instructions, root_build_dir),
"--isolate_output_bin",
rebase_path(isolate_snapshot, root_build_dir),
rebase_path(isolate_snapshot_data, root_build_dir),
"--isolate_instructions_output_bin",
rebase_path(isolate_snapshot_instructions, root_build_dir),
"--url_mapping=dart:ui,$rebased_dart_ui_path",
]
...
...
@@ -79,40 +88,93 @@ action("generate_snapshot_bin") {
}
}
action("generate_snapshot_file") {
# Generates an assembly file defining a given symbol with the bytes from a
# binary file. Places the symbol in a text section if 'executable' is true,
# otherwise places the symbol in a read-only data section.
template("bin_to_assembly") {
assert(defined(invoker.deps), "Must define deps")
assert(defined(invoker.input), "Must define input binary file")
assert(defined(invoker.output), "Must define output assembly file")
assert(defined(invoker.symbol), "Must define symbol name")
assert(defined(invoker.executable), "Must define boolean executable")
action(target_name) {
deps = invoker.deps
script = "//dart/runtime/tools/bin_to_assembly.py"
args = [
"--input",
rebase_path(invoker.input),
"--output",
rebase_path(invoker.output),
"--symbol_name",
invoker.symbol,
"--target_os",
current_os,
]
if (invoker.executable) {
args += [ "--executable" ]
}
inputs = [
script,
invoker.input,
]
outputs = [
invoker.output,
]
}
}
bin_to_assembly("vm_snapshot_data_assembly") {
deps = [
":generate_snapshot_bin",
]
input
s = [
"//dart/runtime/tools/create_snapshot_file.py",
"snapshot.c.tmpl",
"$target_gen_dir/vm_isolate_snapshot.bin",
"$target_gen_dir/isolate_snapshot.bin",
]
output = "$target_gen_dir/snapshot.c"
output
s = [
output
,
input
= "$target_gen_dir/vm_isolate_snapshot.bin"
output = "$target_gen_dir/vm_snapshot_data.S"
symbol = "kDartVmSnapshotData"
executable = false
}
bin_to_assembly("vm_snapshot_instructions_assembly") {
dep
s = [
":generate_snapshot_bin"
,
]
input = "$target_gen_dir/vm_snapshot_instructions.bin"
output = "$target_gen_dir/vm_snapshot_instructions.S"
symbol = "kDartVmSnapshotInstructions"
executable = true
}
script = "//dart/runtime/tools/create_snapshot_file.py"
args = [
"--vm_input_bin",
rebase_path("$target_gen_dir/vm_isolate_snapshot.bin"),
"--input_bin",
rebase_path("$target_gen_dir/isolate_snapshot.bin"),
"--input_cc",
rebase_path("snapshot.c.tmpl"),
"--output",
rebase_path(output),
bin_to_assembly("isolate_snapshot_data_assembly") {
deps = [
":generate_snapshot_bin",
]
input = "$target_gen_dir/isolate_snapshot.bin"
output = "$target_gen_dir/isolate_snapshot_data.S"
symbol = "kDartIsolateCoreSnapshotData"
executable = false
}
source_set("snapshot
") {
source
s = [
"
$target_gen_dir/snapshot.c
",
bin_to_assembly("isolate_snapshot_instructions_assembly
") {
dep
s = [
"
:generate_snapshot_bin
",
]
input = "$target_gen_dir/isolate_snapshot_instructions.bin"
output = "$target_gen_dir/isolate_snapshot_instructions.S"
symbol = "kDartIsolateCoreSnapshotInstructions"
executable = true
}
source_set("snapshot") {
deps = [
":generate_snapshot_file",
":isolate_snapshot_data_assembly",
":isolate_snapshot_instructions_assembly",
":vm_snapshot_data_assembly",
":vm_snapshot_instructions_assembly",
]
sources = [
"$target_gen_dir/isolate_snapshot_data.S",
"$target_gen_dir/isolate_snapshot_instructions.S",
"$target_gen_dir/vm_snapshot_data.S",
"$target_gen_dir/vm_snapshot_instructions.S",
]
}
lib/snapshot/snapshot.c.tmpl
已删除
100644 → 0
浏览文件 @
72e8a763
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <inttypes.h>
#include <stdint.h>
#include <stddef.h>
// The string on the next line will be filled in with the contents of the
// generated snapshot binary file for the vm isolate.
// This string forms the content of the dart vm isolate snapshot which
// is loaded into the vm isolate.
const uint8_t kDartVmSnapshotData_[]
__attribute__((aligned(8))) = { %s };
const uint8_t* kDartVmSnapshotData
__attribute__((visibility("default"), used)) = kDartVmSnapshotData_;
const uint8_t* kDartVmSnapshotInstructions
__attribute__((visibility("default"), used)) = NULL;
// The string on the next line will be filled in with the contents of the
// generated snapshot binary file for a regular dart isolate.
// This string forms the content of a regular dart isolate snapshot which
// is loaded into an isolate when it is created.
const uint8_t kDartIsolateCoreSnapshotData_[]
__attribute__((aligned(8))) = { %s };
const uint8_t* kDartIsolateCoreSnapshotData
__attribute__((visibility("default"), used)) = kDartIsolateCoreSnapshotData_;
const uint8_t* kDartIsolateCoreSnapshotInstructions
__attribute__((visibility("default"), used)) = NULL;
lib/snapshot/snapshot.h
浏览文件 @
3f8eddf3
...
...
@@ -7,8 +7,8 @@
#include <stdint.h>
extern
"C"
{
extern
const
uint8_t
*
kDartVmSnapshotData
;
extern
const
uint8_t
*
kDartVmSnapshotInstructions
;
extern
const
uint8_t
*
kDartIsolateCoreSnapshotData
;
extern
const
uint8_t
*
kDartIsolateCoreSnapshotInstructions
;
extern
const
uint8_t
kDartVmSnapshotData
[]
;
extern
const
uint8_t
kDartVmSnapshotInstructions
[]
;
extern
const
uint8_t
kDartIsolateCoreSnapshotData
[]
;
extern
const
uint8_t
kDartIsolateCoreSnapshotInstructions
[]
;
}
travis/licenses_golden/licenses_flutter
浏览文件 @
3f8eddf3
...
...
@@ -1528,7 +1528,6 @@ FILE: ../../../flutter/flow/layers/picture_layer.cc
FILE: ../../../flutter/flow/layers/picture_layer.h
FILE: ../../../flutter/flow/layers/transform_layer.cc
FILE: ../../../flutter/flow/layers/transform_layer.h
FILE: ../../../flutter/lib/snapshot/snapshot.c.tmpl
FILE: ../../../flutter/lib/snapshot/snapshot.dart
FILE: ../../../flutter/lib/snapshot/snapshot.h
FILE: ../../../flutter/lib/snapshot/snapshot_fuchsia.dart
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录