Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
40d1bc75
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看板
提交
40d1bc75
编写于
11月 23, 2016
作者:
S
shshahma
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8162101: C2: Handle "wide" aliases for unsafe accesses
Reviewed-by: kvn, thartmann
上级
fe3bf367
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
60 addition
and
10 deletion
+60
-10
src/share/vm/opto/library_call.cpp
src/share/vm/opto/library_call.cpp
+11
-8
src/share/vm/opto/type.hpp
src/share/vm/opto/type.hpp
+2
-2
test/compiler/unsafe/OpaqueAccesses.java
test/compiler/unsafe/OpaqueAccesses.java
+47
-0
未找到文件。
src/share/vm/opto/library_call.cpp
浏览文件 @
40d1bc75
...
...
@@ -2630,23 +2630,24 @@ bool LibraryCallKit::inline_unsafe_access(bool is_native_ptr, bool is_store, Bas
val
=
is_store
?
argument
(
3
)
:
NULL
;
}
// Can base be NULL? Otherwise, always on-heap access.
bool
can_access_non_heap
=
TypePtr
::
NULL_PTR
->
higher_equal
(
_gvn
.
type
(
heap_base_oop
));
const
TypePtr
*
adr_type
=
_gvn
.
type
(
adr
)
->
isa_ptr
();
// Try to categorize the address. If it comes up as TypeJavaPtr::BOTTOM,
// there was not enough information to nail it down.
// Try to categorize the address.
Compile
::
AliasType
*
alias_type
=
C
->
alias_type
(
adr_type
);
assert
(
alias_type
->
index
()
!=
Compile
::
AliasIdxBot
,
"no bare pointers here"
);
// Only field, array element or unknown locations are supported.
if
(
alias_type
->
adr_type
()
!=
TypeRawPtr
::
BOTTOM
&&
alias_type
->
adr_type
()
!=
TypeOopPtr
::
BOTTOM
&&
alias_type
->
basic_type
()
==
T_ILLEGAL
)
{
return
false
;
if
(
alias_type
->
adr_type
()
==
TypeInstPtr
::
KLASS
||
alias_type
->
adr_type
()
==
TypeAryPtr
::
RANGE
)
{
return
false
;
// not supported
}
bool
mismatched
=
false
;
BasicType
bt
=
alias_type
->
basic_type
();
if
(
bt
!=
T_ILLEGAL
)
{
assert
(
alias_type
->
adr_type
()
->
is_oopptr
(),
"should be on-heap access"
);
if
(
bt
==
T_BYTE
&&
adr_type
->
isa_aryptr
())
{
// Alias type doesn't differentiate between byte[] and boolean[]).
// Use address type to get the element type.
...
...
@@ -2663,6 +2664,8 @@ bool LibraryCallKit::inline_unsafe_access(bool is_native_ptr, bool is_store, Bas
mismatched
=
(
bt
!=
type
);
}
assert
(
!
mismatched
||
alias_type
->
adr_type
()
->
is_oopptr
(),
"off-heap access can't be mismatched"
);
// First guess at the value type.
const
Type
*
value_type
=
Type
::
get_const_basic_type
(
type
);
...
...
@@ -2777,7 +2780,7 @@ bool LibraryCallKit::inline_unsafe_access(bool is_native_ptr, bool is_store, Bas
(
void
)
store_to_memory
(
control
(),
adr
,
val
,
type
,
adr_type
,
mo
,
is_volatile
,
unaligned
,
mismatched
);
}
else
{
// Possibly an oop being stored to Java heap or native memory
if
(
!
TypePtr
::
NULL_PTR
->
higher_equal
(
_gvn
.
type
(
heap_base_oop
))
)
{
if
(
!
can_access_non_heap
)
{
// oop to Java heap.
(
void
)
store_oop_to_unknown
(
control
(),
heap_base_oop
,
adr
,
adr_type
,
val
,
type
,
mo
,
mismatched
);
}
else
{
...
...
src/share/vm/opto/type.hpp
浏览文件 @
40d1bc75
...
...
@@ -209,11 +209,11 @@ public:
static
int
cmp
(
const
Type
*
const
t1
,
const
Type
*
const
t2
);
// Test for higher or equal in lattice
// Variant that drops the speculative part of the types
int
higher_equal
(
const
Type
*
t
)
const
{
bool
higher_equal
(
const
Type
*
t
)
const
{
return
!
cmp
(
meet
(
t
),
t
->
remove_speculative
());
}
// Variant that keeps the speculative part of the types
int
higher_equal_speculative
(
const
Type
*
t
)
const
{
bool
higher_equal_speculative
(
const
Type
*
t
)
const
{
return
!
cmp
(
meet_speculative
(
t
),
t
);
}
...
...
test/compiler/unsafe/OpaqueAccesses.java
浏览文件 @
40d1bc75
...
...
@@ -30,6 +30,22 @@
*
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
* -XX:-TieredCompilation -Xbatch
* -XX:+UseCompressedOops -XX:+UseCompressedClassPointers
* -XX:CompileCommand=dontinline,compiler.unsafe.OpaqueAccesses::test*
* compiler.unsafe.OpaqueAccesses
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
* -XX:-TieredCompilation -Xbatch
* -XX:+UseCompressedOops -XX:-UseCompressedClassPointers
* -XX:CompileCommand=dontinline,compiler.unsafe.OpaqueAccesses::test*
* compiler.unsafe.OpaqueAccesses
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
* -XX:-TieredCompilation -Xbatch
* -XX:-UseCompressedOops -XX:+UseCompressedClassPointers
* -XX:CompileCommand=dontinline,compiler.unsafe.OpaqueAccesses::test*
* compiler.unsafe.OpaqueAccesses
* @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockDiagnosticVMOptions
* -XX:-TieredCompilation -Xbatch
* -XX:-UseCompressedOops -XX:-UseCompressedClassPointers
* -XX:CompileCommand=dontinline,compiler.unsafe.OpaqueAccesses::test*
* compiler.unsafe.OpaqueAccesses
*/
...
...
@@ -61,6 +77,7 @@ public class OpaqueAccesses {
}
private
Object
f
=
new
Object
();
private
long
l1
,
l2
;
static
Object
testFixedOffsetField
(
Object
o
)
{
return
UNSAFE
.
getObject
(
o
,
F_OFFSET
);
...
...
@@ -74,6 +91,18 @@ public class OpaqueAccesses {
return
UNSAFE
.
getInt
(
o
,
4
);
}
static
int
testFixedOffsetHeader8
(
Object
o
)
{
return
UNSAFE
.
getInt
(
o
,
8
);
}
static
int
testFixedOffsetHeader12
(
Object
o
)
{
return
UNSAFE
.
getInt
(
o
,
12
);
}
static
int
testFixedOffsetHeader16
(
Object
o
)
{
return
UNSAFE
.
getInt
(
o
,
16
);
}
static
Object
testFixedBase
(
long
off
)
{
return
UNSAFE
.
getObject
(
INSTANCE
,
off
);
}
...
...
@@ -90,6 +119,18 @@ public class OpaqueAccesses {
return
UNSAFE
.
getInt
(
arr
,
4
);
}
static
int
testFixedOffsetHeaderArray8
(
Object
[]
arr
)
{
return
UNSAFE
.
getInt
(
arr
,
8
);
}
static
int
testFixedOffsetHeaderArray12
(
Object
[]
arr
)
{
return
UNSAFE
.
getInt
(
arr
,
12
);
}
static
int
testFixedOffsetHeaderArray16
(
Object
[]
arr
)
{
return
UNSAFE
.
getInt
(
arr
,
16
);
}
static
Object
testFixedOffsetArray
(
Object
[]
arr
)
{
return
UNSAFE
.
getObject
(
arr
,
E_OFFSET
);
}
...
...
@@ -118,6 +159,9 @@ public class OpaqueAccesses {
testFixedOffsetField
(
INSTANCE
);
testFixedOffsetHeader0
(
INSTANCE
);
testFixedOffsetHeader4
(
INSTANCE
);
testFixedOffsetHeader8
(
INSTANCE
);
testFixedOffsetHeader12
(
INSTANCE
);
testFixedOffsetHeader16
(
INSTANCE
);
testFixedBase
(
F_OFFSET
);
testOpaque
(
INSTANCE
,
F_OFFSET
);
testMixedAccess
();
...
...
@@ -125,6 +169,9 @@ public class OpaqueAccesses {
// Array
testFixedOffsetHeaderArray0
(
ARRAY
);
testFixedOffsetHeaderArray4
(
ARRAY
);
testFixedOffsetHeaderArray8
(
ARRAY
);
testFixedOffsetHeaderArray12
(
ARRAY
);
testFixedOffsetHeaderArray16
(
ARRAY
);
testFixedOffsetArray
(
ARRAY
);
testFixedBaseArray
(
E_OFFSET
);
testOpaqueArray
(
ARRAY
,
E_OFFSET
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录