Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
38095ce6
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
38095ce6
编写于
3月 27, 2013
作者:
A
acorn
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
1db6cb76
e67f208a
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
30 deletion
+34
-30
src/share/vm/classfile/systemDictionary.cpp
src/share/vm/classfile/systemDictionary.cpp
+4
-7
src/share/vm/classfile/systemDictionary.hpp
src/share/vm/classfile/systemDictionary.hpp
+2
-2
src/share/vm/interpreter/linkResolver.cpp
src/share/vm/interpreter/linkResolver.cpp
+22
-17
src/share/vm/oops/klassVtable.cpp
src/share/vm/oops/klassVtable.cpp
+6
-4
未找到文件。
src/share/vm/classfile/systemDictionary.cpp
浏览文件 @
38095ce6
...
...
@@ -2185,10 +2185,9 @@ Symbol* SystemDictionary::find_resolution_error(constantPoolHandle pool, int whi
// Make sure all class components (including arrays) in the given
// signature will be resolved to the same class in both loaders.
// Returns the name of the type that failed a loader constraint check, or
// NULL if no constraint failed. The returned C string needs cleaning up
// with a ResourceMark in the caller. No exception except OOME is thrown.
// NULL if no constraint failed. No exception except OOME is thrown.
// Arrays are not added to the loader constraint table, their elements are.
char
*
SystemDictionary
::
check_signature_loaders
(
Symbol
*
signature
,
Symbol
*
SystemDictionary
::
check_signature_loaders
(
Symbol
*
signature
,
Handle
loader1
,
Handle
loader2
,
bool
is_method
,
TRAPS
)
{
// Nothing to do if loaders are the same.
...
...
@@ -2196,14 +2195,12 @@ char* SystemDictionary::check_signature_loaders(Symbol* signature,
return
NULL
;
}
ResourceMark
rm
(
THREAD
);
SignatureStream
sig_strm
(
signature
,
is_method
);
while
(
!
sig_strm
.
is_done
())
{
if
(
sig_strm
.
is_object
())
{
Symbol
*
s
=
sig_strm
.
as_symbol
(
CHECK_NULL
);
Symbol
*
sig
=
s
;
Symbol
*
sig
=
sig_strm
.
as_symbol
(
CHECK_NULL
);
if
(
!
add_loader_constraint
(
sig
,
loader1
,
loader2
,
THREAD
))
{
return
sig
->
as_C_string
()
;
return
sig
;
}
}
sig_strm
.
next
();
...
...
src/share/vm/classfile/systemDictionary.hpp
浏览文件 @
38095ce6
...
...
@@ -483,8 +483,8 @@ public:
// Check class loader constraints
static
bool
add_loader_constraint
(
Symbol
*
name
,
Handle
loader1
,
Handle
loader2
,
TRAPS
);
static
char
*
check_signature_loaders
(
Symbol
*
signature
,
Handle
loader1
,
Handle
loader2
,
bool
is_method
,
TRAPS
);
static
Symbol
*
check_signature_loaders
(
Symbol
*
signature
,
Handle
loader1
,
Handle
loader2
,
bool
is_method
,
TRAPS
);
// JSR 292
// find a java.lang.invoke.MethodHandle.invoke* method for a given signature
...
...
src/share/vm/interpreter/linkResolver.cpp
浏览文件 @
38095ce6
...
...
@@ -458,25 +458,27 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res
Handle
class_loader
(
THREAD
,
resolved_method
->
method_holder
()
->
class_loader
());
{
ResourceMark
rm
(
THREAD
);
char
*
failed_type_name
=
Symbol
*
failed_type_symbol
=
SystemDictionary
::
check_signature_loaders
(
method_signature
,
loader
,
class_loader
,
true
,
CHECK
);
if
(
failed_type_
name
!=
NULL
)
{
if
(
failed_type_
symbol
!=
NULL
)
{
const
char
*
msg
=
"loader constraint violation: when resolving method"
"
\"
%s
\"
the class loader (instance of %s) of the current class, %s,"
" and the class loader (instance of %s) for
resolved
class, %s, have"
" and the class loader (instance of %s) for
the method's defining
class, %s, have"
" different Class objects for the type %s used in the signature"
;
char
*
sig
=
Method
::
name_and_sig_as_C_string
(
resolved_klass
(),
method_name
,
method_signature
);
const
char
*
loader1
=
SystemDictionary
::
loader_name
(
loader
());
char
*
current
=
InstanceKlass
::
cast
(
current_klass
())
->
name
()
->
as_C_string
();
const
char
*
loader2
=
SystemDictionary
::
loader_name
(
class_loader
());
char
*
resolved
=
InstanceKlass
::
cast
(
resolved_klass
())
->
name
()
->
as_C_string
();
char
*
target
=
InstanceKlass
::
cast
(
resolved_method
->
method_holder
())
->
name
()
->
as_C_string
();
char
*
failed_type_name
=
failed_type_symbol
->
as_C_string
();
size_t
buflen
=
strlen
(
msg
)
+
strlen
(
sig
)
+
strlen
(
loader1
)
+
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
resolved
)
+
strlen
(
failed_type_name
);
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
target
)
+
strlen
(
failed_type_name
)
+
1
;
char
*
buf
=
NEW_RESOURCE_ARRAY_IN_THREAD
(
THREAD
,
char
,
buflen
);
jio_snprintf
(
buf
,
buflen
,
msg
,
sig
,
loader1
,
current
,
loader2
,
resolved
,
failed_type_name
);
target
,
failed_type_name
);
THROW_MSG
(
vmSymbols
::
java_lang_LinkageError
(),
buf
);
}
}
...
...
@@ -520,26 +522,28 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method,
Handle
class_loader
(
THREAD
,
resolved_method
->
method_holder
()
->
class_loader
());
{
ResourceMark
rm
(
THREAD
);
char
*
failed_type_name
=
Symbol
*
failed_type_symbol
=
SystemDictionary
::
check_signature_loaders
(
method_signature
,
loader
,
class_loader
,
true
,
CHECK
);
if
(
failed_type_
name
!=
NULL
)
{
if
(
failed_type_
symbol
!=
NULL
)
{
const
char
*
msg
=
"loader constraint violation: when resolving "
"interface method
\"
%s
\"
the class loader (instance of %s) of the "
"current class, %s, and the class loader (instance of %s) for "
"
resolved
class, %s, have different Class objects for the type %s "
"
the method's defining
class, %s, have different Class objects for the type %s "
"used in the signature"
;
char
*
sig
=
Method
::
name_and_sig_as_C_string
(
resolved_klass
(),
method_name
,
method_signature
);
const
char
*
loader1
=
SystemDictionary
::
loader_name
(
loader
());
char
*
current
=
InstanceKlass
::
cast
(
current_klass
())
->
name
()
->
as_C_string
();
const
char
*
loader2
=
SystemDictionary
::
loader_name
(
class_loader
());
char
*
resolved
=
InstanceKlass
::
cast
(
resolved_klass
())
->
name
()
->
as_C_string
();
char
*
target
=
InstanceKlass
::
cast
(
resolved_method
->
method_holder
())
->
name
()
->
as_C_string
();
char
*
failed_type_name
=
failed_type_symbol
->
as_C_string
();
size_t
buflen
=
strlen
(
msg
)
+
strlen
(
sig
)
+
strlen
(
loader1
)
+
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
resolved
)
+
strlen
(
failed_type_name
);
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
target
)
+
strlen
(
failed_type_name
)
+
1
;
char
*
buf
=
NEW_RESOURCE_ARRAY_IN_THREAD
(
THREAD
,
char
,
buflen
);
jio_snprintf
(
buf
,
buflen
,
msg
,
sig
,
loader1
,
current
,
loader2
,
resolved
,
failed_type_name
);
target
,
failed_type_name
);
THROW_MSG
(
vmSymbols
::
java_lang_LinkageError
(),
buf
);
}
}
...
...
@@ -642,12 +646,12 @@ void LinkResolver::resolve_field(FieldAccessInfo& result, constantPoolHandle poo
Symbol
*
signature_ref
=
pool
->
signature_ref_at
(
index
);
{
ResourceMark
rm
(
THREAD
);
char
*
failed_type_name
=
Symbol
*
failed_type_symbol
=
SystemDictionary
::
check_signature_loaders
(
signature_ref
,
ref_loader
,
sel_loader
,
false
,
CHECK
);
if
(
failed_type_
name
!=
NULL
)
{
if
(
failed_type_
symbol
!=
NULL
)
{
const
char
*
msg
=
"loader constraint violation: when resolving field"
"
\"
%s
\"
the class loader (instance of %s) of the referring class, "
"%s, and the class loader (instance of %s) for the field's resolved "
...
...
@@ -656,8 +660,9 @@ void LinkResolver::resolve_field(FieldAccessInfo& result, constantPoolHandle poo
const
char
*
loader1
=
SystemDictionary
::
loader_name
(
ref_loader
());
char
*
sel
=
InstanceKlass
::
cast
(
sel_klass
())
->
name
()
->
as_C_string
();
const
char
*
loader2
=
SystemDictionary
::
loader_name
(
sel_loader
());
char
*
failed_type_name
=
failed_type_symbol
->
as_C_string
();
size_t
buflen
=
strlen
(
msg
)
+
strlen
(
field_name
)
+
strlen
(
loader1
)
+
strlen
(
sel
)
+
strlen
(
loader2
)
+
strlen
(
failed_type_name
);
strlen
(
sel
)
+
strlen
(
loader2
)
+
strlen
(
failed_type_name
)
+
1
;
char
*
buf
=
NEW_RESOURCE_ARRAY_IN_THREAD
(
THREAD
,
char
,
buflen
);
jio_snprintf
(
buf
,
buflen
,
msg
,
field_name
,
loader1
,
sel
,
loader2
,
failed_type_name
);
...
...
src/share/vm/oops/klassVtable.cpp
浏览文件 @
38095ce6
...
...
@@ -327,11 +327,11 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar
if
(
target_loader
()
!=
super_loader
())
{
ResourceMark
rm
(
THREAD
);
char
*
failed_type_name
=
Symbol
*
failed_type_symbol
=
SystemDictionary
::
check_signature_loaders
(
signature
,
target_loader
,
super_loader
,
true
,
CHECK_
(
false
));
if
(
failed_type_
name
!=
NULL
)
{
if
(
failed_type_
symbol
!=
NULL
)
{
const
char
*
msg
=
"loader constraint violation: when resolving "
"overridden method
\"
%s
\"
the class loader (instance"
" of %s) of the current class, %s, and its superclass loader "
...
...
@@ -341,6 +341,7 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar
const
char
*
loader1
=
SystemDictionary
::
loader_name
(
target_loader
());
char
*
current
=
_klass
->
name
()
->
as_C_string
();
const
char
*
loader2
=
SystemDictionary
::
loader_name
(
super_loader
());
char
*
failed_type_name
=
failed_type_symbol
->
as_C_string
();
size_t
buflen
=
strlen
(
msg
)
+
strlen
(
sig
)
+
strlen
(
loader1
)
+
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
failed_type_name
);
char
*
buf
=
NEW_RESOURCE_ARRAY_IN_THREAD
(
THREAD
,
char
,
buflen
);
...
...
@@ -787,12 +788,12 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass
Handle
method_holder_loader
(
THREAD
,
target
->
method_holder
()
->
class_loader
());
if
(
method_holder_loader
()
!=
interface_loader
())
{
ResourceMark
rm
(
THREAD
);
char
*
failed_type_name
=
Symbol
*
failed_type_symbol
=
SystemDictionary
::
check_signature_loaders
(
method_signature
,
method_holder_loader
,
interface_loader
,
true
,
CHECK
);
if
(
failed_type_
name
!=
NULL
)
{
if
(
failed_type_
symbol
!=
NULL
)
{
const
char
*
msg
=
"loader constraint violation in interface "
"itable initialization: when resolving method
\"
%s
\"
the class"
" loader (instance of %s) of the current class, %s, "
...
...
@@ -804,6 +805,7 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass
char
*
current
=
klass
->
name
()
->
as_C_string
();
const
char
*
loader2
=
SystemDictionary
::
loader_name
(
interface_loader
());
char
*
iface
=
InstanceKlass
::
cast
(
interf_h
())
->
name
()
->
as_C_string
();
char
*
failed_type_name
=
failed_type_symbol
->
as_C_string
();
size_t
buflen
=
strlen
(
msg
)
+
strlen
(
sig
)
+
strlen
(
loader1
)
+
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
iface
)
+
strlen
(
failed_type_name
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录