Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
4d3e7c26
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看板
提交
4d3e7c26
编写于
1月 22, 2018
作者:
A
asaha
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
6550cffc
b0d16181
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
61 addition
and
18 deletion
+61
-18
.hgtags
.hgtags
+9
-0
src/share/vm/classfile/verificationType.cpp
src/share/vm/classfile/verificationType.cpp
+3
-1
src/share/vm/classfile/verifier.cpp
src/share/vm/classfile/verifier.cpp
+3
-1
src/share/vm/code/dependencies.cpp
src/share/vm/code/dependencies.cpp
+26
-0
src/share/vm/oops/cpCache.cpp
src/share/vm/oops/cpCache.cpp
+5
-6
src/share/vm/prims/jvm.cpp
src/share/vm/prims/jvm.cpp
+11
-3
test/runtime/RedefineTests/RedefineInterfaceCall.java
test/runtime/RedefineTests/RedefineInterfaceCall.java
+4
-7
未找到文件。
.hgtags
浏览文件 @
4d3e7c26
...
@@ -1035,6 +1035,11 @@ cdfe7ec6f29293d7c2f64239518e8947733ad85c jdk8u152-b12
...
@@ -1035,6 +1035,11 @@ cdfe7ec6f29293d7c2f64239518e8947733ad85c jdk8u152-b12
0a9d8db98fc5f0302da6520ba329f41baa092ae0 jdk8u152-b14
0a9d8db98fc5f0302da6520ba329f41baa092ae0 jdk8u152-b14
c1bf165d3b27e864a9f8eec5bb0c1e746a972ad5 jdk8u152-b15
c1bf165d3b27e864a9f8eec5bb0c1e746a972ad5 jdk8u152-b15
98b4b0661837817cc39047000e1a7efa6015af7c jdk8u152-b16
98b4b0661837817cc39047000e1a7efa6015af7c jdk8u152-b16
91894ffc746c1681172aaa37e2cf5bff69560f20 jdk8u152-b31
d278f122e65dfb5d239ed420a534df75f527a504 jdk8u152-b32
c066fe30d0a141b14ab7788cbbd35eba11196e72 jdk8u152-b33
12a0cebfae93a638dc69a34f8276e1ef43b11b7a jdk8u152-b34
f6719c3d02787da6e232703f61efc931ead7683b jdk8u152-b35
2d5100bddeb80cf767485b787fc3051311e3d7b9 jdk8u151-b00
2d5100bddeb80cf767485b787fc3051311e3d7b9 jdk8u151-b00
596b584c68b73ec635347807571463580deb955f jdk8u151-b01
596b584c68b73ec635347807571463580deb955f jdk8u151-b01
1f6f436360d5cd375b806aec1c78abb8fcb4e5f6 jdk8u151-b02
1f6f436360d5cd375b806aec1c78abb8fcb4e5f6 jdk8u151-b02
...
@@ -1125,6 +1130,10 @@ cd7f8ee4553d0f884ddc150ceefcb5b48b12ca21 jdk8u162-b06
...
@@ -1125,6 +1130,10 @@ cd7f8ee4553d0f884ddc150ceefcb5b48b12ca21 jdk8u162-b06
c3618e1cdefdda6c262f082791bfd988e0e9d9c9 jdk8u162-b10
c3618e1cdefdda6c262f082791bfd988e0e9d9c9 jdk8u162-b10
39e2895b795aded8b584626fb019d35f12e9d1e7 jdk8u162-b11
39e2895b795aded8b584626fb019d35f12e9d1e7 jdk8u162-b11
69aec2ca5d905dde1d0f29a89076d02a531808a3 jdk8u162-b12
69aec2ca5d905dde1d0f29a89076d02a531808a3 jdk8u162-b12
caac74fe3cfa9a8c859c28c97d1046a58252af27 jdk8u162-b31
a17bab9405474602b18cd62e060a09b17d6413ac jdk8u171-b00
ebfd57cc21e6b7f0c22b17c666b6b28c9340e207 jdk8u171-b01
1acd7c1b80241def8fac90f70b0df16356adad47 jdk8u171-b02
f299cf0b7baea1ae85f139f97adb9ab5499f402a jdk8u172-b00
f299cf0b7baea1ae85f139f97adb9ab5499f402a jdk8u172-b00
d10254debf7c1342416062bf1ba5258f16a8ce00 jdk8u172-b01
d10254debf7c1342416062bf1ba5258f16a8ce00 jdk8u172-b01
653d9e0cd3f4023675c9eece7f0d563287f1d34f jdk8u172-b02
653d9e0cd3f4023675c9eece7f0d563287f1d34f jdk8u172-b02
...
...
src/share/vm/classfile/verificationType.cpp
浏览文件 @
4d3e7c26
/*
/*
* Copyright (c) 2003, 201
6
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
7
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -63,6 +63,7 @@ bool VerificationType::is_reference_assignable_from(
...
@@ -63,6 +63,7 @@ bool VerificationType::is_reference_assignable_from(
name
(),
Handle
(
THREAD
,
klass
->
class_loader
()),
name
(),
Handle
(
THREAD
,
klass
->
class_loader
()),
Handle
(
THREAD
,
klass
->
protection_domain
()),
true
,
CHECK_false
);
Handle
(
THREAD
,
klass
->
protection_domain
()),
true
,
CHECK_false
);
KlassHandle
this_class
(
THREAD
,
obj
);
KlassHandle
this_class
(
THREAD
,
obj
);
klass
->
class_loader_data
()
->
record_dependency
(
obj
,
CHECK_false
);
if
(
this_class
->
is_interface
()
&&
(
!
from_field_is_protected
||
if
(
this_class
->
is_interface
()
&&
(
!
from_field_is_protected
||
from
.
name
()
!=
vmSymbols
::
java_lang_Object
()))
{
from
.
name
()
!=
vmSymbols
::
java_lang_Object
()))
{
...
@@ -74,6 +75,7 @@ bool VerificationType::is_reference_assignable_from(
...
@@ -74,6 +75,7 @@ bool VerificationType::is_reference_assignable_from(
Klass
*
from_class
=
SystemDictionary
::
resolve_or_fail
(
Klass
*
from_class
=
SystemDictionary
::
resolve_or_fail
(
from
.
name
(),
Handle
(
THREAD
,
klass
->
class_loader
()),
from
.
name
(),
Handle
(
THREAD
,
klass
->
class_loader
()),
Handle
(
THREAD
,
klass
->
protection_domain
()),
true
,
CHECK_false
);
Handle
(
THREAD
,
klass
->
protection_domain
()),
true
,
CHECK_false
);
klass
->
class_loader_data
()
->
record_dependency
(
from_class
,
CHECK_false
);
bool
result
=
InstanceKlass
::
cast
(
from_class
)
->
is_subclass_of
(
this_class
());
bool
result
=
InstanceKlass
::
cast
(
from_class
)
->
is_subclass_of
(
this_class
());
if
(
result
&&
DumpSharedSpaces
)
{
if
(
result
&&
DumpSharedSpaces
)
{
if
(
klass
()
->
is_subclass_of
(
from_class
)
&&
klass
()
->
is_subclass_of
(
this_class
()))
{
if
(
klass
()
->
is_subclass_of
(
from_class
)
&&
klass
()
->
is_subclass_of
(
this_class
()))
{
...
...
src/share/vm/classfile/verifier.cpp
浏览文件 @
4d3e7c26
...
@@ -1949,9 +1949,11 @@ Klass* ClassVerifier::load_class(Symbol* name, TRAPS) {
...
@@ -1949,9 +1949,11 @@ Klass* ClassVerifier::load_class(Symbol* name, TRAPS) {
oop
loader
=
current_class
()
->
class_loader
();
oop
loader
=
current_class
()
->
class_loader
();
oop
protection_domain
=
current_class
()
->
protection_domain
();
oop
protection_domain
=
current_class
()
->
protection_domain
();
return
SystemDictionary
::
resolve_or_fail
(
Klass
*
kls
=
SystemDictionary
::
resolve_or_fail
(
name
,
Handle
(
THREAD
,
loader
),
Handle
(
THREAD
,
protection_domain
),
name
,
Handle
(
THREAD
,
loader
),
Handle
(
THREAD
,
protection_domain
),
true
,
CHECK_NULL
);
true
,
CHECK_NULL
);
current_class
()
->
class_loader_data
()
->
record_dependency
(
kls
,
CHECK_NULL
);
return
kls
;
}
}
bool
ClassVerifier
::
is_protected_access
(
instanceKlassHandle
this_class
,
bool
ClassVerifier
::
is_protected_access
(
instanceKlassHandle
this_class
,
...
...
src/share/vm/code/dependencies.cpp
浏览文件 @
4d3e7c26
...
@@ -793,6 +793,14 @@ class ClassHierarchyWalker {
...
@@ -793,6 +793,14 @@ class ClassHierarchyWalker {
_signature
=
NULL
;
_signature
=
NULL
;
initialize
(
participant
);
initialize
(
participant
);
}
}
ClassHierarchyWalker
(
Klass
*
participants
[],
int
num_participants
)
{
_name
=
NULL
;
_signature
=
NULL
;
initialize
(
NULL
);
for
(
int
i
=
0
;
i
<
num_participants
;
++
i
)
{
add_participant
(
participants
[
i
]);
}
}
// This is common code for two searches: One for concrete subtypes,
// This is common code for two searches: One for concrete subtypes,
// the other for concrete method implementations and overrides.
// the other for concrete method implementations and overrides.
...
@@ -891,6 +899,24 @@ class ClassHierarchyWalker {
...
@@ -891,6 +899,24 @@ class ClassHierarchyWalker {
// Search class hierarchy first.
// Search class hierarchy first.
Method
*
m
=
InstanceKlass
::
cast
(
k
)
->
find_instance_method
(
_name
,
_signature
);
Method
*
m
=
InstanceKlass
::
cast
(
k
)
->
find_instance_method
(
_name
,
_signature
);
if
(
!
Dependencies
::
is_concrete_method
(
m
,
k
))
{
if
(
!
Dependencies
::
is_concrete_method
(
m
,
k
))
{
// Check for re-abstraction of method
if
(
!
k
->
is_interface
()
&&
m
!=
NULL
&&
m
->
is_abstract
())
{
// Found a matching abstract method 'm' in the class hierarchy.
// This is fine iff 'k' is an abstract class and all concrete subtypes
// of 'k' override 'm' and are participates of the current search.
ClassHierarchyWalker
wf
(
_participants
,
_num_participants
);
Klass
*
w
=
wf
.
find_witness_subtype
(
k
);
if
(
w
!=
NULL
)
{
Method
*
wm
=
InstanceKlass
::
cast
(
w
)
->
find_instance_method
(
_name
,
_signature
);
if
(
!
Dependencies
::
is_concrete_method
(
wm
,
w
))
{
// Found a concrete subtype 'w' which does not override abstract method 'm'.
// Bail out because 'm' could be called with 'w' as receiver (leading to an
// AbstractMethodError) and thus the method we are looking for is not unique.
_found_methods
[
_num_participants
]
=
m
;
return
true
;
}
}
}
// Check interface defaults also, if any exist.
// Check interface defaults also, if any exist.
Array
<
Method
*>*
default_methods
=
InstanceKlass
::
cast
(
k
)
->
default_methods
();
Array
<
Method
*>*
default_methods
=
InstanceKlass
::
cast
(
k
)
->
default_methods
();
if
(
default_methods
==
NULL
)
if
(
default_methods
==
NULL
)
...
...
src/share/vm/oops/cpCache.cpp
浏览文件 @
4d3e7c26
...
@@ -226,14 +226,13 @@ void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_co
...
@@ -226,14 +226,13 @@ void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_co
// virtual method in java.lang.Object. This is a corner case in the spec
// virtual method in java.lang.Object. This is a corner case in the spec
// but is presumably legal. javac does not generate this code.
// but is presumably legal. javac does not generate this code.
//
//
// We set bytecode_1() to _invokeinterface, because that is the
// We do not set bytecode_1() to _invokeinterface, because that is the
// bytecode # used by the interpreter to see if it is resolved.
// bytecode # used by the interpreter to see if it is resolved. In this
// case, the method gets reresolved with caller for each interface call
// because the actual selected method may not be public.
//
// We set bytecode_2() to _invokevirtual.
// We set bytecode_2() to _invokevirtual.
// See also interpreterRuntime.cpp. (8/25/2000)
// See also interpreterRuntime.cpp. (8/25/2000)
// Only set resolved for the invokeinterface case if method is public.
// Otherwise, the method needs to be reresolved with caller for each
// interface call.
if
(
method
->
is_public
())
set_bytecode_1
(
invoke_code
);
}
else
{
}
else
{
assert
(
invoke_code
==
Bytecodes
::
_invokevirtual
,
""
);
assert
(
invoke_code
==
Bytecodes
::
_invokevirtual
,
""
);
}
}
...
...
src/share/vm/prims/jvm.cpp
浏览文件 @
4d3e7c26
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "precompiled.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/classLoader.hpp"
#include "classfile/classLoaderData.inline.hpp"
#include "classfile/classLoaderExt.hpp"
#include "classfile/classLoaderExt.hpp"
#include "classfile/javaAssertions.hpp"
#include "classfile/javaAssertions.hpp"
#include "classfile/javaClasses.hpp"
#include "classfile/javaClasses.hpp"
...
@@ -952,6 +953,12 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name,
...
@@ -952,6 +953,12 @@ JVM_ENTRY(jclass, JVM_FindClassFromClass(JNIEnv *env, const char *name,
Handle
h_prot
(
THREAD
,
protection_domain
);
Handle
h_prot
(
THREAD
,
protection_domain
);
jclass
result
=
find_class_from_class_loader
(
env
,
h_name
,
init
,
h_loader
,
jclass
result
=
find_class_from_class_loader
(
env
,
h_name
,
init
,
h_loader
,
h_prot
,
true
,
thread
);
h_prot
,
true
,
thread
);
if
(
result
!=
NULL
)
{
oop
mirror
=
JNIHandles
::
resolve_non_null
(
result
);
Klass
*
to_class
=
java_lang_Class
::
as_Klass
(
mirror
);
ClassLoaderData
*
cld
=
ClassLoaderData
::
class_loader_data
(
h_loader
());
cld
->
record_dependency
(
to_class
,
CHECK_NULL
);
}
if
(
TraceClassResolution
&&
result
!=
NULL
)
{
if
(
TraceClassResolution
&&
result
!=
NULL
)
{
// this function is generally only used for class loading during verification.
// this function is generally only used for class loading during verification.
...
@@ -3654,15 +3661,16 @@ JVM_ENTRY(jobject, JVM_AllocateNewArray(JNIEnv *env, jobject obj, jclass currCla
...
@@ -3654,15 +3661,16 @@ JVM_ENTRY(jobject, JVM_AllocateNewArray(JNIEnv *env, jobject obj, jclass currCla
JVM_END
JVM_END
// Return the first non-null class loader up the execution stack, or null
// Returns first non-privileged class loader on the stack (excluding reflection
// if only code from the null class loader is on the stack.
// generated frames) or null if only classes loaded by the boot class loader
// and extension class loader are found on the stack.
JVM_ENTRY
(
jobject
,
JVM_LatestUserDefinedLoader
(
JNIEnv
*
env
))
JVM_ENTRY
(
jobject
,
JVM_LatestUserDefinedLoader
(
JNIEnv
*
env
))
for
(
vframeStream
vfst
(
thread
);
!
vfst
.
at_end
();
vfst
.
next
())
{
for
(
vframeStream
vfst
(
thread
);
!
vfst
.
at_end
();
vfst
.
next
())
{
// UseNewReflection
// UseNewReflection
vfst
.
skip_reflection_related_frames
();
// Only needed for 1.4 reflection
vfst
.
skip_reflection_related_frames
();
// Only needed for 1.4 reflection
oop
loader
=
vfst
.
method
()
->
method_holder
()
->
class_loader
();
oop
loader
=
vfst
.
method
()
->
method_holder
()
->
class_loader
();
if
(
loader
!=
NULL
)
{
if
(
loader
!=
NULL
&&
!
SystemDictionary
::
is_ext_class_loader
(
loader
)
)
{
return
JNIHandles
::
make_local
(
env
,
loader
);
return
JNIHandles
::
make_local
(
env
,
loader
);
}
}
}
}
...
...
test/runtime/RedefineTests/RedefineInterfaceCall.java
浏览文件 @
4d3e7c26
...
@@ -25,16 +25,13 @@
...
@@ -25,16 +25,13 @@
* @test
* @test
* @bug 8174962
* @bug 8174962
* @summary Redefine class with interface method call
* @summary Redefine class with interface method call
* @library /testlibrary /test/lib
* @library /testlibrary
* @modules java.base/jdk.internal.misc
* @build RedefineClassHelper
* @modules java.compiler
* java.instrument
* jdk.jartool/sun.tools.jar
* @run main RedefineClassHelper
* @run main RedefineClassHelper
* @run main/othervm -javaagent:redefineagent.jar RedefineInterfaceCall
* @run main/othervm -javaagent:redefineagent.jar
-XX:TraceRedefineClasses=3174407
RedefineInterfaceCall
*/
*/
import
static
jdk
.
testlibrary
.
Asserts
.
assertEquals
;
import
static
com
.
oracle
.
java
.
testlibrary
.
Asserts
.
assertEquals
;
interface
I1
{
default
int
m
()
{
return
0
;
}
}
interface
I1
{
default
int
m
()
{
return
0
;
}
}
interface
I2
extends
I1
{}
interface
I2
extends
I1
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录