Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
0faaca5a
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看板
提交
0faaca5a
编写于
12月 03, 2013
作者:
A
acorn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8028438: static superclass method masks default methods
Reviewed-by: hseigel, lfoltan, coleenp
上级
7e476f9e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
30 addition
and
6 deletion
+30
-6
src/share/vm/classfile/defaultMethods.cpp
src/share/vm/classfile/defaultMethods.cpp
+3
-3
src/share/vm/interpreter/linkResolver.cpp
src/share/vm/interpreter/linkResolver.cpp
+2
-2
src/share/vm/oops/instanceKlass.cpp
src/share/vm/oops/instanceKlass.cpp
+11
-0
src/share/vm/oops/instanceKlass.hpp
src/share/vm/oops/instanceKlass.hpp
+1
-0
src/share/vm/oops/klassVtable.cpp
src/share/vm/oops/klassVtable.cpp
+13
-1
未找到文件。
src/share/vm/classfile/defaultMethods.cpp
浏览文件 @
0faaca5a
...
@@ -625,13 +625,13 @@ static GrowableArray<EmptyVtableSlot*>* find_empty_vtable_slots(
...
@@ -625,13 +625,13 @@ static GrowableArray<EmptyVtableSlot*>* find_empty_vtable_slots(
while
(
super
!=
NULL
)
{
while
(
super
!=
NULL
)
{
for
(
int
i
=
0
;
i
<
super
->
methods
()
->
length
();
++
i
)
{
for
(
int
i
=
0
;
i
<
super
->
methods
()
->
length
();
++
i
)
{
Method
*
m
=
super
->
methods
()
->
at
(
i
);
Method
*
m
=
super
->
methods
()
->
at
(
i
);
if
(
m
->
is_overpass
())
{
if
(
m
->
is_overpass
()
||
m
->
is_static
()
)
{
// m is a method that would have been a miranda if not for the
// m is a method that would have been a miranda if not for the
// default method processing that occurred on behalf of our superclass,
// default method processing that occurred on behalf of our superclass,
// so it's a method we want to re-examine in this new context. That is,
// so it's a method we want to re-examine in this new context. That is,
// unless we have a real implementation of it in the current class.
// unless we have a real implementation of it in the current class.
Method
*
impl
=
klass
->
lookup_method
(
m
->
name
(),
m
->
signature
());
Method
*
impl
=
klass
->
lookup_method
(
m
->
name
(),
m
->
signature
());
if
(
impl
==
NULL
||
impl
->
is_overpass
())
{
if
(
impl
==
NULL
||
impl
->
is_overpass
()
||
impl
->
is_static
()
)
{
if
(
!
already_in_vtable_slots
(
slots
,
m
))
{
if
(
!
already_in_vtable_slots
(
slots
,
m
))
{
slots
->
append
(
new
EmptyVtableSlot
(
m
));
slots
->
append
(
new
EmptyVtableSlot
(
m
));
}
}
...
@@ -648,7 +648,7 @@ static GrowableArray<EmptyVtableSlot*>* find_empty_vtable_slots(
...
@@ -648,7 +648,7 @@ static GrowableArray<EmptyVtableSlot*>* find_empty_vtable_slots(
// so it's a method we want to re-examine in this new context. That is,
// so it's a method we want to re-examine in this new context. That is,
// unless we have a real implementation of it in the current class.
// unless we have a real implementation of it in the current class.
Method
*
impl
=
klass
->
lookup_method
(
m
->
name
(),
m
->
signature
());
Method
*
impl
=
klass
->
lookup_method
(
m
->
name
(),
m
->
signature
());
if
(
impl
==
NULL
||
impl
->
is_overpass
())
{
if
(
impl
==
NULL
||
impl
->
is_overpass
()
||
impl
->
is_static
()
)
{
if
(
!
already_in_vtable_slots
(
slots
,
m
))
{
if
(
!
already_in_vtable_slots
(
slots
,
m
))
{
slots
->
append
(
new
EmptyVtableSlot
(
m
));
slots
->
append
(
new
EmptyVtableSlot
(
m
));
}
}
...
...
src/share/vm/interpreter/linkResolver.cpp
浏览文件 @
0faaca5a
...
@@ -267,8 +267,8 @@ void LinkResolver::lookup_instance_method_in_klasses(methodHandle& result, Klass
...
@@ -267,8 +267,8 @@ void LinkResolver::lookup_instance_method_in_klasses(methodHandle& result, Klass
Method
*
result_oop
=
klass
->
uncached_lookup_method
(
name
,
signature
);
Method
*
result_oop
=
klass
->
uncached_lookup_method
(
name
,
signature
);
result
=
methodHandle
(
THREAD
,
result_oop
);
result
=
methodHandle
(
THREAD
,
result_oop
);
while
(
!
result
.
is_null
()
&&
result
->
is_static
()
&&
result
->
method_holder
()
->
super
()
!=
NULL
)
{
while
(
!
result
.
is_null
()
&&
result
->
is_static
()
&&
result
->
method_holder
()
->
super
()
!=
NULL
)
{
klass
=
KlassHandle
(
THREAD
,
result
->
method_holder
()
->
super
());
KlassHandle
super_
klass
=
KlassHandle
(
THREAD
,
result
->
method_holder
()
->
super
());
result
=
methodHandle
(
THREAD
,
klass
->
uncached_lookup_method
(
name
,
signature
));
result
=
methodHandle
(
THREAD
,
super_
klass
->
uncached_lookup_method
(
name
,
signature
));
}
}
if
(
result
.
is_null
())
{
if
(
result
.
is_null
())
{
...
...
src/share/vm/oops/instanceKlass.cpp
浏览文件 @
0faaca5a
...
@@ -1427,6 +1427,17 @@ Method* InstanceKlass::find_method(Symbol* name, Symbol* signature) const {
...
@@ -1427,6 +1427,17 @@ Method* InstanceKlass::find_method(Symbol* name, Symbol* signature) const {
return
InstanceKlass
::
find_method
(
methods
(),
name
,
signature
);
return
InstanceKlass
::
find_method
(
methods
(),
name
,
signature
);
}
}
// find_instance_method looks up the name/signature in the local methods array
// and skips over static methods
Method
*
InstanceKlass
::
find_instance_method
(
Array
<
Method
*>*
methods
,
Symbol
*
name
,
Symbol
*
signature
)
{
Method
*
meth
=
InstanceKlass
::
find_method
(
methods
,
name
,
signature
);
if
(
meth
!=
NULL
&&
meth
->
is_static
())
{
meth
=
NULL
;
}
return
meth
;
}
// find_method looks up the name/signature in the local methods array
// find_method looks up the name/signature in the local methods array
Method
*
InstanceKlass
::
find_method
(
Method
*
InstanceKlass
::
find_method
(
Array
<
Method
*>*
methods
,
Symbol
*
name
,
Symbol
*
signature
)
{
Array
<
Method
*>*
methods
,
Symbol
*
name
,
Symbol
*
signature
)
{
...
...
src/share/vm/oops/instanceKlass.hpp
浏览文件 @
0faaca5a
...
@@ -515,6 +515,7 @@ class InstanceKlass: public Klass {
...
@@ -515,6 +515,7 @@ class InstanceKlass: public Klass {
// find a local method (returns NULL if not found)
// find a local method (returns NULL if not found)
Method
*
find_method
(
Symbol
*
name
,
Symbol
*
signature
)
const
;
Method
*
find_method
(
Symbol
*
name
,
Symbol
*
signature
)
const
;
static
Method
*
find_method
(
Array
<
Method
*>*
methods
,
Symbol
*
name
,
Symbol
*
signature
);
static
Method
*
find_method
(
Array
<
Method
*>*
methods
,
Symbol
*
name
,
Symbol
*
signature
);
static
Method
*
find_instance_method
(
Array
<
Method
*>*
methods
,
Symbol
*
name
,
Symbol
*
signature
);
// find a local method index in default_methods (returns -1 if not found)
// find a local method index in default_methods (returns -1 if not found)
static
int
find_method_index
(
Array
<
Method
*>*
methods
,
Symbol
*
name
,
Symbol
*
signature
);
static
int
find_method_index
(
Array
<
Method
*>*
methods
,
Symbol
*
name
,
Symbol
*
signature
);
...
...
src/share/vm/oops/klassVtable.cpp
浏览文件 @
0faaca5a
...
@@ -665,6 +665,11 @@ bool klassVtable::is_miranda_entry_at(int i) {
...
@@ -665,6 +665,11 @@ bool klassVtable::is_miranda_entry_at(int i) {
// check if a method is a miranda method, given a class's methods table,
// check if a method is a miranda method, given a class's methods table,
// its default_method table and its super
// its default_method table and its super
// Miranda methods are calculated twice:
// first: before vtable size calculation: including abstract and default
// This is seen by default method creation
// Second: recalculated during vtable initialization: only abstract
// This is seen by link resolution and selection.
// "miranda" means not static, not defined by this class.
// "miranda" means not static, not defined by this class.
// private methods in interfaces do not belong in the miranda list.
// private methods in interfaces do not belong in the miranda list.
// the caller must make sure that the method belongs to an interface implemented by the class
// the caller must make sure that the method belongs to an interface implemented by the class
...
@@ -678,7 +683,8 @@ bool klassVtable::is_miranda(Method* m, Array<Method*>* class_methods,
...
@@ -678,7 +683,8 @@ bool klassVtable::is_miranda(Method* m, Array<Method*>* class_methods,
}
}
Symbol
*
name
=
m
->
name
();
Symbol
*
name
=
m
->
name
();
Symbol
*
signature
=
m
->
signature
();
Symbol
*
signature
=
m
->
signature
();
if
(
InstanceKlass
::
find_method
(
class_methods
,
name
,
signature
)
==
NULL
)
{
if
(
InstanceKlass
::
find_instance_method
(
class_methods
,
name
,
signature
)
==
NULL
)
{
// did not find it in the method table of the current class
// did not find it in the method table of the current class
if
((
default_methods
==
NULL
)
||
if
((
default_methods
==
NULL
)
||
InstanceKlass
::
find_method
(
default_methods
,
name
,
signature
)
==
NULL
)
{
InstanceKlass
::
find_method
(
default_methods
,
name
,
signature
)
==
NULL
)
{
...
@@ -688,6 +694,12 @@ bool klassVtable::is_miranda(Method* m, Array<Method*>* class_methods,
...
@@ -688,6 +694,12 @@ bool klassVtable::is_miranda(Method* m, Array<Method*>* class_methods,
}
}
Method
*
mo
=
InstanceKlass
::
cast
(
super
)
->
lookup_method
(
name
,
signature
);
Method
*
mo
=
InstanceKlass
::
cast
(
super
)
->
lookup_method
(
name
,
signature
);
while
(
mo
!=
NULL
&&
mo
->
access_flags
().
is_static
()
&&
mo
->
method_holder
()
!=
NULL
&&
mo
->
method_holder
()
->
super
()
!=
NULL
)
{
mo
=
mo
->
method_holder
()
->
super
()
->
uncached_lookup_method
(
name
,
signature
);
}
if
(
mo
==
NULL
||
mo
->
access_flags
().
is_private
()
)
{
if
(
mo
==
NULL
||
mo
->
access_flags
().
is_private
()
)
{
// super class hierarchy does not implement it or protection is different
// super class hierarchy does not implement it or protection is different
return
true
;
return
true
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录