Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
8de4f80b
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看板
提交
8de4f80b
编写于
9月 24, 2012
作者:
T
twisti
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7200001: failed C1 OSR compile doesn't get recompiled with C2
Reviewed-by: kvn
上级
ddde67d8
变更
10
显示空白变更内容
内联
并排
Showing
10 changed file
with
183 addition
and
131 deletion
+183
-131
src/share/vm/compiler/compileBroker.cpp
src/share/vm/compiler/compileBroker.cpp
+24
-19
src/share/vm/compiler/compileBroker.hpp
src/share/vm/compiler/compileBroker.hpp
+1
-1
src/share/vm/compiler/compileLog.cpp
src/share/vm/compiler/compileLog.cpp
+36
-36
src/share/vm/oops/method.cpp
src/share/vm/oops/method.cpp
+59
-28
src/share/vm/oops/method.hpp
src/share/vm/oops/method.hpp
+19
-8
src/share/vm/runtime/advancedThresholdPolicy.cpp
src/share/vm/runtime/advancedThresholdPolicy.cpp
+3
-3
src/share/vm/runtime/compilationPolicy.cpp
src/share/vm/runtime/compilationPolicy.cpp
+16
-16
src/share/vm/runtime/simpleThresholdPolicy.cpp
src/share/vm/runtime/simpleThresholdPolicy.cpp
+19
-14
src/share/vm/runtime/vmStructs.cpp
src/share/vm/runtime/vmStructs.cpp
+1
-1
src/share/vm/utilities/accessFlags.hpp
src/share/vm/utilities/accessFlags.hpp
+5
-5
未找到文件。
src/share/vm/compiler/compileBroker.cpp
浏览文件 @
8de4f80b
...
@@ -197,9 +197,9 @@ class CompilationLog : public StringEventLog {
...
@@ -197,9 +197,9 @@ class CompilationLog : public StringEventLog {
void
log_compile
(
JavaThread
*
thread
,
CompileTask
*
task
)
{
void
log_compile
(
JavaThread
*
thread
,
CompileTask
*
task
)
{
StringLogMessage
lm
;
StringLogMessage
lm
;
stringStream
msg
=
lm
.
stream
();
stringStream
sstr
=
lm
.
stream
();
// msg.time_stamp().update_to(tty->time_stamp().ticks());
// msg.time_stamp().update_to(tty->time_stamp().ticks());
task
->
print_compilation
(
&
msg
,
true
);
task
->
print_compilation
(
&
sstr
,
NULL
,
true
);
log
(
thread
,
"%s"
,
(
const
char
*
)
lm
);
log
(
thread
,
"%s"
,
(
const
char
*
)
lm
);
}
}
...
@@ -491,9 +491,9 @@ void CompileTask::print_inline_indent(int inline_level, outputStream* st) {
...
@@ -491,9 +491,9 @@ void CompileTask::print_inline_indent(int inline_level, outputStream* st) {
// ------------------------------------------------------------------
// ------------------------------------------------------------------
// CompileTask::print_compilation
// CompileTask::print_compilation
void
CompileTask
::
print_compilation
(
outputStream
*
st
,
bool
short_form
)
{
void
CompileTask
::
print_compilation
(
outputStream
*
st
,
const
char
*
msg
,
bool
short_form
)
{
bool
is_osr_method
=
osr_bci
()
!=
InvocationEntryBci
;
bool
is_osr_method
=
osr_bci
()
!=
InvocationEntryBci
;
print_compilation_impl
(
st
,
method
(),
compile_id
(),
comp_level
(),
is_osr_method
,
osr_bci
(),
is_blocking
(),
NULL
,
short_form
);
print_compilation_impl
(
st
,
method
(),
compile_id
(),
comp_level
(),
is_osr_method
,
osr_bci
(),
is_blocking
(),
msg
,
short_form
);
}
}
// ------------------------------------------------------------------
// ------------------------------------------------------------------
...
@@ -1249,7 +1249,7 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci,
...
@@ -1249,7 +1249,7 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci,
// We accept a higher level osr method
// We accept a higher level osr method
nmethod
*
nm
=
method
->
lookup_osr_nmethod_for
(
osr_bci
,
comp_level
,
false
);
nmethod
*
nm
=
method
->
lookup_osr_nmethod_for
(
osr_bci
,
comp_level
,
false
);
if
(
nm
!=
NULL
)
return
nm
;
if
(
nm
!=
NULL
)
return
nm
;
if
(
method
->
is_not_osr_compilable
())
return
NULL
;
if
(
method
->
is_not_osr_compilable
(
comp_level
))
return
NULL
;
}
}
assert
(
!
HAS_PENDING_EXCEPTION
,
"No exception should be present"
);
assert
(
!
HAS_PENDING_EXCEPTION
,
"No exception should be present"
);
...
@@ -1330,7 +1330,7 @@ bool CompileBroker::compilation_is_complete(methodHandle method,
...
@@ -1330,7 +1330,7 @@ bool CompileBroker::compilation_is_complete(methodHandle method,
int
comp_level
)
{
int
comp_level
)
{
bool
is_osr
=
(
osr_bci
!=
standard_entry_bci
);
bool
is_osr
=
(
osr_bci
!=
standard_entry_bci
);
if
(
is_osr
)
{
if
(
is_osr
)
{
if
(
method
->
is_not_osr_compilable
())
{
if
(
method
->
is_not_osr_compilable
(
comp_level
))
{
return
true
;
return
true
;
}
else
{
}
else
{
nmethod
*
result
=
method
->
lookup_osr_nmethod_for
(
osr_bci
,
comp_level
,
true
);
nmethod
*
result
=
method
->
lookup_osr_nmethod_for
(
osr_bci
,
comp_level
,
true
);
...
@@ -1381,7 +1381,7 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci,
...
@@ -1381,7 +1381,7 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci,
// Some compilers may not support on stack replacement.
// Some compilers may not support on stack replacement.
if
(
is_osr
&&
if
(
is_osr
&&
(
!
CICompileOSR
||
!
compiler
(
comp_level
)
->
supports_osr
()))
{
(
!
CICompileOSR
||
!
compiler
(
comp_level
)
->
supports_osr
()))
{
method
->
set_not_osr_compilable
();
method
->
set_not_osr_compilable
(
comp_level
);
return
true
;
return
true
;
}
}
...
@@ -1807,11 +1807,10 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
...
@@ -1807,11 +1807,10 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
_compilation_log
->
log_failure
(
thread
,
task
,
ci_env
.
failure_reason
(),
retry_message
);
_compilation_log
->
log_failure
(
thread
,
task
,
ci_env
.
failure_reason
(),
retry_message
);
}
}
if
(
PrintCompilation
)
{
if
(
PrintCompilation
)
{
tty
->
print
(
"%4d COMPILE SKIPPED: %s"
,
compile_id
,
ci_env
.
failure_reason
());
FormatBufferResource
msg
=
retry_message
!=
NULL
?
if
(
retry_message
!=
NULL
)
{
err_msg_res
(
"COMPILE SKIPPED: %s (%s)"
,
ci_env
.
failure_reason
(),
retry_message
)
:
tty
->
print
(
" (%s)"
,
retry_message
);
err_msg_res
(
"COMPILE SKIPPED: %s"
,
ci_env
.
failure_reason
());
}
task
->
print_compilation
(
tty
,
msg
);
tty
->
cr
();
}
}
}
else
{
}
else
{
task
->
mark_success
();
task
->
mark_success
();
...
@@ -1840,14 +1839,20 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
...
@@ -1840,14 +1839,20 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
tty
->
print_cr
(
"size: %d time: %d inlined: %d bytes"
,
code_size
,
(
int
)
time
.
milliseconds
(),
task
->
num_inlined_bytecodes
());
tty
->
print_cr
(
"size: %d time: %d inlined: %d bytes"
,
code_size
,
(
int
)
time
.
milliseconds
(),
task
->
num_inlined_bytecodes
());
}
}
if
(
compilable
==
ciEnv
::
MethodCompilable_never
)
{
// Disable compilation, if required.
if
(
is_osr
)
{
switch
(
compilable
)
{
method
->
set_not_osr_compilable
();
case
ciEnv
::
MethodCompilable_never
:
}
else
{
if
(
is_osr
)
method
->
set_not_osr_compilable_quietly
();
else
method
->
set_not_compilable_quietly
();
method
->
set_not_compilable_quietly
();
}
break
;
}
else
if
(
compilable
==
ciEnv
::
MethodCompilable_not_at_tier
)
{
case
ciEnv
::
MethodCompilable_not_at_tier
:
if
(
is_osr
)
method
->
set_not_osr_compilable_quietly
(
task
->
comp_level
());
else
method
->
set_not_compilable_quietly
(
task
->
comp_level
());
method
->
set_not_compilable_quietly
(
task
->
comp_level
());
break
;
}
}
// Note that the queued_for_compilation bits are cleared without
// Note that the queued_for_compilation bits are cleared without
...
...
src/share/vm/compiler/compileBroker.hpp
浏览文件 @
8de4f80b
...
@@ -105,7 +105,7 @@ private:
...
@@ -105,7 +105,7 @@ private:
const
char
*
msg
=
NULL
,
bool
short_form
=
false
);
const
char
*
msg
=
NULL
,
bool
short_form
=
false
);
public:
public:
void
print_compilation
(
outputStream
*
st
=
tty
,
bool
short_form
=
false
);
void
print_compilation
(
outputStream
*
st
=
tty
,
const
char
*
msg
=
NULL
,
bool
short_form
=
false
);
static
void
print_compilation
(
outputStream
*
st
,
const
nmethod
*
nm
,
const
char
*
msg
=
NULL
,
bool
short_form
=
false
)
{
static
void
print_compilation
(
outputStream
*
st
,
const
nmethod
*
nm
,
const
char
*
msg
=
NULL
,
bool
short_form
=
false
)
{
print_compilation_impl
(
st
,
nm
->
method
(),
nm
->
compile_id
(),
nm
->
comp_level
(),
print_compilation_impl
(
st
,
nm
->
method
(),
nm
->
compile_id
(),
nm
->
comp_level
(),
nm
->
is_osr_method
(),
nm
->
is_osr_method
()
?
nm
->
osr_entry_bci
()
:
-
1
,
/*is_blocking*/
false
,
nm
->
is_osr_method
(),
nm
->
is_osr_method
()
?
nm
->
osr_entry_bci
()
:
-
1
,
/*is_blocking*/
false
,
...
...
src/share/vm/compiler/compileLog.cpp
浏览文件 @
8de4f80b
src/share/vm/oops/method.cpp
浏览文件 @
8de4f80b
...
@@ -692,30 +692,18 @@ void Method::set_signature_handler(address handler) {
...
@@ -692,30 +692,18 @@ void Method::set_signature_handler(address handler) {
}
}
bool
Method
::
is_not_compilable
(
int
comp_level
)
const
{
void
Method
::
print_made_not_compilable
(
int
comp_level
,
bool
is_osr
,
bool
report
)
{
if
(
number_of_breakpoints
()
>
0
)
{
return
true
;
}
if
(
is_method_handle_intrinsic
())
{
return
!
is_synthetic
();
// the generated adapters must be compiled
}
if
(
comp_level
==
CompLevel_any
)
{
return
is_not_c1_compilable
()
||
is_not_c2_compilable
();
}
if
(
is_c1_compile
(
comp_level
))
{
return
is_not_c1_compilable
();
}
if
(
is_c2_compile
(
comp_level
))
{
return
is_not_c2_compilable
();
}
return
false
;
}
// call this when compiler finds that this method is not compilable
void
Method
::
set_not_compilable
(
int
comp_level
,
bool
report
)
{
if
(
PrintCompilation
&&
report
)
{
if
(
PrintCompilation
&&
report
)
{
ttyLocker
ttyl
;
ttyLocker
ttyl
;
tty
->
print
(
"made not compilable "
);
tty
->
print
(
"made not %scompilable on "
,
is_osr
?
"OSR "
:
""
);
if
(
comp_level
==
CompLevel_all
)
{
tty
->
print
(
"all levels "
);
}
else
{
tty
->
print
(
"levels "
);
for
(
int
i
=
(
int
)
CompLevel_none
;
i
<=
comp_level
;
i
++
)
{
tty
->
print
(
"%d "
,
i
);
}
}
this
->
print_short_name
(
tty
);
this
->
print_short_name
(
tty
);
int
size
=
this
->
code_size
();
int
size
=
this
->
code_size
();
if
(
size
>
0
)
if
(
size
>
0
)
...
@@ -724,21 +712,64 @@ void Method::set_not_compilable(int comp_level, bool report) {
...
@@ -724,21 +712,64 @@ void Method::set_not_compilable(int comp_level, bool report) {
}
}
if
((
TraceDeoptimization
||
LogCompilation
)
&&
(
xtty
!=
NULL
))
{
if
((
TraceDeoptimization
||
LogCompilation
)
&&
(
xtty
!=
NULL
))
{
ttyLocker
ttyl
;
ttyLocker
ttyl
;
xtty
->
begin_elem
(
"make_not_
compilable thread='%d'
"
,
(
int
)
os
::
current_thread_id
());
xtty
->
begin_elem
(
"make_not_
%scompilable thread='%d'"
,
is_osr
?
"osr_"
:
"
"
,
(
int
)
os
::
current_thread_id
());
xtty
->
method
(
this
);
xtty
->
method
(
this
);
xtty
->
stamp
();
xtty
->
stamp
();
xtty
->
end_elem
();
xtty
->
end_elem
();
}
}
}
bool
Method
::
is_not_compilable
(
int
comp_level
)
const
{
if
(
number_of_breakpoints
()
>
0
)
return
true
;
if
(
is_method_handle_intrinsic
())
return
!
is_synthetic
();
// the generated adapters must be compiled
if
(
comp_level
==
CompLevel_any
)
return
is_not_c1_compilable
()
||
is_not_c2_compilable
();
if
(
is_c1_compile
(
comp_level
))
return
is_not_c1_compilable
();
if
(
is_c2_compile
(
comp_level
))
return
is_not_c2_compilable
();
return
false
;
}
// call this when compiler finds that this method is not compilable
void
Method
::
set_not_compilable
(
int
comp_level
,
bool
report
)
{
print_made_not_compilable
(
comp_level
,
/*is_osr*/
false
,
report
);
if
(
comp_level
==
CompLevel_all
)
{
if
(
comp_level
==
CompLevel_all
)
{
set_not_c1_compilable
();
set_not_c1_compilable
();
set_not_c2_compilable
();
set_not_c2_compilable
();
}
else
{
}
else
{
if
(
is_c1_compile
(
comp_level
))
{
if
(
is_c1_compile
(
comp_level
))
set_not_c1_compilable
();
set_not_c1_compilable
();
}
else
if
(
is_c2_compile
(
comp_level
))
if
(
is_c2_compile
(
comp_level
))
{
set_not_c2_compilable
();
set_not_c2_compilable
();
}
}
CompilationPolicy
::
policy
()
->
disable_compilation
(
this
);
}
bool
Method
::
is_not_osr_compilable
(
int
comp_level
)
const
{
if
(
is_not_compilable
(
comp_level
))
return
true
;
if
(
comp_level
==
CompLevel_any
)
return
is_not_c1_osr_compilable
()
||
is_not_c2_osr_compilable
();
if
(
is_c1_compile
(
comp_level
))
return
is_not_c1_osr_compilable
();
if
(
is_c2_compile
(
comp_level
))
return
is_not_c2_osr_compilable
();
return
false
;
}
void
Method
::
set_not_osr_compilable
(
int
comp_level
,
bool
report
)
{
print_made_not_compilable
(
comp_level
,
/*is_osr*/
true
,
report
);
if
(
comp_level
==
CompLevel_all
)
{
set_not_c1_osr_compilable
();
set_not_c2_osr_compilable
();
}
else
{
if
(
is_c1_compile
(
comp_level
))
set_not_c1_osr_compilable
();
if
(
is_c2_compile
(
comp_level
))
set_not_c2_osr_compilable
();
}
}
CompilationPolicy
::
policy
()
->
disable_compilation
(
this
);
CompilationPolicy
::
policy
()
->
disable_compilation
(
this
);
}
}
...
...
src/share/vm/oops/method.hpp
浏览文件 @
8de4f80b
...
@@ -750,15 +750,26 @@ class Method : public Metadata {
...
@@ -750,15 +750,26 @@ class Method : public Metadata {
void
set_not_compilable_quietly
(
int
comp_level
=
CompLevel_all
)
{
void
set_not_compilable_quietly
(
int
comp_level
=
CompLevel_all
)
{
set_not_compilable
(
comp_level
,
false
);
set_not_compilable
(
comp_level
,
false
);
}
}
bool
is_not_osr_compilable
(
int
comp_level
=
CompLevel_any
)
const
{
bool
is_not_osr_compilable
(
int
comp_level
=
CompLevel_any
)
const
;
return
is_not_compilable
(
comp_level
)
||
access_flags
().
is_not_osr_compilable
();
void
set_not_osr_compilable
(
int
comp_level
=
CompLevel_all
,
bool
report
=
true
);
void
set_not_osr_compilable_quietly
(
int
comp_level
=
CompLevel_all
)
{
set_not_osr_compilable
(
comp_level
,
false
);
}
}
void
set_not_osr_compilable
()
{
_access_flags
.
set_not_osr_compilable
();
}
private:
void
print_made_not_compilable
(
int
comp_level
,
bool
is_osr
,
bool
report
);
public:
bool
is_not_c1_compilable
()
const
{
return
access_flags
().
is_not_c1_compilable
();
}
bool
is_not_c1_compilable
()
const
{
return
access_flags
().
is_not_c1_compilable
();
}
void
set_not_c1_compilable
()
{
_access_flags
.
set_not_c1_compilable
();
}
void
set_not_c1_compilable
()
{
_access_flags
.
set_not_c1_compilable
();
}
bool
is_not_c2_compilable
()
const
{
return
access_flags
().
is_not_c2_compilable
();
}
bool
is_not_c2_compilable
()
const
{
return
access_flags
().
is_not_c2_compilable
();
}
void
set_not_c2_compilable
()
{
_access_flags
.
set_not_c2_compilable
();
}
void
set_not_c2_compilable
()
{
_access_flags
.
set_not_c2_compilable
();
}
bool
is_not_c1_osr_compilable
()
const
{
return
is_not_c1_compilable
();
}
// don't waste an accessFlags bit
void
set_not_c1_osr_compilable
()
{
set_not_c1_compilable
();
}
// don't waste an accessFlags bit
bool
is_not_c2_osr_compilable
()
const
{
return
access_flags
().
is_not_c2_osr_compilable
();
}
void
set_not_c2_osr_compilable
()
{
_access_flags
.
set_not_c2_osr_compilable
();
}
// Background compilation support
// Background compilation support
bool
queued_for_compilation
()
const
{
return
access_flags
().
queued_for_compilation
();
}
bool
queued_for_compilation
()
const
{
return
access_flags
().
queued_for_compilation
();
}
void
set_queued_for_compilation
()
{
_access_flags
.
set_queued_for_compilation
();
}
void
set_queued_for_compilation
()
{
_access_flags
.
set_queued_for_compilation
();
}
...
...
src/share/vm/runtime/advancedThresholdPolicy.cpp
浏览文件 @
8de4f80b
...
@@ -30,11 +30,11 @@
...
@@ -30,11 +30,11 @@
// Print an event.
// Print an event.
void
AdvancedThresholdPolicy
::
print_specific
(
EventType
type
,
methodHandle
mh
,
methodHandle
imh
,
void
AdvancedThresholdPolicy
::
print_specific
(
EventType
type
,
methodHandle
mh
,
methodHandle
imh
,
int
bci
,
CompLevel
level
)
{
int
bci
,
CompLevel
level
)
{
tty
->
print
(
" rate
:
"
);
tty
->
print
(
" rate
=
"
);
if
(
mh
->
prev_time
()
==
0
)
tty
->
print
(
"n/a"
);
if
(
mh
->
prev_time
()
==
0
)
tty
->
print
(
"n/a"
);
else
tty
->
print
(
"%f"
,
mh
->
rate
());
else
tty
->
print
(
"%f"
,
mh
->
rate
());
tty
->
print
(
" k
:
%.2lf,%.2lf"
,
threshold_scale
(
CompLevel_full_profile
,
Tier3LoadFeedback
),
tty
->
print
(
" k
=
%.2lf,%.2lf"
,
threshold_scale
(
CompLevel_full_profile
,
Tier3LoadFeedback
),
threshold_scale
(
CompLevel_full_optimization
,
Tier4LoadFeedback
));
threshold_scale
(
CompLevel_full_optimization
,
Tier4LoadFeedback
));
}
}
...
...
src/share/vm/runtime/compilationPolicy.cpp
浏览文件 @
8de4f80b
...
@@ -394,28 +394,27 @@ void NonTieredCompPolicy::trace_osr_request(methodHandle method, nmethod* osr, i
...
@@ -394,28 +394,27 @@ void NonTieredCompPolicy::trace_osr_request(methodHandle method, nmethod* osr, i
// SimpleCompPolicy - compile current method
// SimpleCompPolicy - compile current method
void
SimpleCompPolicy
::
method_invocation_event
(
methodHandle
m
,
JavaThread
*
thread
)
{
void
SimpleCompPolicy
::
method_invocation_event
(
methodHandle
m
,
JavaThread
*
thread
)
{
int
hot_count
=
m
->
invocation_count
();
const
int
comp_level
=
CompLevel_highest_tier
;
const
int
hot_count
=
m
->
invocation_count
();
reset_counter_for_invocation_event
(
m
);
reset_counter_for_invocation_event
(
m
);
const
char
*
comment
=
"count"
;
const
char
*
comment
=
"count"
;
if
(
is_compilation_enabled
()
&&
can_be_compiled
(
m
))
{
if
(
is_compilation_enabled
()
&&
can_be_compiled
(
m
))
{
nmethod
*
nm
=
m
->
code
();
nmethod
*
nm
=
m
->
code
();
if
(
nm
==
NULL
)
{
if
(
nm
==
NULL
)
{
const
char
*
comment
=
"count"
;
CompileBroker
::
compile_method
(
m
,
InvocationEntryBci
,
comp_level
,
m
,
hot_count
,
comment
,
thread
);
CompileBroker
::
compile_method
(
m
,
InvocationEntryBci
,
CompLevel_highest_tier
,
m
,
hot_count
,
comment
,
thread
);
}
}
}
}
}
}
void
SimpleCompPolicy
::
method_back_branch_event
(
methodHandle
m
,
int
bci
,
JavaThread
*
thread
)
{
void
SimpleCompPolicy
::
method_back_branch_event
(
methodHandle
m
,
int
bci
,
JavaThread
*
thread
)
{
int
hot_count
=
m
->
backedge_count
();
const
int
comp_level
=
CompLevel_highest_tier
;
const
int
hot_count
=
m
->
backedge_count
();
const
char
*
comment
=
"backedge_count"
;
const
char
*
comment
=
"backedge_count"
;
if
(
is_compilation_enabled
()
&&
!
m
->
is_not_osr_compilable
()
&&
can_be_compiled
(
m
))
{
if
(
is_compilation_enabled
()
&&
!
m
->
is_not_osr_compilable
(
comp_level
)
&&
can_be_compiled
(
m
))
{
CompileBroker
::
compile_method
(
m
,
bci
,
CompLevel_highest_tier
,
CompileBroker
::
compile_method
(
m
,
bci
,
comp_level
,
m
,
hot_count
,
comment
,
thread
);
m
,
hot_count
,
comment
,
thread
);
NOT_PRODUCT
(
trace_osr_completion
(
m
->
lookup_osr_nmethod_for
(
bci
,
comp_level
,
true
));)
NOT_PRODUCT
(
trace_osr_completion
(
m
->
lookup_osr_nmethod_for
(
bci
,
CompLevel_highest_tier
,
true
));)
}
}
}
}
// StackWalkCompPolicy - walk up stack to find a suitable method to compile
// StackWalkCompPolicy - walk up stack to find a suitable method to compile
...
@@ -426,7 +425,8 @@ const char* StackWalkCompPolicy::_msg = NULL;
...
@@ -426,7 +425,8 @@ const char* StackWalkCompPolicy::_msg = NULL;
// Consider m for compilation
// Consider m for compilation
void
StackWalkCompPolicy
::
method_invocation_event
(
methodHandle
m
,
JavaThread
*
thread
)
{
void
StackWalkCompPolicy
::
method_invocation_event
(
methodHandle
m
,
JavaThread
*
thread
)
{
int
hot_count
=
m
->
invocation_count
();
const
int
comp_level
=
CompLevel_highest_tier
;
const
int
hot_count
=
m
->
invocation_count
();
reset_counter_for_invocation_event
(
m
);
reset_counter_for_invocation_event
(
m
);
const
char
*
comment
=
"count"
;
const
char
*
comment
=
"count"
;
...
@@ -457,20 +457,20 @@ void StackWalkCompPolicy::method_invocation_event(methodHandle m, JavaThread* th
...
@@ -457,20 +457,20 @@ void StackWalkCompPolicy::method_invocation_event(methodHandle m, JavaThread* th
if
(
TimeCompilationPolicy
)
accumulated_time
()
->
stop
();
if
(
TimeCompilationPolicy
)
accumulated_time
()
->
stop
();
assert
(
top
!=
NULL
,
"findTopInlinableFrame returned null"
);
assert
(
top
!=
NULL
,
"findTopInlinableFrame returned null"
);
if
(
TraceCompilationPolicy
)
top
->
print
();
if
(
TraceCompilationPolicy
)
top
->
print
();
CompileBroker
::
compile_method
(
top
->
top_method
(),
InvocationEntryBci
,
CompLevel_highest_tier
,
CompileBroker
::
compile_method
(
top
->
top_method
(),
InvocationEntryBci
,
comp_level
,
m
,
hot_count
,
comment
,
thread
);
m
,
hot_count
,
comment
,
thread
);
}
}
}
}
}
}
void
StackWalkCompPolicy
::
method_back_branch_event
(
methodHandle
m
,
int
bci
,
JavaThread
*
thread
)
{
void
StackWalkCompPolicy
::
method_back_branch_event
(
methodHandle
m
,
int
bci
,
JavaThread
*
thread
)
{
int
hot_count
=
m
->
backedge_count
();
const
int
comp_level
=
CompLevel_highest_tier
;
const
int
hot_count
=
m
->
backedge_count
();
const
char
*
comment
=
"backedge_count"
;
const
char
*
comment
=
"backedge_count"
;
if
(
is_compilation_enabled
()
&&
!
m
->
is_not_osr_compilable
()
&&
can_be_compiled
(
m
))
{
if
(
is_compilation_enabled
()
&&
!
m
->
is_not_osr_compilable
(
comp_level
)
&&
can_be_compiled
(
m
))
{
CompileBroker
::
compile_method
(
m
,
bci
,
CompLevel_highest_tier
,
m
,
hot_count
,
comment
,
thread
);
CompileBroker
::
compile_method
(
m
,
bci
,
comp_level
,
m
,
hot_count
,
comment
,
thread
);
NOT_PRODUCT
(
trace_osr_completion
(
m
->
lookup_osr_nmethod_for
(
bci
,
comp_level
,
true
));)
NOT_PRODUCT
(
trace_osr_completion
(
m
->
lookup_osr_nmethod_for
(
bci
,
CompLevel_highest_tier
,
true
));)
}
}
}
}
...
...
src/share/vm/runtime/simpleThresholdPolicy.cpp
浏览文件 @
8de4f80b
...
@@ -43,11 +43,11 @@ void SimpleThresholdPolicy::print_counters(const char* prefix, methodHandle mh)
...
@@ -43,11 +43,11 @@ void SimpleThresholdPolicy::print_counters(const char* prefix, methodHandle mh)
mdo_invocations_start
=
mdh
->
invocation_count_start
();
mdo_invocations_start
=
mdh
->
invocation_count_start
();
mdo_backedges_start
=
mdh
->
backedge_count_start
();
mdo_backedges_start
=
mdh
->
backedge_count_start
();
}
}
tty
->
print
(
" %stotal
: %d,%d %smdo:
%d(%d),%d(%d)"
,
prefix
,
tty
->
print
(
" %stotal
=%d,%d %smdo=
%d(%d),%d(%d)"
,
prefix
,
invocation_count
,
backedge_count
,
prefix
,
invocation_count
,
backedge_count
,
prefix
,
mdo_invocations
,
mdo_invocations_start
,
mdo_invocations
,
mdo_invocations_start
,
mdo_backedges
,
mdo_backedges_start
);
mdo_backedges
,
mdo_backedges_start
);
tty
->
print
(
" %smax levels
:
%d,%d"
,
prefix
,
tty
->
print
(
" %smax levels
=
%d,%d"
,
prefix
,
mh
->
highest_comp_level
(),
mh
->
highest_osr_comp_level
());
mh
->
highest_comp_level
(),
mh
->
highest_osr_comp_level
());
}
}
...
@@ -85,7 +85,7 @@ void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodH
...
@@ -85,7 +85,7 @@ void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodH
tty
->
print
(
"unknown"
);
tty
->
print
(
"unknown"
);
}
}
tty
->
print
(
" level
:
%d "
,
level
);
tty
->
print
(
" level
=
%d "
,
level
);
ResourceMark
rm
;
ResourceMark
rm
;
char
*
method_name
=
mh
->
name_and_sig_as_C_string
();
char
*
method_name
=
mh
->
name_and_sig_as_C_string
();
...
@@ -95,7 +95,7 @@ void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodH
...
@@ -95,7 +95,7 @@ void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodH
tty
->
print
(
" [%s]] "
,
inlinee_name
);
tty
->
print
(
" [%s]] "
,
inlinee_name
);
}
}
else
tty
->
print
(
"] "
);
else
tty
->
print
(
"] "
);
tty
->
print
(
"@%d queues
:
%d,%d"
,
bci
,
CompileBroker
::
queue_size
(
CompLevel_full_profile
),
tty
->
print
(
"@%d queues
=
%d,%d"
,
bci
,
CompileBroker
::
queue_size
(
CompLevel_full_profile
),
CompileBroker
::
queue_size
(
CompLevel_full_optimization
));
CompileBroker
::
queue_size
(
CompLevel_full_optimization
));
print_specific
(
type
,
mh
,
imh
,
bci
,
level
);
print_specific
(
type
,
mh
,
imh
,
bci
,
level
);
...
@@ -105,25 +105,30 @@ void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodH
...
@@ -105,25 +105,30 @@ void SimpleThresholdPolicy::print_event(EventType type, methodHandle mh, methodH
if
(
inlinee_event
)
{
if
(
inlinee_event
)
{
print_counters
(
"inlinee "
,
imh
);
print_counters
(
"inlinee "
,
imh
);
}
}
tty
->
print
(
" compilable
:
"
);
tty
->
print
(
" compilable
=
"
);
bool
need_comma
=
false
;
bool
need_comma
=
false
;
if
(
!
mh
->
is_not_compilable
(
CompLevel_full_profile
))
{
if
(
!
mh
->
is_not_compilable
(
CompLevel_full_profile
))
{
tty
->
print
(
"c1"
);
tty
->
print
(
"c1"
);
need_comma
=
true
;
need_comma
=
true
;
}
}
if
(
!
mh
->
is_not_osr_compilable
(
CompLevel_full_profile
))
{
if
(
need_comma
)
tty
->
print
(
","
);
tty
->
print
(
"c1-osr"
);
need_comma
=
true
;
}
if
(
!
mh
->
is_not_compilable
(
CompLevel_full_optimization
))
{
if
(
!
mh
->
is_not_compilable
(
CompLevel_full_optimization
))
{
if
(
need_comma
)
tty
->
print
(
",
"
);
if
(
need_comma
)
tty
->
print
(
","
);
tty
->
print
(
"c2"
);
tty
->
print
(
"c2"
);
need_comma
=
true
;
need_comma
=
true
;
}
}
if
(
!
mh
->
is_not_osr_compilable
())
{
if
(
!
mh
->
is_not_osr_compilable
(
CompLevel_full_optimization
))
{
if
(
need_comma
)
tty
->
print
(
",
"
);
if
(
need_comma
)
tty
->
print
(
","
);
tty
->
print
(
"osr"
);
tty
->
print
(
"
c2-
osr"
);
}
}
tty
->
print
(
" status
:
"
);
tty
->
print
(
" status
=
"
);
if
(
mh
->
queued_for_compilation
())
{
if
(
mh
->
queued_for_compilation
())
{
tty
->
print
(
"
in
queue"
);
tty
->
print
(
"
in-
queue"
);
}
else
tty
->
print
(
"
idle"
);
}
else
tty
->
print
(
"idle"
);
}
}
tty
->
print_cr
(
"]"
);
tty
->
print_cr
(
"]"
);
}
}
...
@@ -223,7 +228,7 @@ void SimpleThresholdPolicy::compile(methodHandle mh, int bci, CompLevel level, J
...
@@ -223,7 +228,7 @@ void SimpleThresholdPolicy::compile(methodHandle mh, int bci, CompLevel level, J
}
}
return
;
return
;
}
}
if
(
bci
!=
InvocationEntryBci
&&
mh
->
is_not_osr_compilable
())
{
if
(
bci
!=
InvocationEntryBci
&&
mh
->
is_not_osr_compilable
(
level
))
{
return
;
return
;
}
}
if
(
!
CompileBroker
::
compilation_is_in_queue
(
mh
,
bci
))
{
if
(
!
CompileBroker
::
compilation_is_in_queue
(
mh
,
bci
))
{
...
...
src/share/vm/runtime/vmStructs.cpp
浏览文件 @
8de4f80b
...
@@ -2182,7 +2182,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
...
@@ -2182,7 +2182,7 @@ typedef TwoOopHashtable<Symbol*, mtClass> SymbolTwoOopHashtable;
declare_constant(JVM_ACC_HAS_LOOPS) \
declare_constant(JVM_ACC_HAS_LOOPS) \
declare_constant(JVM_ACC_LOOPS_FLAG_INIT) \
declare_constant(JVM_ACC_LOOPS_FLAG_INIT) \
declare_constant(JVM_ACC_QUEUED) \
declare_constant(JVM_ACC_QUEUED) \
declare_constant(JVM_ACC_NOT_
OSR_COMPILABLE)
\
declare_constant(JVM_ACC_NOT_
C2_OSR_COMPILABLE)
\
declare_constant(JVM_ACC_HAS_LINE_NUMBER_TABLE) \
declare_constant(JVM_ACC_HAS_LINE_NUMBER_TABLE) \
declare_constant(JVM_ACC_HAS_CHECKED_EXCEPTIONS) \
declare_constant(JVM_ACC_HAS_CHECKED_EXCEPTIONS) \
declare_constant(JVM_ACC_HAS_JSRS) \
declare_constant(JVM_ACC_HAS_JSRS) \
...
...
src/share/vm/utilities/accessFlags.hpp
浏览文件 @
8de4f80b
...
@@ -47,7 +47,7 @@ enum {
...
@@ -47,7 +47,7 @@ enum {
JVM_ACC_QUEUED
=
0x01000000
,
// Queued for compilation
JVM_ACC_QUEUED
=
0x01000000
,
// Queued for compilation
JVM_ACC_NOT_C2_COMPILABLE
=
0x02000000
,
JVM_ACC_NOT_C2_COMPILABLE
=
0x02000000
,
JVM_ACC_NOT_C1_COMPILABLE
=
0x04000000
,
JVM_ACC_NOT_C1_COMPILABLE
=
0x04000000
,
JVM_ACC_NOT_
OSR_COMPILABLE
=
0x08000000
,
JVM_ACC_NOT_
C2_OSR_COMPILABLE
=
0x08000000
,
JVM_ACC_HAS_LINE_NUMBER_TABLE
=
0x00100000
,
JVM_ACC_HAS_LINE_NUMBER_TABLE
=
0x00100000
,
JVM_ACC_HAS_CHECKED_EXCEPTIONS
=
0x00400000
,
JVM_ACC_HAS_CHECKED_EXCEPTIONS
=
0x00400000
,
JVM_ACC_HAS_JSRS
=
0x00800000
,
JVM_ACC_HAS_JSRS
=
0x00800000
,
...
@@ -123,7 +123,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC {
...
@@ -123,7 +123,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC {
bool
queued_for_compilation
()
const
{
return
(
_flags
&
JVM_ACC_QUEUED
)
!=
0
;
}
bool
queued_for_compilation
()
const
{
return
(
_flags
&
JVM_ACC_QUEUED
)
!=
0
;
}
bool
is_not_c1_compilable
()
const
{
return
(
_flags
&
JVM_ACC_NOT_C1_COMPILABLE
)
!=
0
;
}
bool
is_not_c1_compilable
()
const
{
return
(
_flags
&
JVM_ACC_NOT_C1_COMPILABLE
)
!=
0
;
}
bool
is_not_c2_compilable
()
const
{
return
(
_flags
&
JVM_ACC_NOT_C2_COMPILABLE
)
!=
0
;
}
bool
is_not_c2_compilable
()
const
{
return
(
_flags
&
JVM_ACC_NOT_C2_COMPILABLE
)
!=
0
;
}
bool
is_not_
osr_compilable
()
const
{
return
(
_flags
&
JVM_ACC_NOT_OSR_COMPILABLE
)
!=
0
;
}
bool
is_not_
c2_osr_compilable
()
const
{
return
(
_flags
&
JVM_ACC_NOT_C2_OSR_COMPILABLE
)
!=
0
;
}
bool
has_linenumber_table
()
const
{
return
(
_flags
&
JVM_ACC_HAS_LINE_NUMBER_TABLE
)
!=
0
;
}
bool
has_linenumber_table
()
const
{
return
(
_flags
&
JVM_ACC_HAS_LINE_NUMBER_TABLE
)
!=
0
;
}
bool
has_checked_exceptions
()
const
{
return
(
_flags
&
JVM_ACC_HAS_CHECKED_EXCEPTIONS
)
!=
0
;
}
bool
has_checked_exceptions
()
const
{
return
(
_flags
&
JVM_ACC_HAS_CHECKED_EXCEPTIONS
)
!=
0
;
}
bool
has_jsrs
()
const
{
return
(
_flags
&
JVM_ACC_HAS_JSRS
)
!=
0
;
}
bool
has_jsrs
()
const
{
return
(
_flags
&
JVM_ACC_HAS_JSRS
)
!=
0
;
}
...
@@ -186,7 +186,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC {
...
@@ -186,7 +186,7 @@ class AccessFlags VALUE_OBJ_CLASS_SPEC {
void
set_loops_flag_init
()
{
atomic_set_bits
(
JVM_ACC_LOOPS_FLAG_INIT
);
}
void
set_loops_flag_init
()
{
atomic_set_bits
(
JVM_ACC_LOOPS_FLAG_INIT
);
}
void
set_not_c1_compilable
()
{
atomic_set_bits
(
JVM_ACC_NOT_C1_COMPILABLE
);
}
void
set_not_c1_compilable
()
{
atomic_set_bits
(
JVM_ACC_NOT_C1_COMPILABLE
);
}
void
set_not_c2_compilable
()
{
atomic_set_bits
(
JVM_ACC_NOT_C2_COMPILABLE
);
}
void
set_not_c2_compilable
()
{
atomic_set_bits
(
JVM_ACC_NOT_C2_COMPILABLE
);
}
void
set_not_
osr_compilable
()
{
atomic_set_bits
(
JVM_ACC_NOT_OSR_COMPILABLE
);
}
void
set_not_
c2_osr_compilable
()
{
atomic_set_bits
(
JVM_ACC_NOT_C2_OSR_COMPILABLE
);
}
void
set_has_linenumber_table
()
{
atomic_set_bits
(
JVM_ACC_HAS_LINE_NUMBER_TABLE
);
}
void
set_has_linenumber_table
()
{
atomic_set_bits
(
JVM_ACC_HAS_LINE_NUMBER_TABLE
);
}
void
set_has_checked_exceptions
()
{
atomic_set_bits
(
JVM_ACC_HAS_CHECKED_EXCEPTIONS
);
}
void
set_has_checked_exceptions
()
{
atomic_set_bits
(
JVM_ACC_HAS_CHECKED_EXCEPTIONS
);
}
void
set_has_jsrs
()
{
atomic_set_bits
(
JVM_ACC_HAS_JSRS
);
}
void
set_has_jsrs
()
{
atomic_set_bits
(
JVM_ACC_HAS_JSRS
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录