Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
cc79ea3e
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看板
提交
cc79ea3e
编写于
1月 28, 2014
作者:
N
neliasso
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8007270: Make IsMethodCompilable test work with tiered
Summary: Only c2 compiles counts toward cutoff Reviewed-by: kvn, roland
上级
c528227d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
69 addition
and
27 deletion
+69
-27
test/compiler/whitebox/CompilerWhiteBoxTest.java
test/compiler/whitebox/CompilerWhiteBoxTest.java
+23
-0
test/compiler/whitebox/IsMethodCompilableTest.java
test/compiler/whitebox/IsMethodCompilableTest.java
+37
-27
test/testlibrary/com/oracle/java/testlibrary/Platform.java
test/testlibrary/com/oracle/java/testlibrary/Platform.java
+9
-0
未找到文件。
test/compiler/whitebox/CompilerWhiteBoxTest.java
浏览文件 @
cc79ea3e
...
...
@@ -196,6 +196,29 @@ public abstract class CompilerWhiteBoxTest {
printInfo
();
}
/**
* Checks, that {@linkplain #method} is not compiled at the given compilation
* level or above.
*
* @param compLevel
*
* @throws RuntimeException if {@linkplain #method} is in compiler queue or
* is compiled, or if {@linkplain #method} has zero
* compilation level.
*/
protected
final
void
checkNotCompiled
(
int
compLevel
)
{
if
(
WHITE_BOX
.
isMethodQueuedForCompilation
(
method
))
{
throw
new
RuntimeException
(
method
+
" must not be in queue"
);
}
if
(
WHITE_BOX
.
getMethodCompilationLevel
(
method
,
false
)
>=
compLevel
)
{
throw
new
RuntimeException
(
method
+
" comp_level must be >= maxCompLevel"
);
}
if
(
WHITE_BOX
.
getMethodCompilationLevel
(
method
,
true
)
>=
compLevel
)
{
throw
new
RuntimeException
(
method
+
" osr_comp_level must be >= maxCompLevel"
);
}
}
/**
* Checks, that {@linkplain #method} is not compiled.
*
...
...
test/compiler/whitebox/IsMethodCompilableTest.java
浏览文件 @
cc79ea3e
...
...
@@ -24,13 +24,17 @@
/*
* @test IsMethodCompilableTest
* @bug 8007270 8006683 8007288 8022832
* @library /testlibrary /testlibrary/whitebox
* @library /testlibrary /testlibrary/whitebox
/testlibrary/com/oracle/java/testlibrary
* @build IsMethodCompilableTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* IsMethodCompilableTest
* @run main ClassFileInstaller com.oracle.java.testlibrary.Platform
* @run main/othervm/timeout=2400 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:PerMethodRecompilationCutoff=3 -XX:CompileCommand=compileonly,SimpleTestCase$Helper::* IsMethodCompilableTest
* @summary testing of WB::isMethodCompilable()
* @author igor.ignatyev@oracle.com
*/
import
com.oracle.java.testlibrary.Platform
;
public
class
IsMethodCompilableTest
extends
CompilerWhiteBoxTest
{
/**
* Value of {@code -XX:PerMethodRecompilationCutoff}
...
...
@@ -43,7 +47,7 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest {
if
(
tmp
==
-
1
)
{
PER_METHOD_RECOMPILATION_CUTOFF
=
-
1
/* Inf */
;
}
else
{
PER_METHOD_RECOMPILATION_CUTOFF
=
1
+
(
0xFFFFFFFF
L
&
tmp
);
PER_METHOD_RECOMPILATION_CUTOFF
=
(
0xFFFFFFFF
L
&
tmp
);
}
}
...
...
@@ -60,16 +64,22 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest {
/**
* Tests {@code WB::isMethodCompilable()} by recompilation of tested method
* 'PerMethodRecompilationCutoff' times and checks compilation status. Also
* checks that WB::clearMethodState() clears no-compilable flags.
* checks that WB::clearMethodState() clears no-compilable flags. Only
* applicable to c2 compiled methods.
*
* @throws Exception if one of the checks fails.
*/
@Override
protected
void
test
()
throws
Exception
{
// Only c2 compilations can be disabled through PerMethodRecompilationCutoff
if
(!
Platform
.
isServer
())
{
return
;
}
if
(
skipXcompOSR
())
{
return
;
}
if
(!
isCompilable
())
{
if
(!
isCompilable
(
COMP_LEVEL_FULL_OPTIMIZATION
))
{
throw
new
RuntimeException
(
method
+
" must be compilable"
);
}
System
.
out
.
println
(
"PerMethodRecompilationCutoff = "
...
...
@@ -80,39 +90,37 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest {
return
;
}
// deoptimize 'PerMethodRecompilationCutoff' times
and clear state
for
(
long
i
=
0L
,
n
=
PER_METHOD_RECOMPILATION_CUTOFF
-
1
;
i
<
n
;
++
i
)
{
compileAndDeoptimize
();
}
if
(!
testCase
.
isOsr
()
&&
!
isCompilable
()
)
{
// in osr test case count of deopt maybe more than iterations
throw
new
RuntimeException
(
method
+
" is not compilable after "
+
(
PER_METHOD_RECOMPILATION_CUTOFF
-
1
)
+
" iterations"
);
// deoptimize 'PerMethodRecompilationCutoff' times
for
(
long
attempts
=
0
,
successes
=
0
;
(
successes
<
PER_METHOD_RECOMPILATION_CUTOFF
)
&&
(
attempts
<
PER_METHOD_RECOMPILATION_CUTOFF
*
2
)
&&
isCompilable
(
COMP_LEVEL_FULL_OPTIMIZATION
);
attempts
++
)
{
if
(
compileAndDeoptimize
()
==
COMP_LEVEL_FULL_OPTIMIZATION
)
{
successes
++;
}
}
WHITE_BOX
.
clearMethodState
(
method
);
// deoptimize 'PerMethodRecompilationCutoff' + 1 times
long
i
;
for
(
i
=
0L
;
i
<
PER_METHOD_RECOMPILATION_CUTOFF
&&
isCompilable
();
++
i
)
{
compileAndDeoptimize
();
}
if
(!
testCase
.
isOsr
()
&&
i
!=
PER_METHOD_RECOMPILATION_CUTOFF
)
{
if
(!
testCase
.
isOsr
()
&&
!
isCompilable
(
COMP_LEVEL_FULL_OPTIMIZATION
))
{
// in osr test case count of deopt maybe more than iterations
throw
new
RuntimeException
(
method
+
" is not compilable after "
+
i
+
" iterations, but must only after "
+
PER_METHOD_RECOMPILATION_CUTOFF
);
+
PER_METHOD_RECOMPILATION_CUTOFF
+
" iterations"
);
}
if
(
isCompilable
())
{
// Now compile once more
compileAndDeoptimize
();
if
(
isCompilable
(
COMP_LEVEL_FULL_OPTIMIZATION
))
{
throw
new
RuntimeException
(
method
+
" is still compilable after "
+
PER_METHOD_RECOMPILATION_CUTOFF
+
" iterations"
);
}
compile
();
checkNotCompiled
();
compile
();
waitBackgroundCompilation
();
checkNotCompiled
(
COMP_LEVEL_FULL_OPTIMIZATION
);
// WB.clearMethodState() must reset no-compilable flags
WHITE_BOX
.
clearMethodState
(
method
);
if
(!
isCompilable
())
{
if
(!
isCompilable
(
COMP_LEVEL_FULL_OPTIMIZATION
))
{
throw
new
RuntimeException
(
method
+
" is not compilable after clearMethodState()"
);
}
...
...
@@ -120,9 +128,11 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest {
checkCompiled
();
}
private
void
compileAndDeoptimize
()
throws
Exception
{
private
int
compileAndDeoptimize
()
throws
Exception
{
compile
();
waitBackgroundCompilation
();
int
compLevel
=
getCompLevel
();
deoptimize
();
return
compLevel
;
}
}
test/testlibrary/com/oracle/java/testlibrary/Platform.java
浏览文件 @
cc79ea3e
...
...
@@ -28,6 +28,15 @@ public class Platform {
private
static
final
String
dataModel
=
System
.
getProperty
(
"sun.arch.data.model"
);
private
static
final
String
vmVersion
=
System
.
getProperty
(
"java.vm.version"
);
private
static
final
String
osArch
=
System
.
getProperty
(
"os.arch"
);
private
static
final
String
vmName
=
System
.
getProperty
(
"java.vm.name"
);
public
static
boolean
isClient
()
{
return
vmName
.
endsWith
(
" Client VM"
);
}
public
static
boolean
isServer
()
{
return
vmName
.
endsWith
(
" Server VM"
);
}
public
static
boolean
is32bit
()
{
return
dataModel
.
equals
(
"32"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录