Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
d52d3a44
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,发现更多精彩内容 >>
提交
d52d3a44
编写于
5月 06, 2016
作者:
C
Chinmay Garde
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Wire up the interpreter on iOS devices. (#2648)
上级
c0a5c08c
变更
20
显示空白变更内容
内联
并排
Showing
20 changed file
with
240 addition
and
137 deletion
+240
-137
DEPS
DEPS
+1
-1
sky/build/PackagerInvoke
sky/build/PackagerInvoke
+1
-1
sky/build/SnapshotterInvoke
sky/build/SnapshotterInvoke
+40
-12
sky/build/sdk_xcode_harness/Flutter.xcconfig
sky/build/sdk_xcode_harness/Flutter.xcconfig
+4
-0
sky/build/sdk_xcode_harness/FlutterApplication.xcodeproj/project.pbxproj
...code_harness/FlutterApplication.xcodeproj/project.pbxproj
+4
-5
sky/build/sdk_xcode_harness/FlutterApplication.xcodeproj/xcshareddata/xcschemes/Application.xcscheme
...ion.xcodeproj/xcshareddata/xcschemes/Application.xcscheme
+0
-12
sky/build/sdk_xcode_harness/FlutterApplication/InstructionsSnapshotSource.S
...e_harness/FlutterApplication/InstructionsSnapshotSource.S
+4
-1
sky/build/sdk_xcode_harness/FlutterApplication/kDartIsolateSnapshotBufferSource.c
...ess/FlutterApplication/kDartIsolateSnapshotBufferSource.c
+1
-1
sky/build/sdk_xcode_harness/FlutterApplication/kDartVmIsolateSnapshotBufferSource.c
...s/FlutterApplication/kDartVmIsolateSnapshotBufferSource.c
+1
-1
sky/build/sdk_xcode_harness/Interpreter.xcconfig
sky/build/sdk_xcode_harness/Interpreter.xcconfig
+5
-0
sky/build/sky_precompilation_sdk.gni
sky/build/sky_precompilation_sdk.gni
+9
-31
sky/engine/core/script/dart_init.cc
sky/engine/core/script/dart_init.cc
+26
-22
sky/shell/platform/ios/framework/Headers/FlutterDartProject.h
...shell/platform/ios/framework/Headers/FlutterDartProject.h
+3
-0
sky/shell/platform/ios/framework/Source/FlutterAppDelegate.mm
...shell/platform/ios/framework/Source/FlutterAppDelegate.mm
+17
-11
sky/shell/platform/ios/framework/Source/FlutterDartProject.mm
...shell/platform/ios/framework/Source/FlutterDartProject.mm
+61
-24
sky/shell/platform/ios/framework/Source/FlutterDartSource.h
sky/shell/platform/ios/framework/Source/FlutterDartSource.h
+4
-0
sky/shell/platform/ios/framework/Source/FlutterDartSource.mm
sky/shell/platform/ios/framework/Source/FlutterDartSource.mm
+40
-7
sky/shell/platform/ios/framework/Source/FlutterViewController.mm
...ll/platform/ios/framework/Source/FlutterViewController.mm
+6
-8
sky/tools/gn
sky/tools/gn
+8
-0
sky/tools/sky_snapshot/vm.cc
sky/tools/sky_snapshot/vm.cc
+5
-0
未找到文件。
DEPS
浏览文件 @
d52d3a44
...
@@ -25,7 +25,7 @@ vars = {
...
@@ -25,7 +25,7 @@ vars = {
# Note: When updating the Dart revision, ensure that all entries that are
# Note: When updating the Dart revision, ensure that all entries that are
# dependencies of dart are also updated
# dependencies of dart are also updated
'dart_revision': '
14ec00f86bbc893f1c731ea36afb1b98d8cd77cc
',
'dart_revision': '
e4db01fdd43f019988a901eb51c72790652760a4
',
'dart_boringssl_revision': 'daeafc22c66ad48f6b32fc8d3362eb9ba31b774e',
'dart_boringssl_revision': 'daeafc22c66ad48f6b32fc8d3362eb9ba31b774e',
'dart_observatory_packages_revision': 'cf90eb9077177d3d6b3fd5e8289477c2385c026a',
'dart_observatory_packages_revision': 'cf90eb9077177d3d6b3fd5e8289477c2385c026a',
'dart_root_certificates_revision': 'aed07942ce98507d2be28cbd29e879525410c7fc',
'dart_root_certificates_revision': 'aed07942ce98507d2be28cbd29e879525410c7fc',
...
...
sky/build/PackagerInvoke
浏览文件 @
d52d3a44
...
@@ -51,7 +51,7 @@ PackageProject() {
...
@@ -51,7 +51,7 @@ PackageProject() {
AssertExists
$src_dir
AssertExists
$src_dir
local
precompilation_flag
=
""
local
precompilation_flag
=
""
if
[
$CURRENT_ARCH
!=
"x86_64"
]
;
then
if
[
[
$CURRENT_ARCH
!=
"x86_64"
]]
&&
[[
"
$DART_EXPERIMENTAL_INTERPRETER
"
!=
"1"
]
]
;
then
precompilation_flag
=
"--precompiled"
precompilation_flag
=
"--precompiled"
fi
fi
...
...
sky/build/SnapshotterInvoke
浏览文件 @
d52d3a44
...
@@ -99,6 +99,13 @@ SnapshotProject() {
...
@@ -99,6 +99,13 @@ SnapshotProject() {
fi
fi
AssertExists
$ui_path
AssertExists
$ui_path
# For dart:jni
local
jni_path
=
"
$(
readlink
${
packages
}
/sky_engine
)
/../sdk_ext/dart_jni/jni.dart"
if
[[
"
${
jni_path
:0:1
}
"
!=
"/"
]]
;
then
jni_path
=
"
${
packages
}
/
${
jni_path
}
"
fi
AssertExists
$jni_path
# For dart:vmservice_sky
# For dart:vmservice_sky
local
vm_service_path
=
"
$(
readlink
${
packages
}
/sky_engine
)
/../sdk_ext/dart/runtime/bin/vmservice/vmservice_io.dart"
local
vm_service_path
=
"
$(
readlink
${
packages
}
/sky_engine
)
/../sdk_ext/dart/runtime/bin/vmservice/vmservice_io.dart"
if
[[
"
${
vm_service_path
:0:1
}
"
!=
"/"
]]
;
then
if
[[
"
${
vm_service_path
:0:1
}
"
!=
"/"
]]
;
then
...
@@ -123,7 +130,26 @@ SnapshotProject() {
...
@@ -123,7 +130,26 @@ SnapshotProject() {
RunCommand
rm
-f
${
derived_dir
}
/kDartIsolateSnapshotBuffer.c
RunCommand
rm
-f
${
derived_dir
}
/kDartIsolateSnapshotBuffer.c
RunCommand
rm
-f
${
derived_dir
}
/InstructionsSnapshot.S
RunCommand
rm
-f
${
derived_dir
}
/InstructionsSnapshot.S
# Finally! Generate the snapshot. The instructions buffer is already in an
if
[[
$DART_EXPERIMENTAL_INTERPRETER
==
"1"
]]
;
then
# In case the experimental interpreter is enabled, we need a generic
# script snapshot instead of a precompilation snapshot.
RunCommand
${
FLUTTER_ARCH_TOOLS_PATH
}
/Snapshotter
\
--vm_isolate_snapshot
=
${
derived_dir
}
/kDartVmIsolateSnapshotBuffer
\
--isolate_snapshot
=
${
derived_dir
}
/kDartIsolateSnapshotBuffer
\
--package_root
=
${
packages
}
\
--url_mapping
=
dart:mojo.internal,
${
mojo_internal_path
}
\
--url_mapping
=
dart:ui,
${
ui_path
}
\
--url_mapping
=
dart:jni,
${
jni_path
}
\
--url_mapping
=
dart:vmservice_sky,
$vm_service_path
\
--conditional_directives
\
${
src_dir
}
/snapshot.dart
local
dummy_snapshot
=
${
derived_dir
}
/InstructionsSnapshot.S
RunCommand
rm
-f
${
dummy_snapshot
}
RunCommand
touch
${
dummy_snapshot
}
else
# Generate the precompilation snapshot. The instructions buffer is in an
# assembly file which can be directly used by the linker. For the VM isolate
# assembly file which can be directly used by the linker. For the VM isolate
# snapshot buffer and isolate snapshot buffer, we name the file to match
# snapshot buffer and isolate snapshot buffer, we name the file to match
# the name of the symbol the VM expects at runtime. On these binary files,
# the name of the symbol the VM expects at runtime. On these binary files,
...
@@ -145,6 +171,8 @@ SnapshotProject() {
...
@@ -145,6 +171,8 @@ SnapshotProject() {
--conditional_directives
\
--conditional_directives
\
$main_path
$main_path
fi
if
[[
$?
-ne
0
]]
;
then
if
[[
$?
-ne
0
]]
;
then
EchoError
"Snapshotter failed for
$1
..."
EchoError
"Snapshotter failed for
$1
..."
exit
-1
exit
-1
...
...
sky/build/sdk_xcode_harness/Flutter.xcconfig
浏览文件 @
d52d3a44
...
@@ -4,4 +4,8 @@
...
@@ -4,4 +4,8 @@
#include "Local.xcconfig"
#include "Local.xcconfig"
// This file only exists in case the embedder VM supports the interpreter on the
// device. If this file is not present, it is not an error.
#include "Interpreter.xcconfig"
FLUTTER_ARCH_TOOLS_PATH=${SOURCE_ROOT}/Tools/${PLATFORM_NAME}
FLUTTER_ARCH_TOOLS_PATH=${SOURCE_ROOT}/Tools/${PLATFORM_NAME}
sky/build/sdk_xcode_harness/FlutterApplication.xcodeproj/project.pbxproj
浏览文件 @
d52d3a44
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
9E0FB06D1C1A3F5600DDAEFA
/* InstructionsSnapshotSource.S in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E0FB0691C1A3F5600DDAEFA
/* InstructionsSnapshotSource.S */
;
};
9E0FB06D1C1A3F5600DDAEFA
/* InstructionsSnapshotSource.S in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E0FB0691C1A3F5600DDAEFA
/* InstructionsSnapshotSource.S */
;
};
9E0FB06E1C1A3F5600DDAEFA
/* kDartIsolateSnapshotBufferSource.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E0FB06A1C1A3F5600DDAEFA
/* kDartIsolateSnapshotBufferSource.c */
;
};
9E0FB06E1C1A3F5600DDAEFA
/* kDartIsolateSnapshotBufferSource.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E0FB06A1C1A3F5600DDAEFA
/* kDartIsolateSnapshotBufferSource.c */
;
};
9E0FB06F1C1A3F5600DDAEFA
/* kDartVmIsolateSnapshotBufferSource.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E0FB06B1C1A3F5600DDAEFA
/* kDartVmIsolateSnapshotBufferSource.c */
;
};
9E0FB06F1C1A3F5600DDAEFA
/* kDartVmIsolateSnapshotBufferSource.c in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E0FB06B1C1A3F5600DDAEFA
/* kDartVmIsolateSnapshotBufferSource.c */
;
};
9E40465D1C1B6E9200A4B87C
/* icudtl.dat in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E4046541C1B6A3600A4B87C
/* icudtl.dat */
;
};
9E627AD91C582ABB000D800D
/* app.flx in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E627AD81C582ABB000D800D
/* app.flx */
;
};
9E627AD91C582ABB000D800D
/* app.flx in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9E627AD81C582ABB000D800D
/* app.flx */
;
};
9EA2FB801C6D2D6B00670B03
/* LaunchScreen.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9EA2FB7F1C6D2D6B00670B03
/* LaunchScreen.storyboard */
;
};
9EA2FB801C6D2D6B00670B03
/* LaunchScreen.storyboard in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9EA2FB7F1C6D2D6B00670B03
/* LaunchScreen.storyboard */
;
};
/* End PBXBuildFile section */
/* End PBXBuildFile section */
...
@@ -49,7 +48,7 @@
...
@@ -49,7 +48,7 @@
/* End PBXCopyFilesBuildPhase section */
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
/* Begin PBXFileReference section */
97F908AF1CDC02C500D4520F
/* Flutter.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
Flutter.framework
;
path
=
../
iphonesimulator
/Flutter.framework
;
sourceTree
=
"<group>"
;
};
97F908AF1CDC02C500D4520F
/* Flutter.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
Flutter.framework
;
path
=
../
common
/Flutter.framework
;
sourceTree
=
"<group>"
;
};
9E07CF861BE7F4D200BCD8DE
/* FlutterApplication.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
includeInIndex
=
0
;
path
=
FlutterApplication.framework
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
9E07CF861BE7F4D200BCD8DE
/* FlutterApplication.framework */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.framework
;
includeInIndex
=
0
;
path
=
FlutterApplication.framework
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
9E07CF891BE7F4D200BCD8DE
/* FlutterApplication.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FlutterApplication.h
;
sourceTree
=
"<group>"
;
};
9E07CF891BE7F4D200BCD8DE
/* FlutterApplication.h */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
FlutterApplication.h
;
sourceTree
=
"<group>"
;
};
9E07CF8B1BE7F4D200BCD8DE
/* Info.plist */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
9E07CF8B1BE7F4D200BCD8DE
/* Info.plist */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.plist.xml
;
path
=
Info.plist
;
sourceTree
=
"<group>"
;
};
...
@@ -65,10 +64,10 @@
...
@@ -65,10 +64,10 @@
9E4046501C1B6A3600A4B87C
/* EmbedderEntryPoints */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text
;
path
=
EmbedderEntryPoints
;
sourceTree
=
"<group>"
;
};
9E4046501C1B6A3600A4B87C
/* EmbedderEntryPoints */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text
;
path
=
EmbedderEntryPoints
;
sourceTree
=
"<group>"
;
};
9E4046511C1B6A3600A4B87C
/* PackagerInvoke */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.script.sh
;
path
=
PackagerInvoke
;
sourceTree
=
"<group>"
;
};
9E4046511C1B6A3600A4B87C
/* PackagerInvoke */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.script.sh
;
path
=
PackagerInvoke
;
sourceTree
=
"<group>"
;
};
9E4046531C1B6A3600A4B87C
/* SnapshotterInvoke */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.script.sh
;
path
=
SnapshotterInvoke
;
sourceTree
=
"<group>"
;
};
9E4046531C1B6A3600A4B87C
/* SnapshotterInvoke */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.script.sh
;
path
=
SnapshotterInvoke
;
sourceTree
=
"<group>"
;
};
9E4046541C1B6A3600A4B87C
/* icudtl.dat */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
file
;
path
=
icudtl.dat
;
sourceTree
=
"<group>"
;
};
9E4046571C1B6A3600A4B87C
/* Snapshotter */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"compiled.mach-o.executable"
;
path
=
Snapshotter
;
sourceTree
=
"<group>"
;
};
9E4046571C1B6A3600A4B87C
/* Snapshotter */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"compiled.mach-o.executable"
;
path
=
Snapshotter
;
sourceTree
=
"<group>"
;
};
9E40465A1C1B6A3600A4B87C
/* Snapshotter */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"compiled.mach-o.executable"
;
path
=
Snapshotter
;
sourceTree
=
"<group>"
;
};
9E40465A1C1B6A3600A4B87C
/* Snapshotter */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"compiled.mach-o.executable"
;
path
=
Snapshotter
;
sourceTree
=
"<group>"
;
};
9E40465E1C1B6F7900A4B87C
/* Local.xcconfig */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.xcconfig
;
path
=
Local.xcconfig
;
sourceTree
=
"<group>"
;
};
9E40465E1C1B6F7900A4B87C
/* Local.xcconfig */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.xcconfig
;
path
=
Local.xcconfig
;
sourceTree
=
"<group>"
;
};
9E5CD2D81CD97EFF00D93CCC
/* snapshot.dart */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text
;
path
=
snapshot.dart
;
sourceTree
=
"<group>"
;
};
9E627AD81C582ABB000D800D
/* app.flx */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text
;
name
=
app.flx
;
path
=
Generated/app.flx
;
sourceTree
=
"<group>"
;
};
9E627AD81C582ABB000D800D
/* app.flx */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
text
;
name
=
app.flx
;
path
=
Generated/app.flx
;
sourceTree
=
"<group>"
;
};
9EA2FB7F1C6D2D6B00670B03
/* LaunchScreen.storyboard */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.storyboard
;
name
=
LaunchScreen.storyboard
;
path
=
../LaunchScreen.storyboard
;
sourceTree
=
SOURCE_ROOT
;
};
9EA2FB7F1C6D2D6B00670B03
/* LaunchScreen.storyboard */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
file.storyboard
;
name
=
LaunchScreen.storyboard
;
path
=
../LaunchScreen.storyboard
;
sourceTree
=
SOURCE_ROOT
;
};
/* End PBXFileReference section */
/* End PBXFileReference section */
...
@@ -160,10 +159,10 @@
...
@@ -160,10 +159,10 @@
9E40464F1C1B6A3600A4B87C
/* common */
=
{
9E40464F1C1B6A3600A4B87C
/* common */
=
{
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
9E5CD2D81CD97EFF00D93CCC
/* snapshot.dart */
,
9E4046501C1B6A3600A4B87C
/* EmbedderEntryPoints */
,
9E4046501C1B6A3600A4B87C
/* EmbedderEntryPoints */
,
9E4046511C1B6A3600A4B87C
/* PackagerInvoke */
,
9E4046511C1B6A3600A4B87C
/* PackagerInvoke */
,
9E4046531C1B6A3600A4B87C
/* SnapshotterInvoke */
,
9E4046531C1B6A3600A4B87C
/* SnapshotterInvoke */
,
9E4046541C1B6A3600A4B87C
/* icudtl.dat */
,
97F908AF1CDC02C500D4520F
/* Flutter.framework */
,
97F908AF1CDC02C500D4520F
/* Flutter.framework */
,
);
);
path
=
common
;
path
=
common
;
...
@@ -298,7 +297,6 @@
...
@@ -298,7 +297,6 @@
isa
=
PBXResourcesBuildPhase
;
isa
=
PBXResourcesBuildPhase
;
buildActionMask
=
2147483647
;
buildActionMask
=
2147483647
;
files
=
(
files
=
(
9E40465D1C1B6E9200A4B87C
/* icudtl.dat in Resources */
,
9EA2FB801C6D2D6B00670B03
/* LaunchScreen.storyboard in Resources */
,
9EA2FB801C6D2D6B00670B03
/* LaunchScreen.storyboard in Resources */
,
9E07CFA91BE8280A00BCD8DE
/* Assets.xcassets in Resources */
,
9E07CFA91BE8280A00BCD8DE
/* Assets.xcassets in Resources */
,
);
);
...
@@ -492,6 +490,7 @@
...
@@ -492,6 +490,7 @@
ENABLE_STRICT_OBJC_MSGSEND
=
YES
;
ENABLE_STRICT_OBJC_MSGSEND
=
YES
;
GCC_C_LANGUAGE_STANDARD
=
gnu99
;
GCC_C_LANGUAGE_STANDARD
=
gnu99
;
GCC_NO_COMMON_BLOCKS
=
YES
;
GCC_NO_COMMON_BLOCKS
=
YES
;
GCC_PREPROCESSOR_DEFINITIONS
=
""
;
GCC_WARN_64_TO_32_BIT_CONVERSION
=
YES
;
GCC_WARN_64_TO_32_BIT_CONVERSION
=
YES
;
GCC_WARN_ABOUT_RETURN_TYPE
=
YES_ERROR
;
GCC_WARN_ABOUT_RETURN_TYPE
=
YES_ERROR
;
GCC_WARN_UNDECLARED_SELECTOR
=
YES
;
GCC_WARN_UNDECLARED_SELECTOR
=
YES
;
...
...
sky/build/sdk_xcode_harness/FlutterApplication.xcodeproj/xcshareddata/xcschemes/Application.xcscheme
浏览文件 @
d52d3a44
...
@@ -62,18 +62,6 @@
...
@@ -62,18 +62,6 @@
</BuildableReference>
</BuildableReference>
</BuildableProductRunnable>
</BuildableProductRunnable>
<CommandLineArguments>
<CommandLineArguments>
<CommandLineArgument
argument =
"--dart-main=$(FLUTTER_APPLICATION_PATH)/lib/main.dart"
isEnabled =
"YES"
>
</CommandLineArgument>
<CommandLineArgument
argument =
"--flx=$(FLUTTER_APPLICATION_PATH)/build/app.flx"
isEnabled =
"YES"
>
</CommandLineArgument>
<CommandLineArgument
argument =
"--packages=$(FLUTTER_APPLICATION_PATH)/.packages"
isEnabled =
"YES"
>
</CommandLineArgument>
<CommandLineArgument
<CommandLineArgument
argument =
"--observatory-port=8181"
argument =
"--observatory-port=8181"
isEnabled =
"YES"
>
isEnabled =
"YES"
>
...
...
sky/build/sdk_xcode_harness/FlutterApplication/InstructionsSnapshotSource.S
浏览文件 @
d52d3a44
//
Copyright
2016
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
.
#if
__arm__ || __aarch64__
#if
(__arm__ || __aarch64__)
#include "Generated/InstructionsSnapshot.S"
#include "Generated/InstructionsSnapshot.S"
#endif
#endif
sky/build/sdk_xcode_harness/FlutterApplication/kDartIsolateSnapshotBufferSource.c
浏览文件 @
d52d3a44
...
@@ -2,6 +2,6 @@
...
@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
#if
__arm__ || __aarch64__
#if
(__arm__ || __aarch64__)
#include "Generated/kDartIsolateSnapshotBuffer.c"
#include "Generated/kDartIsolateSnapshotBuffer.c"
#endif
#endif
sky/build/sdk_xcode_harness/FlutterApplication/kDartVmIsolateSnapshotBufferSource.c
浏览文件 @
d52d3a44
...
@@ -2,6 +2,6 @@
...
@@ -2,6 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
#if
__arm__ || __aarch64__
#if
(__arm__ || __aarch64__)
#include "Generated/kDartVmIsolateSnapshotBuffer.c"
#include "Generated/kDartVmIsolateSnapshotBuffer.c"
#endif
#endif
sky/build/sdk_xcode_harness/Interpreter.xcconfig
0 → 100644
浏览文件 @
d52d3a44
// Copyright 2016 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.
DART_EXPERIMENTAL_INTERPRETER=1
sky/build/sky_precompilation_sdk.gni
浏览文件 @
d52d3a44
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# found in the LICENSE file.
import("//sky/engine/bindings/bindings.gni")
import("//build/config/templates/templates.gni")
import("//build/config/templates/templates.gni")
import("//sky/engine/bindings/bindings.gni")
template("sky_precompilation_sdk") {
template("sky_precompilation_sdk") {
assert(is_ios, "The precompilation SDK is only supported for iOS targets")
assert(is_ios, "The precompilation SDK is only supported for iOS targets")
...
@@ -61,6 +61,7 @@ template("sky_precompilation_sdk") {
...
@@ -61,6 +61,7 @@ template("sky_precompilation_sdk") {
sources = [
sources = [
"//sky/build/SnapshotterInvoke",
"//sky/build/SnapshotterInvoke",
"//sky/build/PackagerInvoke",
"//sky/build/PackagerInvoke",
"//sky/engine/bindings/snapshot.dart",
]
]
outputs = [ "$sdk_dir/$tools_dir/{{source_file_part}}" ]
outputs = [ "$sdk_dir/$tools_dir/{{source_file_part}}" ]
}
}
...
@@ -73,6 +74,13 @@ template("sky_precompilation_sdk") {
...
@@ -73,6 +74,13 @@ template("sky_precompilation_sdk") {
"//sky/build/sdk_xcode_harness/Local.xcconfig",
"//sky/build/sdk_xcode_harness/Local.xcconfig",
"//sky/build/sdk_xcode_harness/Runner",
"//sky/build/sdk_xcode_harness/Runner",
]
]
if (dart_experimental_interpreter) {
sources += [
"//sky/build/sdk_xcode_harness/Interpreter.xcconfig",
]
}
outputs = [ "$sdk_dir/{{source_file_part}}" ]
outputs = [ "$sdk_dir/{{source_file_part}}" ]
}
}
...
@@ -87,41 +95,11 @@ template("sky_precompilation_sdk") {
...
@@ -87,41 +95,11 @@ template("sky_precompilation_sdk") {
outputs = [ "$root_out_dir/{{source_file_part}}" ]
outputs = [ "$root_out_dir/{{source_file_part}}" ]
}
}
executable_gen_target_name = target_name + "_runner"
executable(executable_gen_target_name) {
libs = [
"AudioToolbox.framework",
"AVFoundation.framework",
"OpenGLES.framework",
"QuartzCore.framework",
"UIKit.framework",
]
deps = [ "//sky/shell:ios_scaffolding" ]
}
copy_runner_gen_target_name = target_name + "_copy_runner"
copy(copy_runner_gen_target_name) {
sources = [ "$root_out_dir/$executable_gen_target_name" ]
outputs = [ "$sdk_dir/$arch_tools_dir/FlutterRunner" ]
deps = [ ":$executable_gen_target_name" ]
}
copy_data_gen_target_name = target_name + "_copy_data"
copy(copy_data_gen_target_name) {
set_sources_assignment_filter([])
sources = [ "//third_party/icu/android/icudtl.dat" ]
outputs = [ "$sdk_dir/$tools_dir/{{source_file_part}}" ]
set_sources_assignment_filter(sources_assignment_filter)
}
group(target_name) {
group(target_name) {
deps = [
deps = [
":copy_snapshotter",
":copy_snapshotter",
":copy_flutter_framework",
":copy_flutter_framework",
":embedder_entry_points",
":embedder_entry_points",
":$copy_runner_gen_target_name",
":$copy_data_gen_target_name",
":precompilation_xcode_scripts",
":precompilation_xcode_scripts",
":copy_sdk_xcode_harness",
":copy_sdk_xcode_harness",
":copy_user_editable_files",
":copy_user_editable_files",
...
...
sky/engine/core/script/dart_init.cc
浏览文件 @
d52d3a44
...
@@ -457,6 +457,20 @@ void SetServiceIsolateHook(ServiceIsolateHook hook) {
...
@@ -457,6 +457,20 @@ void SetServiceIsolateHook(ServiceIsolateHook hook) {
g_service_isolate_hook
=
hook
;
g_service_isolate_hook
=
hook
;
}
}
static
bool
ShouldEnableCheckedMode
()
{
if
(
IsRunningPrecompiledCode
())
{
// Checked mode is never enabled during precompilation. Even snapshot
// generation disables checked mode arguments.
return
false
;
}
#if ENABLE(DART_STRICT)
return
true
;
#else
return
SkySettings
::
Get
().
enable_dart_checked_mode
;
#endif
}
void
InitDartVM
()
{
void
InitDartVM
()
{
TRACE_EVENT0
(
"flutter"
,
__func__
);
TRACE_EVENT0
(
"flutter"
,
__func__
);
...
@@ -468,30 +482,23 @@ void InitDartVM() {
...
@@ -468,30 +482,23 @@ void InitDartVM() {
DartMojoInternal
::
SetHandleWatcherProducerHandle
(
DartMojoInternal
::
SetHandleWatcherProducerHandle
(
mojo
::
dart
::
HandleWatcher
::
Start
());
mojo
::
dart
::
HandleWatcher
::
Start
());
bool
enable_checked_mode
=
SkySettings
::
Get
().
enable_dart_checked_mode
;
Vector
<
const
char
*>
args
;
#if ENABLE(DART_STRICT)
enable_checked_mode
=
true
;
#endif
if
(
IsRunningPrecompiledCode
())
{
// Instruct the VM to ignore unrecognized flags.
enable_checked_mode
=
false
;
// There is a lot of diversity in a lot of combinations when it
}
// comes to the arguments the VM supports. And, if the VM comes across a flag
// it does not recognize, it exits immediately.
args
.
append
(
"--ignore-unrecognized-flags"
);
Vector
<
const
char
*>
args
;
args
.
append
(
kDartProfilingArgs
,
arraysize
(
kDartProfilingArgs
));
args
.
append
(
kDartProfilingArgs
,
arraysize
(
kDartProfilingArgs
));
if
(
!
IsRunningPrecompiledCode
())
{
// The version of the VM setup to run precompiled code does not recognize
// the mirrors or the background compilation flags. They are never enabled.
// Make sure we dont pass in unrecognized flags.
args
.
append
(
kDartMirrorsArgs
,
arraysize
(
kDartMirrorsArgs
));
args
.
append
(
kDartMirrorsArgs
,
arraysize
(
kDartMirrorsArgs
));
args
.
append
(
kDartBackgroundCompilationArgs
,
args
.
append
(
kDartBackgroundCompilationArgs
,
arraysize
(
kDartBackgroundCompilationArgs
));
arraysize
(
kDartBackgroundCompilationArgs
));
}
else
{
if
(
IsRunningPrecompiledCode
())
args
.
append
(
kDartPrecompilationArgs
,
arraysize
(
kDartPrecompilationArgs
));
args
.
append
(
kDartPrecompilationArgs
,
arraysize
(
kDartPrecompilationArgs
));
}
if
(
enable_checked_mode
)
if
(
ShouldEnableCheckedMode
()
)
args
.
append
(
kDartCheckedModeArgs
,
arraysize
(
kDartCheckedModeArgs
));
args
.
append
(
kDartCheckedModeArgs
,
arraysize
(
kDartCheckedModeArgs
));
if
(
SkySettings
::
Get
().
start_paused
)
if
(
SkySettings
::
Get
().
start_paused
)
...
@@ -502,12 +509,9 @@ void InitDartVM() {
...
@@ -502,12 +509,9 @@ void InitDartVM() {
Vector
<
std
::
string
>
dart_flags
;
Vector
<
std
::
string
>
dart_flags
;
if
(
base
::
CommandLine
::
ForCurrentProcess
()
->
HasSwitch
(
kDartFlags
))
{
if
(
base
::
CommandLine
::
ForCurrentProcess
()
->
HasSwitch
(
kDartFlags
))
{
// Instruct the VM to ignore unrecognized flags.
args
.
append
(
"--ignore-unrecognized-flags"
);
// Split up dart flags by spaces.
// Split up dart flags by spaces.
base
::
CommandLine
&
command_line
=
*
base
::
CommandLine
::
ForCurrentProcess
();
base
::
CommandLine
&
command_line
=
*
base
::
CommandLine
::
ForCurrentProcess
();
std
::
stringstream
ss
(
std
::
stringstream
ss
(
command_line
.
GetSwitchValueNative
(
kDartFlags
));
command_line
.
GetSwitchValueNative
(
kDartFlags
));
std
::
istream_iterator
<
std
::
string
>
it
(
ss
);
std
::
istream_iterator
<
std
::
string
>
it
(
ss
);
std
::
istream_iterator
<
std
::
string
>
end
;
std
::
istream_iterator
<
std
::
string
>
end
;
while
(
it
!=
end
)
{
while
(
it
!=
end
)
{
...
...
sky/shell/platform/ios/framework/Headers/FlutterDartProject.h
浏览文件 @
d52d3a44
...
@@ -20,6 +20,9 @@ FLUTTER_EXPORT
...
@@ -20,6 +20,9 @@ FLUTTER_EXPORT
packages
:(
NSURL
*
)
dartPackages
packages
:(
NSURL
*
)
dartPackages
NS_DESIGNATED_INITIALIZER
;
NS_DESIGNATED_INITIALIZER
;
-
(
instancetype
)
initWithFLXArchiveWithScriptSnapshot
:(
NSURL
*
)
archiveURL
NS_DESIGNATED_INITIALIZER
;
-
(
instancetype
)
initFromDefaultSourceForConfiguration
;
-
(
instancetype
)
initFromDefaultSourceForConfiguration
;
@end
@end
...
...
sky/shell/platform/ios/framework/Source/FlutterAppDelegate.mm
浏览文件 @
d52d3a44
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
-
(
BOOL
)
application
:(
UIApplication
*
)
application
-
(
BOOL
)
application
:(
UIApplication
*
)
application
didFinishLaunchingWithOptions
:(
NSDictionary
*
)
launchOptions
{
didFinishLaunchingWithOptions
:(
NSDictionary
*
)
launchOptions
{
FlutterDartProject
*
project
=
FlutterDartProject
*
project
=
[[
FlutterDartProject
alloc
]
initFromDefaultSourceForConfiguration
];
[[
FlutterDartProject
alloc
]
initFromDefaultSourceForConfiguration
];
...
@@ -19,6 +18,7 @@
...
@@ -19,6 +18,7 @@
[[
FlutterViewController
alloc
]
initWithProject
:
project
[[
FlutterViewController
alloc
]
initWithProject
:
project
nibName:
nil
nibName:
nil
bundle:
nil
];
bundle:
nil
];
[
project
release
];
window
.
rootViewController
=
viewController
;
window
.
rootViewController
=
viewController
;
[
viewController
release
];
[
viewController
release
];
self
.
window
=
window
;
self
.
window
=
window
;
...
@@ -31,22 +31,28 @@
...
@@ -31,22 +31,28 @@
// Use the NSNotificationCenter to notify services when we're opened with URLs.
// Use the NSNotificationCenter to notify services when we're opened with URLs.
// TODO(jackson): Revisit this API once we have more services using URLs to make
// TODO(jackson): Revisit this API once we have more services using URLs to make
// it more typed and less brittle
// it more typed and less brittle
-
(
BOOL
)
application
:(
UIApplication
*
)
app
-
(
BOOL
)
application
:(
UIApplication
*
)
app
openURL
:(
NSURL
*
)
url
openURL
:(
NSURL
*
)
url
sourceApplication
:(
NSString
*
)
sourceApplication
sourceApplication
:(
NSString
*
)
sourceApplication
annotation
:(
id
)
annotation
annotation
:(
id
)
annotation
{
{
NSDictionary
*
dict
=
[@{
NSDictionary
*
dict
=
[@{
@"handled"
:
[
NSMutableDictionary
dictionary
],
@"handled"
:
[
NSMutableDictionary
dictionary
],
@"url"
:
url
,
@"url"
:
url
,
@"sourceApplication"
:
sourceApplication
,
@"sourceApplication"
:
sourceApplication
,
}
mutableCopy
];
}
mutableCopy
];
if
(
annotation
!=
nil
)
if
(
annotation
!=
nil
)
[
dict
setValue
:
annotation
forKey
:
@"annotation"
];
[
dict
setValue
:
annotation
forKey
:
@"annotation"
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"openURL"
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"openURL"
object:
self
object:
self
userInfo:
dict
];
userInfo:
dict
];
return
((
NSNumber
*
)
dict
[
@"handled"
][
@"value"
]).
boolValue
;
BOOL
handled
=
((
NSNumber
*
)
dict
[
@"handled"
][
@"value"
]).
boolValue
;
[
dict
release
];
return
handled
;
}
}
@end
@end
sky/shell/platform/ios/framework/Source/FlutterDartProject.mm
浏览文件 @
d52d3a44
...
@@ -5,14 +5,11 @@
...
@@ -5,14 +5,11 @@
#include "sky/shell/platform/ios/framework/Source/FlutterDartProject_Internal.h"
#include "sky/shell/platform/ios/framework/Source/FlutterDartProject_Internal.h"
#include "base/command_line.h"
#include "base/command_line.h"
#include "dart/runtime/include/dart_api.h"
#include "sky/shell/platform/ios/framework/Source/FlutterDartSource.h"
#include "sky/shell/platform/ios/framework/Source/FlutterDartSource.h"
#include "sky/shell/switches.h"
#include "sky/shell/switches.h"
namespace
{
static
NSURL
*
URLForSwitch
(
const
char
*
name
)
{
#if TARGET_IPHONE_SIMULATOR
NSURL
*
URLForSwitch
(
const
char
*
name
)
{
auto
cmd
=
*
base
::
CommandLine
::
ForCurrentProcess
();
auto
cmd
=
*
base
::
CommandLine
::
ForCurrentProcess
();
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
NSUserDefaults
*
defaults
=
[
NSUserDefaults
standardUserDefaults
];
...
@@ -26,10 +23,6 @@ NSURL* URLForSwitch(const char* name) {
...
@@ -26,10 +23,6 @@ NSURL* URLForSwitch(const char* name) {
return
[
defaults
URLForKey
:
@
(
name
)];
return
[
defaults
URLForKey
:
@
(
name
)];
}
}
#endif // TARGET_IPHONE_SIMULATOR
}
// namespace
@implementation
FlutterDartProject
{
@implementation
FlutterDartProject
{
NSBundle
*
_precompiledDartBundle
;
NSBundle
*
_precompiledDartBundle
;
FlutterDartSource
*
_dartSource
;
FlutterDartSource
*
_dartSource
;
...
@@ -73,22 +66,60 @@ NSURL* URLForSwitch(const char* name) {
...
@@ -73,22 +66,60 @@ NSURL* URLForSwitch(const char* name) {
return
self
;
return
self
;
}
}
-
(
instancetype
)
initWithFLXArchiveWithScriptSnapshot
:(
NSURL
*
)
archiveURL
{
self
=
[
super
init
];
if
(
self
)
{
_dartSource
=
[[
FlutterDartSource
alloc
]
initWithFLXArchiveWithScriptSnapshot:
archiveURL
];
[
self
checkReadiness
];
}
return
self
;
}
#pragma mark - Convenience initializers
#pragma mark - Convenience initializers
-
(
instancetype
)
initFromDefaultSourceForConfiguration
{
-
(
instancetype
)
initFromDefaultSourceForConfiguration
{
#if TARGET_IPHONE_SIMULATOR
return
[
self
initWithFLXArchive:
URLForSwitch
(
sky
:
:
shell
:
:
switches
::
kFLX
)
dartMain:
URLForSwitch
(
sky
::
shell
::
switches
::
kMainDartFile
)
packages:
URLForSwitch
(
sky
::
shell
::
switches
::
kPackages
)];
#else
NSString
*
bundlePath
=
NSString
*
bundlePath
=
[[
NSBundle
mainBundle
]
pathForResource
:
@"FlutterApplication"
[[
NSBundle
mainBundle
]
pathForResource
:
@"FlutterApplication"
ofType:
@"framework"
ofType:
@"framework"
inDirectory:
@"Frameworks"
];
inDirectory:
@"Frameworks"
];
NSBundle
*
bundle
=
[
NSBundle
bundleWithPath
:
bundlePath
];
NSBundle
*
bundle
=
[
NSBundle
bundleWithPath
:
bundlePath
];
// In both precompilation and non-precompilation cases, we need to bundle
// loaded since at least the FLX archive is present in it.
[
bundle
load
];
if
(
Dart_IsPrecompiledRuntime
())
{
// Load from an AOTC snapshot.
return
[
self
initWithPrecompiledDartBundle
:
bundle
];
return
[
self
initWithPrecompiledDartBundle
:
bundle
];
#endif
}
else
{
// Load directly from sources if the appropriate command line flags are
// specified. If not, try loading from a script snapshot in the framework
// bundle.
NSURL
*
flxURL
=
URLForSwitch
(
sky
::
shell
::
switches
::
kFLX
);
if
(
flxURL
==
nil
)
{
// If the URL was not specified on the command line, look inside the
// FlutterApplication bundle.
flxURL
=
[
NSURL
fileURLWithPath
:[
bundle
pathForResource
:
@"app"
ofType
:
@"flx"
]
isDirectory:
NO
];
}
NSURL
*
dartMainURL
=
URLForSwitch
(
sky
::
shell
::
switches
::
kMainDartFile
);
NSURL
*
dartPackagesURL
=
URLForSwitch
(
sky
::
shell
::
switches
::
kPackages
);
return
[
self
initWithFLXArchive
:
flxURL
dartMain:
dartMainURL
packages:
dartPackagesURL
];
}
NSAssert
(
NO
,
@"Unreachable"
);
[
self
release
];
return
nil
;
}
}
#pragma mark - Common initialization tasks
#pragma mark - Common initialization tasks
...
@@ -202,9 +233,15 @@ static NSString* NSStringFromVMType(VMType type) {
...
@@ -202,9 +233,15 @@ static NSString* NSStringFromVMType(VMType type) {
return
result
(
NO
,
message
);
return
result
(
NO
,
message
);
}
}
if
(
_dartSource
.
archiveContainsScriptSnapshot
)
{
engine
->
RunFromBundle
(
"file://script_snapshot"
,
_dartSource
.
flxArchive
.
absoluteURL
.
path
.
UTF8String
);
}
else
{
engine
->
RunFromFile
(
_dartSource
.
dartMain
.
absoluteURL
.
path
.
UTF8String
,
engine
->
RunFromFile
(
_dartSource
.
dartMain
.
absoluteURL
.
path
.
UTF8String
,
_dartSource
.
packages
.
absoluteURL
.
path
.
UTF8String
,
_dartSource
.
packages
.
absoluteURL
.
path
.
UTF8String
,
_dartSource
.
flxArchive
.
absoluteURL
.
path
.
UTF8String
);
_dartSource
.
flxArchive
.
absoluteURL
.
path
.
UTF8String
);
}
result
(
YES
,
@"Success"
);
result
(
YES
,
@"Success"
);
}];
}];
}
}
...
...
sky/shell/platform/ios/framework/Source/FlutterDartSource.h
浏览文件 @
d52d3a44
...
@@ -14,11 +14,15 @@ typedef void (^ValidationResult)(BOOL result, NSString* message);
...
@@ -14,11 +14,15 @@ typedef void (^ValidationResult)(BOOL result, NSString* message);
@property
(
nonatomic
,
readonly
)
NSURL
*
dartMain
;
@property
(
nonatomic
,
readonly
)
NSURL
*
dartMain
;
@property
(
nonatomic
,
readonly
)
NSURL
*
packages
;
@property
(
nonatomic
,
readonly
)
NSURL
*
packages
;
@property
(
nonatomic
,
readonly
)
NSURL
*
flxArchive
;
@property
(
nonatomic
,
readonly
)
NSURL
*
flxArchive
;
@property
(
nonatomic
,
readonly
)
BOOL
archiveContainsScriptSnapshot
;
-
(
instancetype
)
initWithDartMain
:(
NSURL
*
)
dartMain
-
(
instancetype
)
initWithDartMain
:(
NSURL
*
)
dartMain
packages
:(
NSURL
*
)
packages
packages
:(
NSURL
*
)
packages
flxArchive
:(
NSURL
*
)
flxArchive
NS_DESIGNATED_INITIALIZER
;
flxArchive
:(
NSURL
*
)
flxArchive
NS_DESIGNATED_INITIALIZER
;
-
(
instancetype
)
initWithFLXArchiveWithScriptSnapshot
:(
NSURL
*
)
flxArchive
NS_DESIGNATED_INITIALIZER
;
-
(
void
)
validate
:(
ValidationResult
)
result
;
-
(
void
)
validate
:(
ValidationResult
)
result
;
@end
@end
...
...
sky/shell/platform/ios/framework/Source/FlutterDartSource.mm
浏览文件 @
d52d3a44
...
@@ -4,16 +4,22 @@
...
@@ -4,16 +4,22 @@
#include "sky/shell/platform/ios/framework/Source/FlutterDartSource.h"
#include "sky/shell/platform/ios/framework/Source/FlutterDartSource.h"
@implementation
FlutterDartSource
{
@implementation
FlutterDartSource
NSURL
*
_dartMain
;
NSURL
*
_packages
;
@synthesize
dartMain
=
_dartMain
;
NSURL
*
_flxArchive
;
@synthesize
packages
=
_packages
;
}
@synthesize
flxArchive
=
_flxArchive
;
@synthesize
archiveContainsScriptSnapshot
=
_archiveContainsScriptSnapshot
;
#pragma mark - Convenience Initializers
-
(
instancetype
)
init
{
-
(
instancetype
)
init
{
return
[
self
initWithDartMain
:
nil
packages
:
nil
flxArchive
:
nil
];
return
[
self
initWithDartMain
:
nil
packages
:
nil
flxArchive
:
nil
];
}
}
#pragma mark - Designated Initializers
-
(
instancetype
)
initWithDartMain
:(
NSURL
*
)
dartMain
-
(
instancetype
)
initWithDartMain
:(
NSURL
*
)
dartMain
packages
:(
NSURL
*
)
packages
packages
:(
NSURL
*
)
packages
flxArchive
:(
NSURL
*
)
flxArchive
{
flxArchive
:(
NSURL
*
)
flxArchive
{
...
@@ -23,6 +29,30 @@
...
@@ -23,6 +29,30 @@
_dartMain
=
[
dartMain
copy
];
_dartMain
=
[
dartMain
copy
];
_packages
=
[
packages
copy
];
_packages
=
[
packages
copy
];
_flxArchive
=
[
flxArchive
copy
];
_flxArchive
=
[
flxArchive
copy
];
NSFileManager
*
fileManager
=
[
NSFileManager
defaultManager
];
const
BOOL
dartMainExists
=
[
fileManager
fileExistsAtPath
:
dartMain
.
absoluteURL
.
path
];
const
BOOL
packagesExists
=
[
fileManager
fileExistsAtPath
:
packages
.
absoluteURL
.
path
];
if
(
!
dartMainExists
||
!
packagesExists
)
{
// We cannot actually verify this without opening up the archive. This is
// just an assumption.
_archiveContainsScriptSnapshot
=
YES
;
}
}
return
self
;
}
-
(
instancetype
)
initWithFLXArchiveWithScriptSnapshot
:(
NSURL
*
)
flxArchive
{
self
=
[
super
init
];
if
(
self
)
{
_flxArchive
=
[
flxArchive
copy
];
_archiveContainsScriptSnapshot
=
YES
;
}
}
return
self
;
return
self
;
...
@@ -56,8 +86,11 @@ static BOOL CheckDartProjectURL(NSMutableString* log,
...
@@ -56,8 +86,11 @@ static BOOL CheckDartProjectURL(NSMutableString* log,
BOOL
isValid
=
YES
;
BOOL
isValid
=
YES
;
isValid
&=
CheckDartProjectURL
(
log
,
_flxArchive
,
@"FLX archive"
);
isValid
&=
CheckDartProjectURL
(
log
,
_flxArchive
,
@"FLX archive"
);
if
(
!
_archiveContainsScriptSnapshot
)
{
isValid
&=
CheckDartProjectURL
(
log
,
_dartMain
,
@"Dart main"
);
isValid
&=
CheckDartProjectURL
(
log
,
_dartMain
,
@"Dart main"
);
isValid
&=
CheckDartProjectURL
(
log
,
_packages
,
@"Dart packages"
);
isValid
&=
CheckDartProjectURL
(
log
,
_packages
,
@"Dart packages"
);
}
result
(
isValid
,
log
);
result
(
isValid
,
log
);
}
}
...
...
sky/shell/platform/ios/framework/Source/FlutterViewController.mm
浏览文件 @
d52d3a44
...
@@ -10,6 +10,7 @@
...
@@ -10,6 +10,7 @@
#include "base/mac/scoped_nsobject.h"
#include "base/mac/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#include "base/strings/sys_string_conversions.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event.h"
#include "dart/runtime/include/dart_api.h"
#include "mojo/public/cpp/application/connect.h"
#include "mojo/public/cpp/application/connect.h"
#include "mojo/public/interfaces/application/service_provider.mojom.h"
#include "mojo/public/interfaces/application/service_provider.mojom.h"
#include "sky/engine/wtf/MakeUnique.h"
#include "sky/engine/wtf/MakeUnique.h"
...
@@ -23,8 +24,8 @@
...
@@ -23,8 +24,8 @@
#include "sky/shell/platform/ios/framework/Source/FlutterDynamicServiceLoader.h"
#include "sky/shell/platform/ios/framework/Source/FlutterDynamicServiceLoader.h"
#include "sky/shell/platform/ios/framework/Source/FlutterView.h"
#include "sky/shell/platform/ios/framework/Source/FlutterView.h"
#include "sky/shell/platform/mac/platform_mac.h"
#include "sky/shell/platform/mac/platform_mac.h"
#include "sky/shell/platform/mac/platform_view_mac.h"
#include "sky/shell/platform/mac/platform_service_provider.h"
#include "sky/shell/platform/mac/platform_service_provider.h"
#include "sky/shell/platform/mac/platform_view_mac.h"
#include "sky/shell/platform/mac/view_service_provider.h"
#include "sky/shell/platform/mac/view_service_provider.h"
#include "sky/shell/platform_view.h"
#include "sky/shell/platform_view.h"
#include "sky/shell/shell.h"
#include "sky/shell/shell.h"
...
@@ -147,13 +148,10 @@ void FlutterInit(int argc, const char* argv[]) {
...
@@ -147,13 +148,10 @@ void FlutterInit(int argc, const char* argv[]) {
[
self
setupPlatformServiceProvider
];
[
self
setupPlatformServiceProvider
];
enum
VMType
type
=
VMTypeInvalid
;
// We ask the VM to check what it supports.
const
enum
VMType
type
=
Dart_IsPrecompiledRuntime
()
#if TARGET_IPHONE_SIMULATOR
?
VMTypePrecompilation
type
=
VMTypeInterpreter
;
:
VMTypeInterpreter
;
#else
type
=
VMTypePrecompilation
;
#endif
[
_dartProject
launchInEngine
:
_engine
[
_dartProject
launchInEngine
:
_engine
embedderVMType:
type
embedderVMType:
type
...
...
sky/tools/gn
浏览文件 @
d52d3a44
...
@@ -50,6 +50,11 @@ def to_gn_args(args):
...
@@ -50,6 +50,11 @@ def to_gn_args(args):
gn_args
[
'is_debug'
]
=
args
.
debug
gn_args
[
'is_debug'
]
=
args
.
debug
gn_args
[
'is_clang'
]
=
args
.
clang
and
args
.
target_os
not
in
[
'android'
]
gn_args
[
'is_clang'
]
=
args
.
clang
and
args
.
target_os
not
in
[
'android'
]
ios_target_cpu
=
'arm64'
if
args
.
ios_force_armv7
:
ios_target_cpu
=
'arm'
if
args
.
target_os
==
'android'
:
if
args
.
target_os
==
'android'
:
gn_args
[
'target_os'
]
=
'android'
gn_args
[
'target_os'
]
=
'android'
aot
=
not
args
.
develop
aot
=
not
args
.
develop
...
@@ -88,6 +93,8 @@ def to_gn_args(args):
...
@@ -88,6 +93,8 @@ def to_gn_args(args):
else
:
else
:
gn_args
[
'dart_runtime_mode'
]
=
'develop'
gn_args
[
'dart_runtime_mode'
]
=
'develop'
gn_args
[
'dart_experimental_interpreter'
]
=
args
.
experimental_interpreter
gn_args
[
'flutter_product_mode'
]
=
(
gn_args
[
'dart_runtime_mode'
]
==
'release'
)
gn_args
[
'flutter_product_mode'
]
=
(
gn_args
[
'dart_runtime_mode'
]
==
'release'
)
if
args
.
target_sysroot
:
if
args
.
target_sysroot
:
...
@@ -126,6 +133,7 @@ def parse_args(args):
...
@@ -126,6 +133,7 @@ def parse_args(args):
# Adding it now unblocks bot/tool work.
# Adding it now unblocks bot/tool work.
parser
.
add_argument
(
'--develop'
,
default
=
True
,
action
=
'store_true'
)
parser
.
add_argument
(
'--develop'
,
default
=
True
,
action
=
'store_true'
)
parser
.
add_argument
(
'--deploy'
,
default
=
False
,
dest
=
'develop'
,
action
=
'store_false'
)
parser
.
add_argument
(
'--deploy'
,
default
=
False
,
dest
=
'develop'
,
action
=
'store_false'
)
parser
.
add_argument
(
'--experimental-interpreter'
,
default
=
False
,
dest
=
'experimental_interpreter'
,
action
=
'store_true'
)
parser
.
add_argument
(
'--target-os'
,
type
=
str
,
choices
=
[
'android'
,
'ios'
])
parser
.
add_argument
(
'--target-os'
,
type
=
str
,
choices
=
[
'android'
,
'ios'
])
parser
.
add_argument
(
'--android'
,
dest
=
'target_os'
,
action
=
'store_const'
,
const
=
'android'
)
parser
.
add_argument
(
'--android'
,
dest
=
'target_os'
,
action
=
'store_const'
,
const
=
'android'
)
...
...
sky/tools/sky_snapshot/vm.cc
浏览文件 @
d52d3a44
...
@@ -17,6 +17,11 @@ static const char* kDartArgs[] = {
...
@@ -17,6 +17,11 @@ static const char* kDartArgs[] = {
"--enable_mirrors=false"
,
"--enable_mirrors=false"
,
"--load_deferred_eagerly=true"
,
"--load_deferred_eagerly=true"
,
"--conditional_directives"
,
"--conditional_directives"
,
// TODO(chinmaygarde): The experimental interpreter for iOS device targets
// does not support all these flags. The build process uses its own version
// of this snapshotter. Till support for all these flags is added, make
// sure the snapshotter does not error out on unrecognized flags.
"--ignore-unrecognized-flags"
,
};
};
void
InitDartVM
()
{
void
InitDartVM
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录