Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
eeede01a
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看板
提交
eeede01a
编写于
2月 04, 2014
作者:
A
amurillo
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
2166cad8
3fd3a8b2
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
846 addition
and
581 deletion
+846
-581
.hgtags
.hgtags
+2
-0
.jcheck/conf
.jcheck/conf
+1
-0
THIRD_PARTY_README
THIRD_PARTY_README
+766
-546
src/share/vm/classfile/defaultMethods.cpp
src/share/vm/classfile/defaultMethods.cpp
+31
-10
src/share/vm/prims/methodHandles.cpp
src/share/vm/prims/methodHandles.cpp
+45
-21
src/share/vm/prims/methodHandles.hpp
src/share/vm/prims/methodHandles.hpp
+1
-1
src/share/vm/runtime/os.cpp
src/share/vm/runtime/os.cpp
+0
-3
未找到文件。
.hgtags
浏览文件 @
eeede01a
...
...
@@ -410,5 +410,7 @@ d3521d8e562a782f66fc0dfdebeffba2c7e3471d jdk8-b122
591135a7d6f96c0ef281d078cee9a8d8c342d45c jdk8-b123
c89630a122b43d0eabd78b74f6498a1c3cf04ca3 jdk8u20-b00
c89630a122b43d0eabd78b74f6498a1c3cf04ca3 hs25.20-b00
9b9816164447214f21b06ccf646893c281c76a42 hs25-b66
df333ee12bba67e2e928f8ce1da37afd9bf95b48 jdk8-b124
412d3b5fe90e54c0ff9d9ac7374b98607c561d5a hs25.20-b01
4638c4d7ff106db0f29ef7f18b128dd7e69bc470 hs25.20-b02
.jcheck/conf
浏览文件 @
eeede01a
project=jdk8
bugids=dup
THIRD_PARTY_README
浏览文件 @
eeede01a
此差异已折叠。
点击以展开。
src/share/vm/classfile/defaultMethods.cpp
浏览文件 @
eeede01a
/*
* Copyright (c) 2012, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 201
4
, Oracle and/or its affiliates. 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
...
...
@@ -390,6 +390,20 @@ class MethodFamily : public ResourceObj {
Symbol
*
get_exception_message
()
{
return
_exception_message
;
}
Symbol
*
get_exception_name
()
{
return
_exception_name
;
}
// Return true if the specified klass has a static method that matches
// the name and signature of the target method.
bool
has_matching_static
(
InstanceKlass
*
root
)
{
if
(
_members
.
length
()
>
0
)
{
Pair
<
Method
*
,
QualifiedState
>
entry
=
_members
.
at
(
0
);
Method
*
impl
=
root
->
find_method
(
entry
.
first
->
name
(),
entry
.
first
->
signature
());
if
((
impl
!=
NULL
)
&&
impl
->
is_static
())
{
return
true
;
}
}
return
false
;
}
// Either sets the target or the exception error message
void
determine_target
(
InstanceKlass
*
root
,
TRAPS
)
{
if
(
has_target
()
||
throws_exception
())
{
...
...
@@ -416,19 +430,26 @@ class MethodFamily : public ResourceObj {
}
if
(
num_defaults
==
0
)
{
if
(
qualified_methods
.
length
()
==
0
)
{
_exception_message
=
generate_no_defaults_message
(
CHECK
);
}
else
{
assert
(
root
!=
NULL
,
"Null root class"
);
_exception_message
=
generate_method_message
(
root
->
name
(),
qualified_methods
.
at
(
0
),
CHECK
);
// If the root klass has a static method with matching name and signature
// then do not generate an overpass method because it will hide the
// static method during resolution.
if
(
!
has_matching_static
(
root
))
{
if
(
qualified_methods
.
length
()
==
0
)
{
_exception_message
=
generate_no_defaults_message
(
CHECK
);
}
else
{
assert
(
root
!=
NULL
,
"Null root class"
);
_exception_message
=
generate_method_message
(
root
->
name
(),
qualified_methods
.
at
(
0
),
CHECK
);
}
_exception_name
=
vmSymbols
::
java_lang_AbstractMethodError
();
}
_exception_name
=
vmSymbols
::
java_lang_AbstractMethodError
();
// If only one qualified method is default, select that
}
else
if
(
num_defaults
==
1
)
{
_selected_target
=
qualified_methods
.
at
(
default_index
);
}
else
if
(
num_defaults
>
1
)
{
_exception_message
=
generate_conflicts_message
(
&
qualified_methods
,
CHECK
);
_exception_name
=
vmSymbols
::
java_lang_IncompatibleClassChangeError
();
}
else
if
(
num_defaults
>
1
&&
!
has_matching_static
(
root
))
{
_exception_message
=
generate_conflicts_message
(
&
qualified_methods
,
CHECK
);
_exception_name
=
vmSymbols
::
java_lang_IncompatibleClassChangeError
();
if
(
TraceDefaultMethods
)
{
_exception_message
->
print_value_on
(
tty
);
tty
->
print_cr
(
""
);
...
...
src/share/vm/prims/methodHandles.cpp
浏览文件 @
eeede01a
...
...
@@ -175,8 +175,8 @@ oop MethodHandles::init_MemberName(Handle mname, Handle target) {
oop
MethodHandles
::
init_method_MemberName
(
Handle
mname
,
CallInfo
&
info
)
{
assert
(
info
.
resolved_appendix
().
is_null
(),
"only normal methods here"
);
KlassHandle
receiver_limit
=
info
.
resolved_klass
();
methodHandle
m
=
info
.
resolved_method
();
KlassHandle
m_klass
=
m
->
method_holder
();
int
flags
=
(
jushort
)(
m
->
access_flags
().
as_short
()
&
JVM_RECOGNIZED_METHOD_MODIFIERS
);
int
vmindex
=
Method
::
invalid_vtable_index
;
...
...
@@ -184,14 +184,13 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) {
case
CallInfo
::
itable_call
:
vmindex
=
info
.
itable_index
();
// More importantly, the itable index only works with the method holder.
receiver_limit
=
m
->
method_holder
();
assert
(
receiver_limit
->
verify_itable_index
(
vmindex
),
""
);
assert
(
m_klass
->
verify_itable_index
(
vmindex
),
""
);
flags
|=
IS_METHOD
|
(
JVM_REF_invokeInterface
<<
REFERENCE_KIND_SHIFT
);
if
(
TraceInvokeDynamic
)
{
ResourceMark
rm
;
tty
->
print_cr
(
"memberName: invokeinterface method_holder::method: %s,
receiver: %s,
itableindex: %d, access_flags:"
,
Method
::
name_and_sig_as_C_string
(
receiver_limit
(),
m
->
name
(),
m
->
signature
()),
receiver_limit
()
->
internal_name
(),
vmindex
);
tty
->
print_cr
(
"memberName: invokeinterface method_holder::method: %s, itableindex: %d, access_flags:"
,
Method
::
name_and_sig_as_C_string
(
m
->
method_holder
(),
m
->
name
(),
m
->
signature
()),
vmindex
);
m
->
access_flags
().
print_on
(
tty
);
if
(
!
m
->
is_abstract
())
{
tty
->
print
(
"default"
);
...
...
@@ -203,12 +202,35 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) {
case
CallInfo
::
vtable_call
:
vmindex
=
info
.
vtable_index
();
flags
|=
IS_METHOD
|
(
JVM_REF_invokeVirtual
<<
REFERENCE_KIND_SHIFT
);
assert
(
receiver_limit
->
is_subtype_of
(
m
->
method_holder
()),
"virtual call must be type-safe"
);
assert
(
info
.
resolved_klass
()
->
is_subtype_of
(
m_klass
()),
"virtual call must be type-safe"
);
if
(
m_klass
->
is_interface
())
{
// This is a vtable call to an interface method (abstract "miranda method" or default method).
// The vtable index is meaningless without a class (not interface) receiver type, so get one.
// (LinkResolver should help us figure this out.)
KlassHandle
m_klass_non_interface
=
info
.
resolved_klass
();
if
(
m_klass_non_interface
->
is_interface
())
{
m_klass_non_interface
=
SystemDictionary
::
Object_klass
();
#ifdef ASSERT
{
ResourceMark
rm
;
Method
*
m2
=
m_klass_non_interface
->
vtable
()
->
method_at
(
vmindex
);
assert
(
m
->
name
()
==
m2
->
name
()
&&
m
->
signature
()
==
m2
->
signature
(),
err_msg
(
"at %d, %s != %s"
,
vmindex
,
m
->
name_and_sig_as_C_string
(),
m2
->
name_and_sig_as_C_string
()));
}
#endif //ASSERT
}
if
(
!
m
->
is_public
())
{
assert
(
m
->
is_public
(),
"virtual call must be to public interface method"
);
return
NULL
;
// elicit an error later in product build
}
assert
(
info
.
resolved_klass
()
->
is_subtype_of
(
m_klass_non_interface
()),
"virtual call must be type-safe"
);
m_klass
=
m_klass_non_interface
;
}
if
(
TraceInvokeDynamic
)
{
ResourceMark
rm
;
tty
->
print_cr
(
"memberName: invokevirtual method_holder::method: %s, receiver: %s, vtableindex: %d, access_flags:"
,
Method
::
name_and_sig_as_C_string
(
receiver_limit
(),
m
->
name
(),
m
->
signature
()),
receiver_limit
()
->
internal_name
(),
vmindex
);
Method
::
name_and_sig_as_C_string
(
m
->
method_holder
(),
m
->
name
(),
m
->
signature
()),
m_klass
->
internal_name
(),
vmindex
);
m
->
access_flags
().
print_on
(
tty
);
if
(
m
->
is_default_method
())
{
tty
->
print
(
"default"
);
...
...
@@ -223,10 +245,8 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) {
flags
|=
IS_METHOD
|
(
JVM_REF_invokeStatic
<<
REFERENCE_KIND_SHIFT
);
}
else
if
(
m
->
is_initializer
())
{
flags
|=
IS_CONSTRUCTOR
|
(
JVM_REF_invokeSpecial
<<
REFERENCE_KIND_SHIFT
);
assert
(
receiver_limit
==
m
->
method_holder
(),
"constructor call must be exactly typed"
);
}
else
{
flags
|=
IS_METHOD
|
(
JVM_REF_invokeSpecial
<<
REFERENCE_KIND_SHIFT
);
assert
(
receiver_limit
->
is_subtype_of
(
m
->
method_holder
()),
"special call must be type-safe"
);
}
break
;
...
...
@@ -242,7 +262,7 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) {
java_lang_invoke_MemberName
::
set_flags
(
mname_oop
,
flags
);
java_lang_invoke_MemberName
::
set_vmtarget
(
mname_oop
,
m
());
java_lang_invoke_MemberName
::
set_vmindex
(
mname_oop
,
vmindex
);
// vtable/itable index
java_lang_invoke_MemberName
::
set_clazz
(
mname_oop
,
receiver_limit
->
java_mirror
());
java_lang_invoke_MemberName
::
set_clazz
(
mname_oop
,
m_klass
->
java_mirror
());
// Note: name and type can be lazily computed by resolve_MemberName,
// if Java code needs them as resolved String and MethodType objects.
// The clazz must be eagerly stored, because it provides a GC
...
...
@@ -569,7 +589,7 @@ oop MethodHandles::field_signature_type_or_null(Symbol* s) {
// An unresolved member name is a mere symbolic reference.
// Resolving it plants a vmtarget/vmindex in it,
// which refers directly to JVM internals.
Handle
MethodHandles
::
resolve_MemberName
(
Handle
mname
,
TRAPS
)
{
Handle
MethodHandles
::
resolve_MemberName
(
Handle
mname
,
KlassHandle
caller
,
TRAPS
)
{
Handle
empty
;
assert
(
java_lang_invoke_MemberName
::
is_instance
(
mname
()),
""
);
...
...
@@ -646,20 +666,20 @@ Handle MethodHandles::resolve_MemberName(Handle mname, TRAPS) {
assert
(
!
HAS_PENDING_EXCEPTION
,
""
);
if
(
ref_kind
==
JVM_REF_invokeStatic
)
{
LinkResolver
::
resolve_static_call
(
result
,
defc
,
name
,
type
,
KlassHandle
(),
false
,
false
,
THREAD
);
defc
,
name
,
type
,
caller
,
caller
.
not_null
()
,
false
,
THREAD
);
}
else
if
(
ref_kind
==
JVM_REF_invokeInterface
)
{
LinkResolver
::
resolve_interface_call
(
result
,
Handle
(),
defc
,
defc
,
name
,
type
,
KlassHandle
(),
false
,
false
,
THREAD
);
defc
,
name
,
type
,
caller
,
caller
.
not_null
()
,
false
,
THREAD
);
}
else
if
(
mh_invoke_id
!=
vmIntrinsics
::
_none
)
{
assert
(
!
is_signature_polymorphic_static
(
mh_invoke_id
),
""
);
LinkResolver
::
resolve_handle_call
(
result
,
defc
,
name
,
type
,
KlassHandle
()
,
THREAD
);
defc
,
name
,
type
,
caller
,
THREAD
);
}
else
if
(
ref_kind
==
JVM_REF_invokeSpecial
)
{
LinkResolver
::
resolve_special_call
(
result
,
defc
,
name
,
type
,
KlassHandle
(),
false
,
THREAD
);
defc
,
name
,
type
,
caller
,
caller
.
not_null
()
,
THREAD
);
}
else
if
(
ref_kind
==
JVM_REF_invokeVirtual
)
{
LinkResolver
::
resolve_virtual_call
(
result
,
Handle
(),
defc
,
defc
,
name
,
type
,
KlassHandle
(),
false
,
false
,
THREAD
);
defc
,
name
,
type
,
caller
,
caller
.
not_null
()
,
false
,
THREAD
);
}
else
{
assert
(
false
,
err_msg
(
"ref_kind=%d"
,
ref_kind
));
}
...
...
@@ -683,7 +703,7 @@ Handle MethodHandles::resolve_MemberName(Handle mname, TRAPS) {
assert
(
!
HAS_PENDING_EXCEPTION
,
""
);
if
(
name
==
vmSymbols
::
object_initializer_name
())
{
LinkResolver
::
resolve_special_call
(
result
,
defc
,
name
,
type
,
KlassHandle
(),
false
,
THREAD
);
defc
,
name
,
type
,
caller
,
caller
.
not_null
()
,
THREAD
);
}
else
{
break
;
// will throw after end of switch
}
...
...
@@ -700,7 +720,7 @@ Handle MethodHandles::resolve_MemberName(Handle mname, TRAPS) {
fieldDescriptor
result
;
// find_field initializes fd if found
{
assert
(
!
HAS_PENDING_EXCEPTION
,
""
);
LinkResolver
::
resolve_field
(
result
,
defc
,
name
,
type
,
KlassHandle
()
,
Bytecodes
::
_nop
,
false
,
false
,
THREAD
);
LinkResolver
::
resolve_field
(
result
,
defc
,
name
,
type
,
caller
,
Bytecodes
::
_nop
,
false
,
false
,
THREAD
);
if
(
HAS_PENDING_EXCEPTION
)
{
return
empty
;
}
...
...
@@ -1121,7 +1141,11 @@ JVM_ENTRY(jobject, MHN_resolve_Mem(JNIEnv *env, jobject igcls, jobject mname_jh,
}
}
Handle
resolved
=
MethodHandles
::
resolve_MemberName
(
mname
,
CHECK_NULL
);
KlassHandle
caller
(
THREAD
,
caller_jh
==
NULL
?
(
Klass
*
)
NULL
:
java_lang_Class
::
as_Klass
(
JNIHandles
::
resolve_non_null
(
caller_jh
)));
Handle
resolved
=
MethodHandles
::
resolve_MemberName
(
mname
,
caller
,
CHECK_NULL
);
if
(
resolved
.
is_null
())
{
int
flags
=
java_lang_invoke_MemberName
::
flags
(
mname
());
int
ref_kind
=
(
flags
>>
REFERENCE_KIND_SHIFT
)
&
REFERENCE_KIND_MASK
;
...
...
src/share/vm/prims/methodHandles.hpp
浏览文件 @
eeede01a
...
...
@@ -55,7 +55,7 @@ class MethodHandles: AllStatic {
public:
// working with member names
static
Handle
resolve_MemberName
(
Handle
mname
,
TRAPS
);
// compute vmtarget/vmindex from name/type
static
Handle
resolve_MemberName
(
Handle
mname
,
KlassHandle
caller
,
TRAPS
);
// compute vmtarget/vmindex from name/type
static
void
expand_MemberName
(
Handle
mname
,
int
suppress
,
TRAPS
);
// expand defc/name/type if missing
static
Handle
new_MemberName
(
TRAPS
);
// must be followed by init_MemberName
static
oop
init_MemberName
(
Handle
mname_h
,
Handle
target_h
);
// compute vmtarget/vmindex from target
...
...
src/share/vm/runtime/os.cpp
浏览文件 @
eeede01a
...
...
@@ -1264,9 +1264,6 @@ bool os::set_boot_path(char fileSep, char pathSep) {
"%/lib/jce.jar:"
"%/lib/charsets.jar:"
"%/lib/jfr.jar:"
#ifdef __APPLE__
"%/lib/JObjC.jar:"
#endif
"%/classes"
;
char
*
sysclasspath
=
format_boot_path
(
classpath_format
,
home
,
home_len
,
fileSep
,
pathSep
);
if
(
sysclasspath
==
NULL
)
return
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录