Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
e7d1d2ad
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看板
提交
e7d1d2ad
编写于
6月 24, 2009
作者:
T
twisti
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
2c5b5f6e
692158bb
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
147 addition
and
9 deletion
+147
-9
src/share/vm/opto/type.cpp
src/share/vm/opto/type.cpp
+40
-9
src/share/vm/opto/type.hpp
src/share/vm/opto/type.hpp
+13
-0
test/compiler/6837094/Test.java
test/compiler/6837094/Test.java
+94
-0
未找到文件。
src/share/vm/opto/type.cpp
浏览文件 @
e7d1d2ad
...
...
@@ -487,6 +487,23 @@ bool Type::is_nan() const {
return
false
;
}
//----------------------interface_vs_oop---------------------------------------
#ifdef ASSERT
bool
Type
::
interface_vs_oop
(
const
Type
*
t
)
const
{
bool
result
=
false
;
const
TypeInstPtr
*
this_inst
=
this
->
isa_instptr
();
const
TypeInstPtr
*
t_inst
=
t
->
isa_instptr
();
if
(
this_inst
&&
this_inst
->
is_loaded
()
&&
t_inst
&&
t_inst
->
is_loaded
()
)
{
bool
this_interface
=
this_inst
->
klass
()
->
is_interface
();
bool
t_interface
=
t_inst
->
klass
()
->
is_interface
();
result
=
this_interface
^
t_interface
;
}
return
result
;
}
#endif
//------------------------------meet-------------------------------------------
// Compute the MEET of two types. NOT virtual. It enforces that meet is
// commutative and the lattice is symmetric.
...
...
@@ -507,16 +524,8 @@ const Type *Type::meet( const Type *t ) const {
// Interface meet Oop is Not Symmetric:
// Interface:AnyNull meet Oop:AnyNull == Interface:AnyNull
// Interface:NotNull meet Oop:NotNull == java/lang/Object:NotNull
const
TypeInstPtr
*
this_inst
=
this
->
isa_instptr
();
const
TypeInstPtr
*
t_inst
=
t
->
isa_instptr
();
bool
interface_vs_oop
=
false
;
if
(
this_inst
&&
this_inst
->
is_loaded
()
&&
t_inst
&&
t_inst
->
is_loaded
()
)
{
bool
this_interface
=
this_inst
->
klass
()
->
is_interface
();
bool
t_interface
=
t_inst
->
klass
()
->
is_interface
();
interface_vs_oop
=
this_interface
^
t_interface
;
}
if
(
!
interface_vs_oop
&&
(
t2t
!=
t
->
_dual
||
t2this
!=
_dual
)
)
{
if
(
!
interface_vs_oop
(
t
)
&&
(
t2t
!=
t
->
_dual
||
t2this
!=
_dual
)
)
{
tty
->
print_cr
(
"=== Meet Not Symmetric ==="
);
tty
->
print
(
"t = "
);
t
->
dump
();
tty
->
cr
();
tty
->
print
(
"this= "
);
dump
();
tty
->
cr
();
...
...
@@ -1800,6 +1809,17 @@ int TypeAry::hash(void) const {
return
(
intptr_t
)
_elem
+
(
intptr_t
)
_size
;
}
//----------------------interface_vs_oop---------------------------------------
#ifdef ASSERT
bool
TypeAry
::
interface_vs_oop
(
const
Type
*
t
)
const
{
const
TypeAry
*
t_ary
=
t
->
is_ary
();
if
(
t_ary
)
{
return
_elem
->
interface_vs_oop
(
t_ary
->
_elem
);
}
return
false
;
}
#endif
//------------------------------dump2------------------------------------------
#ifndef PRODUCT
void
TypeAry
::
dump2
(
Dict
&
d
,
uint
depth
,
outputStream
*
st
)
const
{
...
...
@@ -3389,6 +3409,17 @@ const Type *TypeAryPtr::xdual() const {
return
new
TypeAryPtr
(
dual_ptr
(),
_const_oop
,
_ary
->
dual
()
->
is_ary
(),
_klass
,
_klass_is_exact
,
dual_offset
(),
dual_instance_id
()
);
}
//----------------------interface_vs_oop---------------------------------------
#ifdef ASSERT
bool
TypeAryPtr
::
interface_vs_oop
(
const
Type
*
t
)
const
{
const
TypeAryPtr
*
t_aryptr
=
t
->
isa_aryptr
();
if
(
t_aryptr
)
{
return
_ary
->
interface_vs_oop
(
t_aryptr
->
_ary
);
}
return
false
;
}
#endif
//------------------------------dump2------------------------------------------
#ifndef PRODUCT
void
TypeAryPtr
::
dump2
(
Dict
&
d
,
uint
depth
,
outputStream
*
st
)
const
{
...
...
src/share/vm/opto/type.hpp
浏览文件 @
e7d1d2ad
...
...
@@ -190,6 +190,11 @@ public:
// Currently, it also works around limitations involving interface types.
virtual
const
Type
*
filter
(
const
Type
*
kills
)
const
;
#ifdef ASSERT
// One type is interface, the other is oop
virtual
bool
interface_vs_oop
(
const
Type
*
t
)
const
;
#endif
// Returns true if this pointer points at memory which contains a
// compressed oop references.
bool
is_ptr_to_narrowoop
()
const
;
...
...
@@ -546,6 +551,10 @@ public:
virtual
const
Type
*
xmeet
(
const
Type
*
t
)
const
;
virtual
const
Type
*
xdual
()
const
;
// Compute dual right now.
bool
ary_must_be_exact
()
const
;
// true if arrays of such are never generic
#ifdef ASSERT
// One type is interface, the other is oop
virtual
bool
interface_vs_oop
(
const
Type
*
t
)
const
;
#endif
#ifndef PRODUCT
virtual
void
dump2
(
Dict
&
d
,
uint
,
outputStream
*
st
)
const
;
// Specialized per-Type dumping
#endif
...
...
@@ -867,6 +876,10 @@ public:
}
static
const
TypeAryPtr
*
_array_body_type
[
T_CONFLICT
+
1
];
// sharpen the type of an int which is used as an array size
#ifdef ASSERT
// One type is interface, the other is oop
virtual
bool
interface_vs_oop
(
const
Type
*
t
)
const
;
#endif
#ifndef PRODUCT
virtual
void
dump2
(
Dict
&
d
,
uint
depth
,
outputStream
*
st
)
const
;
// Specialized per-Type dumping
#endif
...
...
test/compiler/6837094/Test.java
0 → 100644
浏览文件 @
e7d1d2ad
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
/**
* @test
* @bug 6837094
* @summary False positive for "meet not symmetric" failure
*
* @run main/othervm -Xbatch -XX:CompileOnly=Test.collectIs,Test$Factory$1.getArray,Test$Factory$2.getArray Test
*/
import
java.util.Set
;
import
java.util.HashSet
;
public
class
Test
{
private
interface
Factory
<
M
extends
Interface
>
{
Factory
<
Child0
>
Zero
=
new
Factory
<
Child0
>()
{
public
Child0
[]
getArray
()
{
return
new
Child0
[
1
];
}
};
Factory
<
Child1
>
One
=
new
Factory
<
Child1
>()
{
public
Child1
[]
getArray
()
{
return
new
Child1
[
1
];
}
};
M
[]
getArray
();
}
/**
* C2 asserts when compiling this method. Bimorphic inlining happens at
* getArray call site. A Phi in the catch block tries to join the meet type
* from he inline site (Parent[]) with the type expected by CI (Interface[]).
*
* C2 throws an assert when it doesn't need to.
*/
private
static
<
I
extends
Interface
>
void
collectIs
(
Factory
<
I
>
factory
,
Set
<
Interface
>
s
)
{
for
(
I
i
:
factory
.
getArray
())
{
try
{
s
.
add
(
i
);
}
catch
(
Exception
e
)
{
}
}
}
static
public
void
main
(
String
argv
[])
{
Set
<
Interface
>
s
=
new
HashSet
();
for
(
int
i
=
0
;
i
<
25000
;
i
++)
{
collectIs
(
Factory
.
Zero
,
s
);
collectIs
(
Factory
.
One
,
s
);
}
}
}
/**
* Establish necessary class hierarchy
*/
interface
Interface
{
}
class
Parent
{
}
class
Child0
extends
Parent
implements
Interface
{
}
class
Child1
extends
Parent
implements
Interface
{
}
class
Child2
extends
Parent
implements
Interface
{
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录