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
The OpenJDK source code made available by Oracle
at openjdk.java.net and
openjdk.
dev.java.net ("OpenJDK Code") is distributed under the terms of the
G
NU G
eneral Public License <http://www.gnu.org/copyleft/gpl.html> version 2
The OpenJDK source code made available by Oracle
America, Inc. (Oracle) at
openjdk.
java.net ("OpenJDK Code") is distributed under the terms of the GNU
General Public License <http://www.gnu.org/copyleft/gpl.html> version 2
only ("GPL2"), with the following clarification and special exception.
Linking this OpenJDK Code statically or dynamically with other code
...
...
@@ -19,9 +19,9 @@ only ("GPL2"), with the following clarification and special exception.
provided that the Designated Exception Modules continue to be
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
build an executable that includes those portions of necessary code that Oracle
could not provide under GPL2 (or that Oracle has provided under GPL2 with the
Classpath exception). If you modify or add to the OpenJDK code, that new
GPL2 code may still be combined with Designated Exception Modules if the
new code is made subject to this exception by its copyright holder.
As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code
to build an executable that includes those portions of necessary code that
Oracle could not provide under GPL2 (or that Oracle has provided under GPL2
with the Classpath exception). If you modify or add to the OpenJDK code,
that new GPL2 code may still be combined with Designated Exception Modules
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() {
UseMultiplyToLenIntrinsic
=
true
;
}
if
(
FLAG_IS_DEFAULT
(
UseSquareToLenIntrinsic
))
{
UseSquareToLenIntrinsic
=
fals
e
;
UseSquareToLenIntrinsic
=
tru
e
;
}
if
(
FLAG_IS_DEFAULT
(
UseMulAddIntrinsic
))
{
UseMulAddIntrinsic
=
fals
e
;
UseMulAddIntrinsic
=
tru
e
;
}
if
(
FLAG_IS_DEFAULT
(
UseMontgomeryMultiplyIntrinsic
))
{
UseMontgomeryMultiplyIntrinsic
=
fals
e
;
UseMontgomeryMultiplyIntrinsic
=
tru
e
;
}
if
(
FLAG_IS_DEFAULT
(
UseMontgomerySquareIntrinsic
))
{
UseMontgomerySquareIntrinsic
=
fals
e
;
UseMontgomerySquareIntrinsic
=
tru
e
;
}
#else
if
(
UseMultiplyToLenIntrinsic
)
{
...
...
src/share/vm/oops/instanceKlass.cpp
浏览文件 @
8cb8c440
...
...
@@ -616,7 +616,11 @@ bool InstanceKlass::link_class_or_fail(TRAPS) {
bool
InstanceKlass
::
link_class_impl
(
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
())
{
ResourceMark
rm
(
THREAD
);
THROW_MSG_
(
vmSymbols
::
java_lang_NoClassDefFoundError
(),
...
...
@@ -801,37 +805,22 @@ void InstanceKlass::link_methods(TRAPS) {
}
// Eagerly initialize superinterfaces that declare default methods (concrete instance: any access)
void
InstanceKlass
::
initialize_super_interfaces
(
instanceKlassHandle
this_
oop
,
TRAPS
)
{
if
(
this_oop
->
has_default_methods
())
{
for
(
int
i
=
0
;
i
<
this_oop
->
local_interfaces
()
->
length
();
++
i
)
{
Klass
*
iface
=
this_oop
->
local_interfaces
()
->
at
(
i
);
void
InstanceKlass
::
initialize_super_interfaces
(
instanceKlassHandle
this_
k
,
TRAPS
)
{
assert
(
this_k
->
has_default_methods
(),
"caller should have checked this"
);
for
(
int
i
=
0
;
i
<
this_k
->
local_interfaces
()
->
length
();
++
i
)
{
Klass
*
iface
=
this_k
->
local_interfaces
()
->
at
(
i
);
InstanceKlass
*
ik
=
InstanceKlass
::
cast
(
iface
);
if
(
ik
->
should_be_initialized
())
{
if
(
ik
->
has_default_methods
())
{
ik
->
initialize_super_interfaces
(
ik
,
THREAD
);
}
// Only initialize() interfaces that "declare" concrete methods.
// Initialization is depth first search ie. we start with top of the inheritance tree
// has_default_methods drives searching superinterfaces since it
// means has_default_methods in its superinterface hierarchy
if
(
!
HAS_PENDING_EXCEPTION
&&
ik
->
declare
s_default_methods
())
{
ik
->
initialize
(
THREAD
);
if
(
ik
->
ha
s_default_methods
())
{
ik
->
initialize_super_interfaces
(
ik
,
CHECK
);
}
if
(
HAS_PENDING_EXCEPTION
)
{
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
());
}
}
// Only initialize() interfaces that "declare" concrete methods.
if
(
ik
->
should_be_initialized
()
&&
ik
->
declares_default_methods
())
{
ik
->
initialize
(
CHECK
);
}
}
}
...
...
@@ -897,30 +886,36 @@ void InstanceKlass::initialize_impl(instanceKlassHandle this_oop, TRAPS) {
}
// Step 7
// Next, if C is a class rather than an interface, initialize its super class and super
// interfaces.
if
(
!
this_oop
->
is_interface
())
{
Klass
*
super_klass
=
this_oop
->
super
();
if
(
super_klass
!=
NULL
&&
!
this_oop
->
is_interface
()
&&
super_klass
->
should_be_initialized
())
{
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
)
{
Handle
e
(
THREAD
,
PENDING_EXCEPTION
);
CLEAR_PENDING_EXCEPTION
;
{
EXCEPTION_MARK
;
this_oop
->
set_initialization_state_and_notify
(
initialization_error
,
THREAD
);
// Locks object, set state, and notify all waiting threads
CLEAR_PENDING_EXCEPTION
;
// ignore any exception thrown, superclass initialization error is thrown below
// Locks object, set state, and notify all waiting threads
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
);
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
{
assert
(
THREAD
->
is_Java_thread
(),
"non-JavaThread in initialize_impl"
);
...
...
@@ -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
)
{
oop
init_lock
=
this_oop
->
init_lock
();
ObjectLocker
ol
(
init_lock
,
THREAD
,
init_lock
!=
NULL
);
if
(
init_lock
!=
NULL
)
{
ObjectLocker
ol
(
init_lock
,
THREAD
);
this_oop
->
set_init_state
(
state
);
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.
...
...
src/share/vm/prims/unsafe.cpp
浏览文件 @
8cb8c440
...
...
@@ -985,14 +985,6 @@ UNSAFE_ENTRY(jclass, Unsafe_DefineClass(JNIEnv *env, jobject unsafe, jstring nam
}
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
))
UnsafeWrapper
(
"Unsafe_DefineClass"
);
...
...
@@ -1001,7 +993,7 @@ UNSAFE_ENTRY(jclass, Unsafe_DefineClass0(JNIEnv *env, jobject unsafe, jstring na
int
depthFromDefineClass0
=
1
;
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
);
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.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -25,7 +25,8 @@
/*
* @test
* @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
*/
import
java.util.List
;
...
...
@@ -39,43 +40,59 @@ public class TestInterfaceInit {
// Declares a default method and initializes
interface
I
{
boolean
v
=
TestInterfaceInit
.
out
(
I
.
class
);
default
void
x
()
{}
default
void
i
x
()
{}
}
// Declares a default method and initializes
interface
J
extends
I
{
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
{
boolean
v
=
TestInterfaceInit
.
out
(
JN
.
class
);
public
abstract
void
jnx
();
}
// Declares a default method and initializes
interface
K
extends
I
{
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
{
boolean
v
=
TestInterfaceInit
.
out
(
KN
.
class
);
static
void
knx
()
{}
}
interface
L
extends
JN
,
KN
{
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
)
{
// Trigger initialization
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
))
{
throw
new
RuntimeException
(
String
.
format
(
"Class initialization array %s not equal to expected array %s"
,
cInitOrder
,
expectedCInitOrder
));
}
}
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.
*
* This code is free software; you can redistribute it and/or modify it
...
...
@@ -260,8 +260,8 @@ public final class Utils {
output
=
ProcessTools
.
executeProcess
(
jcmdLauncher
.
getCommand
());
output
.
shouldHaveExitValue
(
0
);
// Search for a line starting with numbers (pid), follwed by the key.
Pattern
pattern
=
Pattern
.
compile
(
"
([0-9]+)\\s.*("
+
key
+
").*\\r?\\n"
);
// Search for a line starting with numbers (pid), foll
o
wed by the key.
Pattern
pattern
=
Pattern
.
compile
(
"
^([0-9]+)\\s.*("
+
key
+
")"
,
Pattern
.
MULTILINE
);
Matcher
matcher
=
pattern
.
matcher
(
output
.
getStdout
());
int
pid
=
-
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录