Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
7e476f9e
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看板
提交
7e476f9e
编写于
12月 03, 2013
作者:
A
acorn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8026066: ICCE for invokeinterface static
Reviewed-by: coleenp, lfoltan, hseigel
上级
4315d18b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
36 addition
and
13 deletion
+36
-13
src/share/vm/interpreter/linkResolver.cpp
src/share/vm/interpreter/linkResolver.cpp
+33
-10
src/share/vm/interpreter/linkResolver.hpp
src/share/vm/interpreter/linkResolver.hpp
+2
-2
test/TEST.groups
test/TEST.groups
+0
-1
test/runtime/8024804/RegisterNatives.java
test/runtime/8024804/RegisterNatives.java
+1
-0
未找到文件。
src/share/vm/interpreter/linkResolver.cpp
浏览文件 @
7e476f9e
...
...
@@ -242,7 +242,7 @@ void LinkResolver::resolve_klass(KlassHandle& result, constantPoolHandle pool, i
// Look up method in klasses, including static methods
// Then look up local default methods
void
LinkResolver
::
lookup_method_in_klasses
(
methodHandle
&
result
,
KlassHandle
klass
,
Symbol
*
name
,
Symbol
*
signature
,
TRAPS
)
{
void
LinkResolver
::
lookup_method_in_klasses
(
methodHandle
&
result
,
KlassHandle
klass
,
Symbol
*
name
,
Symbol
*
signature
,
bool
checkpolymorphism
,
TRAPS
)
{
Method
*
result_oop
=
klass
->
uncached_lookup_method
(
name
,
signature
);
if
(
result_oop
==
NULL
)
{
Array
<
Method
*>*
default_methods
=
InstanceKlass
::
cast
(
klass
())
->
default_methods
();
...
...
@@ -251,7 +251,7 @@ void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle kl
}
}
if
(
EnableInvokeDynamic
&&
result_oop
!=
NULL
)
{
if
(
checkpolymorphism
&&
EnableInvokeDynamic
&&
result_oop
!=
NULL
)
{
vmIntrinsics
::
ID
iid
=
result_oop
->
intrinsic_id
();
if
(
MethodHandles
::
is_signature_polymorphic
(
iid
))
{
// Do not link directly to these. The VM must produce a synthetic one using lookup_polymorphic_method.
...
...
@@ -503,11 +503,14 @@ void LinkResolver::resolve_method_statically(methodHandle& resolved_method, Klas
}
if
(
code
==
Bytecodes
::
_invokeinterface
)
{
resolve_interface_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
true
,
CHECK
);
resolve_interface_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
true
,
true
,
CHECK
);
}
else
if
(
code
==
Bytecodes
::
_invokevirtual
)
{
resolve_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
true
,
true
,
CHECK
);
}
else
{
}
else
if
(
!
resolved_klass
->
is_interface
())
{
resolve_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
true
,
false
,
CHECK
);
}
else
{
bool
nostatics
=
(
code
==
Bytecodes
::
_invokestatic
)
?
false
:
true
;
resolve_interface_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
true
,
nostatics
,
CHECK
);
}
}
...
...
@@ -528,7 +531,7 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res
}
// 2. lookup method in resolved klass and its super klasses
lookup_method_in_klasses
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
CHECK
);
lookup_method_in_klasses
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
true
,
CHECK
);
if
(
resolved_method
.
is_null
())
{
// not found in the class hierarchy
// 3. lookup method in all the interfaces implemented by the resolved klass
...
...
@@ -612,7 +615,8 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method,
Symbol
*
method_name
,
Symbol
*
method_signature
,
KlassHandle
current_klass
,
bool
check_access
,
TRAPS
)
{
bool
check_access
,
bool
nostatics
,
TRAPS
)
{
// check if klass is interface
if
(
!
resolved_klass
->
is_interface
())
{
...
...
@@ -623,7 +627,8 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method,
}
// lookup method in this interface or its super, java.lang.Object
lookup_instance_method_in_klasses
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
CHECK
);
// JDK8: also look for static methods
lookup_method_in_klasses
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
false
,
CHECK
);
if
(
resolved_method
.
is_null
())
{
// lookup method in all the super-interfaces
...
...
@@ -638,6 +643,16 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method,
}
}
if
(
nostatics
&&
resolved_method
->
is_static
())
{
ResourceMark
rm
(
THREAD
);
char
buf
[
200
];
jio_snprintf
(
buf
,
sizeof
(
buf
),
"Expected instance not static method %s"
,
Method
::
name_and_sig_as_C_string
(
resolved_klass
(),
resolved_method
->
name
(),
resolved_method
->
signature
()));
THROW_MSG
(
vmSymbols
::
java_lang_IncompatibleClassChangeError
(),
buf
);
}
if
(
check_access
)
{
// JDK8 adds non-public interface methods, and accessability check requirement
assert
(
current_klass
.
not_null
()
,
"current_klass should not be null"
);
...
...
@@ -864,7 +879,11 @@ void LinkResolver::linktime_resolve_static_method(methodHandle& resolved_method,
Symbol
*
method_name
,
Symbol
*
method_signature
,
KlassHandle
current_klass
,
bool
check_access
,
TRAPS
)
{
resolve_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
check_access
,
false
,
CHECK
);
if
(
!
resolved_klass
->
is_interface
())
{
resolve_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
check_access
,
false
,
CHECK
);
}
else
{
resolve_interface_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
check_access
,
false
,
CHECK
);
}
assert
(
resolved_method
->
name
()
!=
vmSymbols
::
class_initializer_name
(),
"should have been checked in verifier"
);
// check if static
...
...
@@ -898,7 +917,11 @@ void LinkResolver::linktime_resolve_special_method(methodHandle& resolved_method
// and the selected method is recalculated relative to the direct superclass
// superinterface.method, which explicitly does not check shadowing
resolve_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
check_access
,
false
,
CHECK
);
if
(
!
resolved_klass
->
is_interface
())
{
resolve_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
check_access
,
false
,
CHECK
);
}
else
{
resolve_interface_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
check_access
,
true
,
CHECK
);
}
// check if method name is <init>, that it is found in same klass as static type
if
(
resolved_method
->
name
()
==
vmSymbols
::
object_initializer_name
()
&&
...
...
@@ -1219,7 +1242,7 @@ void LinkResolver::resolve_interface_call(CallInfo& result, Handle recv, KlassHa
void
LinkResolver
::
linktime_resolve_interface_method
(
methodHandle
&
resolved_method
,
KlassHandle
resolved_klass
,
Symbol
*
method_name
,
Symbol
*
method_signature
,
KlassHandle
current_klass
,
bool
check_access
,
TRAPS
)
{
// normal interface method resolution
resolve_interface_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
check_access
,
CHECK
);
resolve_interface_method
(
resolved_method
,
resolved_klass
,
method_name
,
method_signature
,
current_klass
,
check_access
,
true
,
CHECK
);
assert
(
resolved_method
->
name
()
!=
vmSymbols
::
object_initializer_name
(),
"should have been checked in verifier"
);
assert
(
resolved_method
->
name
()
!=
vmSymbols
::
class_initializer_name
(),
"should have been checked in verifier"
);
...
...
src/share/vm/interpreter/linkResolver.hpp
浏览文件 @
7e476f9e
...
...
@@ -124,7 +124,7 @@ class LinkResolver: AllStatic {
friend
class
klassItable
;
private:
static
void
lookup_method_in_klasses
(
methodHandle
&
result
,
KlassHandle
klass
,
Symbol
*
name
,
Symbol
*
signature
,
TRAPS
);
static
void
lookup_method_in_klasses
(
methodHandle
&
result
,
KlassHandle
klass
,
Symbol
*
name
,
Symbol
*
signature
,
bool
checkpolymorphism
,
TRAPS
);
static
void
lookup_instance_method_in_klasses
(
methodHandle
&
result
,
KlassHandle
klass
,
Symbol
*
name
,
Symbol
*
signature
,
TRAPS
);
static
void
lookup_method_in_interfaces
(
methodHandle
&
result
,
KlassHandle
klass
,
Symbol
*
name
,
Symbol
*
signature
,
TRAPS
);
static
void
lookup_polymorphic_method
(
methodHandle
&
result
,
KlassHandle
klass
,
Symbol
*
name
,
Symbol
*
signature
,
...
...
@@ -134,7 +134,7 @@ class LinkResolver: AllStatic {
static
void
resolve_pool
(
KlassHandle
&
resolved_klass
,
Symbol
*&
method_name
,
Symbol
*&
method_signature
,
KlassHandle
&
current_klass
,
constantPoolHandle
pool
,
int
index
,
TRAPS
);
static
void
resolve_interface_method
(
methodHandle
&
resolved_method
,
KlassHandle
resolved_klass
,
Symbol
*
method_name
,
Symbol
*
method_signature
,
KlassHandle
current_klass
,
bool
check_access
,
TRAPS
);
static
void
resolve_interface_method
(
methodHandle
&
resolved_method
,
KlassHandle
resolved_klass
,
Symbol
*
method_name
,
Symbol
*
method_signature
,
KlassHandle
current_klass
,
bool
check_access
,
bool
nostatics
,
TRAPS
);
static
void
resolve_method
(
methodHandle
&
resolved_method
,
KlassHandle
resolved_klass
,
Symbol
*
method_name
,
Symbol
*
method_signature
,
KlassHandle
current_klass
,
bool
check_access
,
bool
require_methodref
,
TRAPS
);
static
void
linktime_resolve_static_method
(
methodHandle
&
resolved_method
,
KlassHandle
resolved_klass
,
Symbol
*
method_name
,
Symbol
*
method_signature
,
KlassHandle
current_klass
,
bool
check_access
,
TRAPS
);
...
...
test/TEST.groups
浏览文件 @
7e476f9e
...
...
@@ -70,7 +70,6 @@ needs_jdk = \
runtime/7107135/Test7107135.sh \
runtime/7158988/FieldMonitor.java \
runtime/7194254/Test7194254.java \
runtime/8026365/InvokeSpecialAnonTest.java \
runtime/jsig/Test8017498.sh \
runtime/Metaspace/FragmentMetaspace.java \
runtime/NMT/BaselineWithParameter.java \
...
...
test/runtime/8024804/RegisterNatives.java
浏览文件 @
7e476f9e
...
...
@@ -22,6 +22,7 @@
*/
/*
* @ignore 8028741
* @test
* @bug 8024804
* @summary registerNatives() interface resolution should receive IAE
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录