Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
46adf73d
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,发现更多精彩内容 >>
未验证
提交
46adf73d
编写于
1月 08, 2020
作者:
G
gaaclarke
提交者:
GitHub
1月 08, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Made it so you can specify the old gen heap size. (#15259)
上级
a97148c4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
40 addition
and
0 deletion
+40
-0
common/settings.cc
common/settings.cc
+1
-0
common/settings.h
common/settings.h
+7
-0
runtime/dart_vm.cc
runtime/dart_vm.cc
+14
-0
runtime/dart_vm_unittests.cc
runtime/dart_vm_unittests.cc
+10
-0
shell/platform/embedder/embedder.cc
shell/platform/embedder/embedder.cc
+1
-0
shell/platform/embedder/embedder.h
shell/platform/embedder/embedder.h
+7
-0
未找到文件。
common/settings.cc
浏览文件 @
46adf73d
...
...
@@ -58,6 +58,7 @@ std::string Settings::ToString() const {
stream
<<
"assets_path: "
<<
assets_path
<<
std
::
endl
;
stream
<<
"frame_rasterized_callback set: "
<<
!!
frame_rasterized_callback
<<
std
::
endl
;
stream
<<
"old_gen_heap_size: "
<<
old_gen_heap_size
<<
std
::
endl
;
return
stream
.
str
();
}
...
...
common/settings.h
浏览文件 @
46adf73d
...
...
@@ -191,6 +191,13 @@ struct Settings {
// the buffer must be as small as possible.
std
::
shared_ptr
<
const
fml
::
Mapping
>
persistent_isolate_data
;
/// Max size of old gen heap size in MB, or 0 for unlimited, -1 for default
/// value.
///
/// See also:
/// https://github.com/dart-lang/sdk/blob/ca64509108b3e7219c50d6c52877c85ab6a35ff2/runtime/vm/flag_list.h#L150
int64_t
old_gen_heap_size
=
-
1
;
std
::
string
ToString
()
const
;
};
...
...
runtime/dart_vm.cc
浏览文件 @
46adf73d
...
...
@@ -7,6 +7,7 @@
#include <sys/stat.h>
#include <mutex>
#include <sstream>
#include <vector>
#include "flutter/common/settings.h"
...
...
@@ -111,6 +112,12 @@ static const char* kDartTraceStreamsArgs[] = {
"--timeline_streams=Compiler,Dart,Debugger,Embedder,GC,Isolate,VM,API"
,
};
static
std
::
string
DartOldGenHeapSizeArgs
(
uint64_t
heap_size
)
{
std
::
ostringstream
oss
;
oss
<<
"--old_gen_heap_size="
<<
heap_size
;
return
oss
.
str
();
}
constexpr
char
kFileUriPrefix
[]
=
"file://"
;
constexpr
size_t
kFileUriPrefixLength
=
sizeof
(
kFileUriPrefix
)
-
1
;
...
...
@@ -366,6 +373,13 @@ DartVM::DartVM(std::shared_ptr<const DartVMData> vm_data,
PushBackAll
(
&
args
,
kDartTraceStartupArgs
,
fml
::
size
(
kDartTraceStartupArgs
));
}
std
::
string
old_gen_heap_size_args
;
if
(
settings_
.
old_gen_heap_size
>=
0
)
{
old_gen_heap_size_args
=
DartOldGenHeapSizeArgs
(
settings_
.
old_gen_heap_size
);
args
.
push_back
(
old_gen_heap_size_args
.
c_str
());
}
#if defined(OS_FUCHSIA)
PushBackAll
(
&
args
,
kDartFuchsiaTraceArgs
,
fml
::
size
(
kDartFuchsiaTraceArgs
));
PushBackAll
(
&
args
,
kDartTraceStreamsArgs
,
fml
::
size
(
kDartTraceStreamsArgs
));
...
...
runtime/dart_vm_unittests.cc
浏览文件 @
46adf73d
...
...
@@ -32,5 +32,15 @@ TEST_F(DartVMTest, SimpleIsolateNameServer) {
ASSERT_TRUE
(
ns
->
RemoveIsolateNameMapping
(
"foobar"
));
}
TEST_F
(
DartVMTest
,
OldGenHeapSize
)
{
ASSERT_FALSE
(
DartVMRef
::
IsInstanceRunning
());
auto
settings
=
CreateSettingsForFixture
();
settings
.
old_gen_heap_size
=
1024
;
auto
vm
=
DartVMRef
::
Create
(
settings
);
// There is no way to introspect on the heap size so we just assert the vm was
// created.
ASSERT_TRUE
(
vm
);
}
}
// namespace testing
}
// namespace flutter
shell/platform/embedder/embedder.cc
浏览文件 @
46adf73d
...
...
@@ -664,6 +664,7 @@ FlutterEngineResult FlutterEngineInitialize(size_t version,
settings
.
icu_data_path
=
icu_data_path
;
settings
.
assets_path
=
args
->
assets_path
;
settings
.
leak_vm
=
!
SAFE_ACCESS
(
args
,
shutdown_dart_vm_when_done
,
false
);
settings
.
old_gen_heap_size
=
SAFE_ACCESS
(
args
,
dart_old_gen_heap_size
,
-
1
);
if
(
!
flutter
::
DartVM
::
IsRunningPrecompiledCode
())
{
// Verify the assets path contains Dart 2 kernel assets.
...
...
shell/platform/embedder/embedder.h
浏览文件 @
46adf73d
...
...
@@ -1114,6 +1114,13 @@ typedef struct {
/// absence, platforms views in the scene are ignored and Flutter renders to
/// the root surface as normal.
const
FlutterCompositor
*
compositor
;
/// Max size of the old gen heap for the Dart VM in MB, or 0 for unlimited, -1
/// for default value.
///
/// See also:
/// https://github.com/dart-lang/sdk/blob/ca64509108b3e7219c50d6c52877c85ab6a35ff2/runtime/vm/flag_list.h#L150
int64_t
dart_old_gen_heap_size
;
}
FlutterProjectArgs
;
//------------------------------------------------------------------------------
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录