Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
8cb8c440
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看板
提交
8cb8c440
编写于
10月 20, 2016
作者:
R
robm
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
2e093765
6dc54247
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
91 addition
and
82 deletion
+91
-82
ASSEMBLY_EXCEPTION
ASSEMBLY_EXCEPTION
+9
-9
src/cpu/x86/vm/vm_version_x86.cpp
src/cpu/x86/vm/vm_version_x86.cpp
+4
-4
src/share/vm/oops/instanceKlass.cpp
src/share/vm/oops/instanceKlass.cpp
+48
-48
src/share/vm/prims/unsafe.cpp
src/share/vm/prims/unsafe.cpp
+1
-9
test/runtime/lambda-features/TestInterfaceInit.java
test/runtime/lambda-features/TestInterfaceInit.java
+26
-9
test/testlibrary/com/oracle/java/testlibrary/Utils.java
test/testlibrary/com/oracle/java/testlibrary/Utils.java
+3
-3
未找到文件。
ASSEMBLY_EXCEPTION
浏览文件 @
8cb8c440
OPENJDK ASSEMBLY EXCEPTION
OPENJDK ASSEMBLY EXCEPTION
The OpenJDK source code made available by Oracle
at openjdk.java.net and
The OpenJDK source code made available by Oracle
America, Inc. (Oracle) at
openjdk.
dev.java.net ("OpenJDK Code") is distributed under the terms of the
openjdk.
java.net ("OpenJDK Code") is distributed under the terms of the GNU
G
NU G
eneral Public License <http://www.gnu.org/copyleft/gpl.html> version 2
General Public License <http://www.gnu.org/copyleft/gpl.html> version 2
only ("GPL2"), with the following clarification and special exception.
only ("GPL2"), with the following clarification and special exception.
Linking this OpenJDK Code statically or dynamically with other code
Linking this OpenJDK Code statically or dynamically with other code
...
@@ -19,9 +19,9 @@ only ("GPL2"), with the following clarification and special exception.
...
@@ -19,9 +19,9 @@ only ("GPL2"), with the following clarification and special exception.
provided that the Designated Exception Modules continue to be
provided that the Designated Exception Modules continue to be
governed by the licenses under which they were offered by Oracle.
governed by the licenses under which they were offered by Oracle.
As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code
to
As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code
build an executable that includes those portions of necessary code that Oracle
to build an executable that includes those portions of necessary code that
could not provide under GPL2 (or that Oracle has provided under GPL2 with the
Oracle could not provide under GPL2 (or that Oracle has provided under GPL2
Classpath exception). If you modify or add to the OpenJDK code, that new
with the Classpath exception). If you modify or add to the OpenJDK code,
GPL2 code may still be combined with Designated Exception Modules if the
that new GPL2 code may still be combined with Designated Exception Modules
new code is made subject to this exception by its copyright holder.
if the
new code is made subject to this exception by its copyright holder.
src/cpu/x86/vm/vm_version_x86.cpp
浏览文件 @
8cb8c440
...
@@ -704,16 +704,16 @@ void VM_Version::get_processor_features() {
...
@@ -704,16 +704,16 @@ void VM_Version::get_processor_features() {
UseMultiplyToLenIntrinsic
=
true
;
UseMultiplyToLenIntrinsic
=
true
;
}
}
if
(
FLAG_IS_DEFAULT
(
UseSquareToLenIntrinsic
))
{
if
(
FLAG_IS_DEFAULT
(
UseSquareToLenIntrinsic
))
{
UseSquareToLenIntrinsic
=
fals
e
;
UseSquareToLenIntrinsic
=
tru
e
;
}
}
if
(
FLAG_IS_DEFAULT
(
UseMulAddIntrinsic
))
{
if
(
FLAG_IS_DEFAULT
(
UseMulAddIntrinsic
))
{
UseMulAddIntrinsic
=
fals
e
;
UseMulAddIntrinsic
=
tru
e
;
}
}
if
(
FLAG_IS_DEFAULT
(
UseMontgomeryMultiplyIntrinsic
))
{
if
(
FLAG_IS_DEFAULT
(
UseMontgomeryMultiplyIntrinsic
))
{
UseMontgomeryMultiplyIntrinsic
=
fals
e
;
UseMontgomeryMultiplyIntrinsic
=
tru
e
;
}
}
if
(
FLAG_IS_DEFAULT
(
UseMontgomerySquareIntrinsic
))
{
if
(
FLAG_IS_DEFAULT
(
UseMontgomerySquareIntrinsic
))
{
UseMontgomerySquareIntrinsic
=
fals
e
;
UseMontgomerySquareIntrinsic
=
tru
e
;
}
}
#else
#else
if
(
UseMultiplyToLenIntrinsic
)
{
if
(
UseMultiplyToLenIntrinsic
)
{
...
...
src/share/vm/oops/instanceKlass.cpp
浏览文件 @
8cb8c440
...
@@ -616,7 +616,11 @@ bool InstanceKlass::link_class_or_fail(TRAPS) {
...
@@ -616,7 +616,11 @@ bool InstanceKlass::link_class_or_fail(TRAPS) {
bool
InstanceKlass
::
link_class_impl
(
bool
InstanceKlass
::
link_class_impl
(
instanceKlassHandle
this_oop
,
bool
throw_verifyerror
,
TRAPS
)
{
instanceKlassHandle
this_oop
,
bool
throw_verifyerror
,
TRAPS
)
{
// check for error state
// check for error state.
// This is checking for the wrong state. If the state is initialization_error,
// then this class *was* linked. The CDS code does a try_link_class and uses
// initialization_error to mark classes to not include in the archive during
// DumpSharedSpaces. This should be removed when the CDS bug is fixed.
if
(
this_oop
->
is_in_error_state
())
{
if
(
this_oop
->
is_in_error_state
())
{
ResourceMark
rm
(
THREAD
);
ResourceMark
rm
(
THREAD
);
THROW_MSG_
(
vmSymbols
::
java_lang_NoClassDefFoundError
(),
THROW_MSG_
(
vmSymbols
::
java_lang_NoClassDefFoundError
(),
...
@@ -801,37 +805,22 @@ void InstanceKlass::link_methods(TRAPS) {
...
@@ -801,37 +805,22 @@ void InstanceKlass::link_methods(TRAPS) {
}
}
// Eagerly initialize superinterfaces that declare default methods (concrete instance: any access)
// Eagerly initialize superinterfaces that declare default methods (concrete instance: any access)
void
InstanceKlass
::
initialize_super_interfaces
(
instanceKlassHandle
this_oop
,
TRAPS
)
{
void
InstanceKlass
::
initialize_super_interfaces
(
instanceKlassHandle
this_k
,
TRAPS
)
{
if
(
this_oop
->
has_default_methods
())
{
assert
(
this_k
->
has_default_methods
(),
"caller should have checked this"
);
for
(
int
i
=
0
;
i
<
this_oop
->
local_interfaces
()
->
length
();
++
i
)
{
for
(
int
i
=
0
;
i
<
this_k
->
local_interfaces
()
->
length
();
++
i
)
{
Klass
*
iface
=
this_oop
->
local_interfaces
()
->
at
(
i
);
Klass
*
iface
=
this_k
->
local_interfaces
()
->
at
(
i
);
InstanceKlass
*
ik
=
InstanceKlass
::
cast
(
iface
);
InstanceKlass
*
ik
=
InstanceKlass
::
cast
(
iface
);
if
(
ik
->
should_be_initialized
())
{
if
(
ik
->
has_default_methods
())
{
// Initialization is depth first search ie. we start with top of the inheritance tree
ik
->
initialize_super_interfaces
(
ik
,
THREAD
);
// has_default_methods drives searching superinterfaces since it
}
// means has_default_methods in its superinterface hierarchy
// Only initialize() interfaces that "declare" concrete methods.
if
(
ik
->
has_default_methods
())
{
// has_default_methods drives searching superinterfaces since it
ik
->
initialize_super_interfaces
(
ik
,
CHECK
);
// means has_default_methods in its superinterface hierarchy
}
if
(
!
HAS_PENDING_EXCEPTION
&&
ik
->
declares_default_methods
())
{
ik
->
initialize
(
THREAD
);
// Only initialize() interfaces that "declare" concrete methods.
}
if
(
ik
->
should_be_initialized
()
&&
ik
->
declares_default_methods
())
{
if
(
HAS_PENDING_EXCEPTION
)
{
ik
->
initialize
(
CHECK
);
Handle
e
(
THREAD
,
PENDING_EXCEPTION
);
CLEAR_PENDING_EXCEPTION
;
{
EXCEPTION_MARK
;
// Locks object, set state, and notify all waiting threads
this_oop
->
set_initialization_state_and_notify
(
initialization_error
,
THREAD
);
// ignore any exception thrown, superclass initialization error is
// thrown below
CLEAR_PENDING_EXCEPTION
;
}
THROW_OOP
(
e
());
}
}
}
}
}
}
}
}
...
@@ -897,30 +886,36 @@ void InstanceKlass::initialize_impl(instanceKlassHandle this_oop, TRAPS) {
...
@@ -897,30 +886,36 @@ void InstanceKlass::initialize_impl(instanceKlassHandle this_oop, TRAPS) {
}
}
// Step 7
// Step 7
Klass
*
super_klass
=
this_oop
->
super
();
// Next, if C is a class rather than an interface, initialize its super class and super
if
(
super_klass
!=
NULL
&&
!
this_oop
->
is_interface
()
&&
super_klass
->
should_be_initialized
())
{
// interfaces.
super_klass
->
initialize
(
THREAD
);
if
(
!
this_oop
->
is_interface
())
{
Klass
*
super_klass
=
this_oop
->
super
();
if
(
super_klass
!=
NULL
&&
super_klass
->
should_be_initialized
())
{
super_klass
->
initialize
(
THREAD
);
}
// If C implements any interfaces that declares a non-abstract, non-static method,
// the initialization of C triggers initialization of its super interfaces.
// Only need to recurse if has_default_methods which includes declaring and
// inheriting default methods
if
(
!
HAS_PENDING_EXCEPTION
&&
this_oop
->
has_default_methods
())
{
this_oop
->
initialize_super_interfaces
(
this_oop
,
THREAD
);
}
// If any exceptions, complete abruptly, throwing the same exception as above.
if
(
HAS_PENDING_EXCEPTION
)
{
if
(
HAS_PENDING_EXCEPTION
)
{
Handle
e
(
THREAD
,
PENDING_EXCEPTION
);
Handle
e
(
THREAD
,
PENDING_EXCEPTION
);
CLEAR_PENDING_EXCEPTION
;
CLEAR_PENDING_EXCEPTION
;
{
{
EXCEPTION_MARK
;
EXCEPTION_MARK
;
this_oop
->
set_initialization_state_and_notify
(
initialization_error
,
THREAD
);
// Locks object, set state, and notify all waiting threads
// Locks object, set state, and notify all waiting threads
CLEAR_PENDING_EXCEPTION
;
// ignore any exception thrown, superclass initialization error is thrown below
this_oop
->
set_initialization_state_and_notify
(
initialization_error
,
THREAD
);
CLEAR_PENDING_EXCEPTION
;
}
}
DTRACE_CLASSINIT_PROBE_WAIT
(
super__failed
,
InstanceKlass
::
cast
(
this_oop
()),
-
1
,
wait
);
DTRACE_CLASSINIT_PROBE_WAIT
(
super__failed
,
InstanceKlass
::
cast
(
this_oop
()),
-
1
,
wait
);
THROW_OOP
(
e
());
THROW_OOP
(
e
());
}
}
}
}
// Recursively initialize any superinterfaces that declare default methods
// Only need to recurse if has_default_methods which includes declaring and
// inheriting default methods
if
(
this_oop
->
has_default_methods
())
{
this_oop
->
initialize_super_interfaces
(
this_oop
,
CHECK
);
}
// Step 8
// Step 8
{
{
assert
(
THREAD
->
is_Java_thread
(),
"non-JavaThread in initialize_impl"
);
assert
(
THREAD
->
is_Java_thread
(),
"non-JavaThread in initialize_impl"
);
...
@@ -981,10 +976,15 @@ void InstanceKlass::set_initialization_state_and_notify(ClassState state, TRAPS)
...
@@ -981,10 +976,15 @@ void InstanceKlass::set_initialization_state_and_notify(ClassState state, TRAPS)
void
InstanceKlass
::
set_initialization_state_and_notify_impl
(
instanceKlassHandle
this_oop
,
ClassState
state
,
TRAPS
)
{
void
InstanceKlass
::
set_initialization_state_and_notify_impl
(
instanceKlassHandle
this_oop
,
ClassState
state
,
TRAPS
)
{
oop
init_lock
=
this_oop
->
init_lock
();
oop
init_lock
=
this_oop
->
init_lock
();
ObjectLocker
ol
(
init_lock
,
THREAD
,
init_lock
!=
NULL
);
if
(
init_lock
!=
NULL
)
{
this_oop
->
set_init_state
(
state
);
ObjectLocker
ol
(
init_lock
,
THREAD
);
this_oop
->
fence_and_clear_init_lock
();
this_oop
->
set_init_state
(
state
);
ol
.
notify_all
(
CHECK
);
this_oop
->
fence_and_clear_init_lock
();
ol
.
notify_all
(
CHECK
);
}
else
{
assert
(
init_lock
!=
NULL
,
"The initialization state should never be set twice"
);
this_oop
->
set_init_state
(
state
);
}
}
}
// The embedded _implementor field can only record one implementor.
// The embedded _implementor field can only record one implementor.
...
...
src/share/vm/prims/unsafe.cpp
浏览文件 @
8cb8c440
...
@@ -985,14 +985,6 @@ UNSAFE_ENTRY(jclass, Unsafe_DefineClass(JNIEnv *env, jobject unsafe, jstring nam
...
@@ -985,14 +985,6 @@ UNSAFE_ENTRY(jclass, Unsafe_DefineClass(JNIEnv *env, jobject unsafe, jstring nam
}
}
UNSAFE_END
UNSAFE_END
static
jobject
get_class_loader
(
JNIEnv
*
env
,
jclass
cls
)
{
if
(
java_lang_Class
::
is_primitive
(
JNIHandles
::
resolve_non_null
(
cls
)))
{
return
NULL
;
}
Klass
*
k
=
java_lang_Class
::
as_Klass
(
JNIHandles
::
resolve_non_null
(
cls
));
oop
loader
=
k
->
class_loader
();
return
JNIHandles
::
make_local
(
env
,
loader
);
}
UNSAFE_ENTRY
(
jclass
,
Unsafe_DefineClass0
(
JNIEnv
*
env
,
jobject
unsafe
,
jstring
name
,
jbyteArray
data
,
int
offset
,
int
length
))
UNSAFE_ENTRY
(
jclass
,
Unsafe_DefineClass0
(
JNIEnv
*
env
,
jobject
unsafe
,
jstring
name
,
jbyteArray
data
,
int
offset
,
int
length
))
UnsafeWrapper
(
"Unsafe_DefineClass"
);
UnsafeWrapper
(
"Unsafe_DefineClass"
);
...
@@ -1001,7 +993,7 @@ UNSAFE_ENTRY(jclass, Unsafe_DefineClass0(JNIEnv *env, jobject unsafe, jstring na
...
@@ -1001,7 +993,7 @@ UNSAFE_ENTRY(jclass, Unsafe_DefineClass0(JNIEnv *env, jobject unsafe, jstring na
int
depthFromDefineClass0
=
1
;
int
depthFromDefineClass0
=
1
;
jclass
caller
=
JVM_GetCallerClass
(
env
,
depthFromDefineClass0
);
jclass
caller
=
JVM_GetCallerClass
(
env
,
depthFromDefineClass0
);
jobject
loader
=
(
caller
==
NULL
)
?
NULL
:
get_class_l
oader
(
env
,
caller
);
jobject
loader
=
(
caller
==
NULL
)
?
NULL
:
JVM_GetClassL
oader
(
env
,
caller
);
jobject
pd
=
(
caller
==
NULL
)
?
NULL
:
JVM_GetProtectionDomain
(
env
,
caller
);
jobject
pd
=
(
caller
==
NULL
)
?
NULL
:
JVM_GetProtectionDomain
(
env
,
caller
);
return
Unsafe_DefineClass_impl
(
env
,
name
,
data
,
offset
,
length
,
loader
,
pd
);
return
Unsafe_DefineClass_impl
(
env
,
name
,
data
,
offset
,
length
,
loader
,
pd
);
...
...
test/runtime/lambda-features/TestInterfaceInit.java
浏览文件 @
8cb8c440
/*
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014,
2016,
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
...
@@ -25,7 +25,8 @@
...
@@ -25,7 +25,8 @@
/*
/*
* @test
* @test
* @bug 8034275
* @bug 8034275
* @summary [JDK 8u40] Test interface initialization: only for interfaces declaring default methods
* @bug 8163969
* @summary [JDK 8u40] Test interface init: only for interfaces declaring default methods, when subclass inits
* @run main TestInterfaceInit
* @run main TestInterfaceInit
*/
*/
import
java.util.List
;
import
java.util.List
;
...
@@ -39,43 +40,59 @@ public class TestInterfaceInit {
...
@@ -39,43 +40,59 @@ public class TestInterfaceInit {
// Declares a default method and initializes
// Declares a default method and initializes
interface
I
{
interface
I
{
boolean
v
=
TestInterfaceInit
.
out
(
I
.
class
);
boolean
v
=
TestInterfaceInit
.
out
(
I
.
class
);
default
void
x
()
{}
default
void
i
x
()
{}
}
}
// Declares a default method and initializes
// Declares a default method and initializes
interface
J
extends
I
{
interface
J
extends
I
{
boolean
v
=
TestInterfaceInit
.
out
(
J
.
class
);
boolean
v
=
TestInterfaceInit
.
out
(
J
.
class
);
default
void
x
()
{}
default
void
j
x
()
{}
}
}
// No default method, does not initialize
// No default method,
has an abstract method,
does not initialize
interface
JN
extends
J
{
interface
JN
extends
J
{
boolean
v
=
TestInterfaceInit
.
out
(
JN
.
class
);
boolean
v
=
TestInterfaceInit
.
out
(
JN
.
class
);
public
abstract
void
jnx
();
}
}
// Declares a default method and initializes
// Declares a default method and initializes
interface
K
extends
I
{
interface
K
extends
I
{
boolean
v
=
TestInterfaceInit
.
out
(
K
.
class
);
boolean
v
=
TestInterfaceInit
.
out
(
K
.
class
);
default
void
x
()
{}
default
void
k
x
()
{}
}
}
// No default method, does not initialize
// No default method,
has a static method,
does not initialize
interface
KN
extends
K
{
interface
KN
extends
K
{
boolean
v
=
TestInterfaceInit
.
out
(
KN
.
class
);
boolean
v
=
TestInterfaceInit
.
out
(
KN
.
class
);
static
void
knx
()
{}
}
}
interface
L
extends
JN
,
KN
{
interface
L
extends
JN
,
KN
{
boolean
v
=
TestInterfaceInit
.
out
(
L
.
class
);
boolean
v
=
TestInterfaceInit
.
out
(
L
.
class
);
default
void
x
()
{}
default
void
lx
()
{}
}
static
class
ChildClass
implements
JN
,
KN
{
boolean
v
=
TestInterfaceInit
.
out
(
ChildClass
.
class
);
public
void
jnx
()
{}
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// Trigger initialization
// Trigger initialization
boolean
v
=
L
.
v
;
boolean
v
=
L
.
v
;
List
<
Class
<?>>
expectedCInitOrder
=
Arrays
.
asList
(
I
.
class
,
J
.
class
,
K
.
class
,
L
.
class
);
List
<
Class
<?>>
expectedCInitOrder
=
Arrays
.
asList
(
L
.
class
);
if
(!
cInitOrder
.
equals
(
expectedCInitOrder
))
{
throw
new
RuntimeException
(
String
.
format
(
"Class initialization array %s not equal to expected array %s"
,
cInitOrder
,
expectedCInitOrder
));
}
ChildClass
myC
=
new
ChildClass
();
boolean
w
=
myC
.
v
;
expectedCInitOrder
=
Arrays
.
asList
(
L
.
class
,
I
.
class
,
J
.
class
,
K
.
class
,
ChildClass
.
class
);
if
(!
cInitOrder
.
equals
(
expectedCInitOrder
))
{
if
(!
cInitOrder
.
equals
(
expectedCInitOrder
))
{
throw
new
RuntimeException
(
String
.
format
(
"Class initialization array %s not equal to expected array %s"
,
cInitOrder
,
expectedCInitOrder
));
throw
new
RuntimeException
(
String
.
format
(
"Class initialization array %s not equal to expected array %s"
,
cInitOrder
,
expectedCInitOrder
));
}
}
}
}
static
boolean
out
(
Class
c
)
{
static
boolean
out
(
Class
c
)
{
...
...
test/testlibrary/com/oracle/java/testlibrary/Utils.java
浏览文件 @
8cb8c440
/*
/*
* Copyright (c) 2013, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 201
6
, 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
...
@@ -260,8 +260,8 @@ public final class Utils {
...
@@ -260,8 +260,8 @@ public final class Utils {
output
=
ProcessTools
.
executeProcess
(
jcmdLauncher
.
getCommand
());
output
=
ProcessTools
.
executeProcess
(
jcmdLauncher
.
getCommand
());
output
.
shouldHaveExitValue
(
0
);
output
.
shouldHaveExitValue
(
0
);
// Search for a line starting with numbers (pid), follwed by the key.
// Search for a line starting with numbers (pid), foll
o
wed by the key.
Pattern
pattern
=
Pattern
.
compile
(
"
([0-9]+)\\s.*("
+
key
+
").*\\r?\\n"
);
Pattern
pattern
=
Pattern
.
compile
(
"
^([0-9]+)\\s.*("
+
key
+
")"
,
Pattern
.
MULTILINE
);
Matcher
matcher
=
pattern
.
matcher
(
output
.
getStdout
());
Matcher
matcher
=
pattern
.
matcher
(
output
.
getStdout
());
int
pid
=
-
1
;
int
pid
=
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录