Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
4098146a
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4098146a
编写于
4月 12, 2013
作者:
T
twisti
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8011933: add number of classes, methods and time spent to CompileTheWorld
Reviewed-by: jrose, kvn
上级
e24568e9
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
21 addition
and
12 deletion
+21
-12
src/share/vm/classfile/classLoader.cpp
src/share/vm/classfile/classLoader.cpp
+18
-10
src/share/vm/classfile/classLoader.hpp
src/share/vm/classfile/classLoader.hpp
+3
-2
未找到文件。
src/share/vm/classfile/classLoader.cpp
浏览文件 @
4098146a
...
...
@@ -1274,13 +1274,16 @@ void ClassLoader::compile_the_world() {
Handle
system_class_loader
(
THREAD
,
SystemDictionary
::
java_system_loader
());
// Iterate over all bootstrap class path entries
ClassPathEntry
*
e
=
_first_entry
;
jlong
start
=
os
::
javaTimeMillis
();
while
(
e
!=
NULL
)
{
// We stop at rt.jar, unless it is the first bootstrap path entry
if
(
e
->
is_rt_jar
()
&&
e
!=
_first_entry
)
break
;
e
->
compile_the_world
(
system_class_loader
,
CATCH
);
e
=
e
->
next
();
}
tty
->
print_cr
(
"CompileTheWorld : Done"
);
jlong
end
=
os
::
javaTimeMillis
();
tty
->
print_cr
(
"CompileTheWorld : Done (%d classes, %d methods, %d ms)"
,
_compile_the_world_class_counter
,
_compile_the_world_method_counter
,
(
end
-
start
));
{
// Print statistics as if before normal exit:
extern
void
print_statistics
();
...
...
@@ -1289,7 +1292,8 @@ void ClassLoader::compile_the_world() {
vm_exit
(
0
);
}
int
ClassLoader
::
_compile_the_world_counter
=
0
;
int
ClassLoader
::
_compile_the_world_class_counter
=
0
;
int
ClassLoader
::
_compile_the_world_method_counter
=
0
;
static
int
_codecache_sweep_counter
=
0
;
// Filter out all exceptions except OOMs
...
...
@@ -1311,8 +1315,8 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
// If the file has a period after removing .class, it's not really a
// valid class file. The class loader will check everything else.
if
(
strchr
(
buffer
,
'.'
)
==
NULL
)
{
_compile_the_world_counter
++
;
if
(
_compile_the_world_counter
>
CompileTheWorldStopAt
)
return
;
_compile_the_world_c
lass_c
ounter
++
;
if
(
_compile_the_world_c
lass_c
ounter
>
CompileTheWorldStopAt
)
return
;
// Construct name without extension
TempNewSymbol
sym
=
SymbolTable
::
new_symbol
(
buffer
,
CHECK
);
...
...
@@ -1329,16 +1333,16 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
if
(
HAS_PENDING_EXCEPTION
)
{
// If something went wrong in preloading we just ignore it
clear_pending_exception_if_not_oom
(
CHECK
);
tty
->
print_cr
(
"Preloading failed for (%d) %s"
,
_compile_the_world_counter
,
buffer
);
tty
->
print_cr
(
"Preloading failed for (%d) %s"
,
_compile_the_world_c
lass_c
ounter
,
buffer
);
}
}
if
(
_compile_the_world_counter
>=
CompileTheWorldStartAt
)
{
if
(
_compile_the_world_c
lass_c
ounter
>=
CompileTheWorldStartAt
)
{
if
(
k
.
is_null
()
||
exception_occurred
)
{
// If something went wrong (e.g. ExceptionInInitializerError) we skip this class
tty
->
print_cr
(
"CompileTheWorld (%d) : Skipping %s"
,
_compile_the_world_counter
,
buffer
);
tty
->
print_cr
(
"CompileTheWorld (%d) : Skipping %s"
,
_compile_the_world_c
lass_c
ounter
,
buffer
);
}
else
{
tty
->
print_cr
(
"CompileTheWorld (%d) : %s"
,
_compile_the_world_counter
,
buffer
);
tty
->
print_cr
(
"CompileTheWorld (%d) : %s"
,
_compile_the_world_c
lass_c
ounter
,
buffer
);
// Preload all classes to get around uncommon traps
// Iterate over all methods in class
for
(
int
n
=
0
;
n
<
k
->
methods
()
->
length
();
n
++
)
{
...
...
@@ -1356,7 +1360,9 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
methodHandle
(),
0
,
"CTW"
,
THREAD
);
if
(
HAS_PENDING_EXCEPTION
)
{
clear_pending_exception_if_not_oom
(
CHECK
);
tty
->
print_cr
(
"CompileTheWorld (%d) : Skipping method: %s"
,
_compile_the_world_counter
,
m
->
name
()
->
as_C_string
());
tty
->
print_cr
(
"CompileTheWorld (%d) : Skipping method: %s"
,
_compile_the_world_class_counter
,
m
->
name
()
->
as_C_string
());
}
else
{
_compile_the_world_method_counter
++
;
}
if
(
TieredCompilation
&&
TieredStopAtLevel
>=
CompLevel_full_optimization
)
{
// Clobber the first compile and force second tier compilation
...
...
@@ -1370,7 +1376,9 @@ void ClassLoader::compile_the_world_in(char* name, Handle loader, TRAPS) {
methodHandle
(),
0
,
"CTW"
,
THREAD
);
if
(
HAS_PENDING_EXCEPTION
)
{
clear_pending_exception_if_not_oom
(
CHECK
);
tty
->
print_cr
(
"CompileTheWorld (%d) : Skipping method: %s"
,
_compile_the_world_counter
,
m
->
name
()
->
as_C_string
());
tty
->
print_cr
(
"CompileTheWorld (%d) : Skipping method: %s"
,
_compile_the_world_class_counter
,
m
->
name
()
->
as_C_string
());
}
else
{
_compile_the_world_method_counter
++
;
}
}
}
...
...
src/share/vm/classfile/classLoader.hpp
浏览文件 @
4098146a
...
...
@@ -340,11 +340,12 @@ class ClassLoader: AllStatic {
// Force compilation of all methods in all classes in bootstrap class path (stress test)
#ifndef PRODUCT
private:
static
int
_compile_the_world_counter
;
static
int
_compile_the_world_class_counter
;
static
int
_compile_the_world_method_counter
;
public:
static
void
compile_the_world
();
static
void
compile_the_world_in
(
char
*
name
,
Handle
loader
,
TRAPS
);
static
int
compile_the_world_counter
()
{
return
_compile_the_world_counter
;
}
static
int
compile_the_world_counter
()
{
return
_compile_the_world_c
lass_c
ounter
;
}
#endif //PRODUCT
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录