Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
889f6d33
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看板
提交
889f6d33
编写于
10月 21, 2011
作者:
I
iveresov
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
fdd5e33d
e5f0f94b
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
259 addition
and
26 deletion
+259
-26
agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java
...are/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java
+1
-1
src/cpu/sparc/vm/copy_sparc.hpp
src/cpu/sparc/vm/copy_sparc.hpp
+27
-5
src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp
src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp
+27
-5
src/share/vm/classfile/javaClasses.cpp
src/share/vm/classfile/javaClasses.cpp
+9
-6
src/share/vm/classfile/javaClasses.hpp
src/share/vm/classfile/javaClasses.hpp
+1
-0
src/share/vm/gc_interface/collectedHeap.cpp
src/share/vm/gc_interface/collectedHeap.cpp
+35
-0
src/share/vm/gc_interface/collectedHeap.hpp
src/share/vm/gc_interface/collectedHeap.hpp
+3
-0
src/share/vm/oops/instanceMirrorKlass.cpp
src/share/vm/oops/instanceMirrorKlass.cpp
+1
-9
test/runtime/7100935/TestConjointAtomicArraycopy.java
test/runtime/7100935/TestConjointAtomicArraycopy.java
+78
-0
test/runtime/7100935/TestShortArraycopy.java
test/runtime/7100935/TestShortArraycopy.java
+77
-0
未找到文件。
agent/src/share/classes/sun/jvm/hotspot/runtime/sparc/SPARCFrame.java
浏览文件 @
889f6d33
...
...
@@ -956,7 +956,7 @@ public class SPARCFrame extends Frame {
map
.
makeIntegerRegsUnsaved
();
map
.
shiftWindow
(
sp
,
youngerSP
);
boolean
thisFrameAdjustedStack
=
true
;
// I5_savedSP is live in this RF
return
new
SPARCFrame
(
sp
,
youngerSP
,
thisFrameAdjustedStack
);
return
new
SPARCFrame
(
biasSP
(
sp
),
biasSP
(
youngerSP
)
,
thisFrameAdjustedStack
);
}
private
Frame
senderForEntryFrame
(
RegisterMap
regMap
)
{
...
...
src/cpu/sparc/vm/copy_sparc.hpp
浏览文件 @
889f6d33
/*
* Copyright (c) 2003, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
1
, 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
...
...
@@ -82,13 +82,35 @@ static void pd_conjoint_bytes_atomic(void* from, void* to, size_t count) {
}
static
void
pd_conjoint_jshorts_atomic
(
jshort
*
from
,
jshort
*
to
,
size_t
count
)
{
// FIXME
(
void
)
memmove
(
to
,
from
,
count
<<
LogBytesPerShort
);
if
(
from
>
to
)
{
while
(
count
--
>
0
)
{
// Copy forwards
*
to
++
=
*
from
++
;
}
}
else
{
from
+=
count
-
1
;
to
+=
count
-
1
;
while
(
count
--
>
0
)
{
// Copy backwards
*
to
--
=
*
from
--
;
}
}
}
static
void
pd_conjoint_jints_atomic
(
jint
*
from
,
jint
*
to
,
size_t
count
)
{
// FIXME
(
void
)
memmove
(
to
,
from
,
count
<<
LogBytesPerInt
);
if
(
from
>
to
)
{
while
(
count
--
>
0
)
{
// Copy forwards
*
to
++
=
*
from
++
;
}
}
else
{
from
+=
count
-
1
;
to
+=
count
-
1
;
while
(
count
--
>
0
)
{
// Copy backwards
*
to
--
=
*
from
--
;
}
}
}
static
void
pd_conjoint_jlongs_atomic
(
jlong
*
from
,
jlong
*
to
,
size_t
count
)
{
...
...
src/os_cpu/windows_x86/vm/copy_windows_x86.inline.hpp
浏览文件 @
889f6d33
/*
* Copyright (c) 2003, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
1
, 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
...
...
@@ -85,13 +85,35 @@ static void pd_conjoint_bytes_atomic(void* from, void* to, size_t count) {
}
static
void
pd_conjoint_jshorts_atomic
(
jshort
*
from
,
jshort
*
to
,
size_t
count
)
{
// FIXME
(
void
)
memmove
(
to
,
from
,
count
<<
LogBytesPerShort
);
if
(
from
>
to
)
{
while
(
count
--
>
0
)
{
// Copy forwards
*
to
++
=
*
from
++
;
}
}
else
{
from
+=
count
-
1
;
to
+=
count
-
1
;
while
(
count
--
>
0
)
{
// Copy backwards
*
to
--
=
*
from
--
;
}
}
}
static
void
pd_conjoint_jints_atomic
(
jint
*
from
,
jint
*
to
,
size_t
count
)
{
// FIXME
(
void
)
memmove
(
to
,
from
,
count
<<
LogBytesPerInt
);
if
(
from
>
to
)
{
while
(
count
--
>
0
)
{
// Copy forwards
*
to
++
=
*
from
++
;
}
}
else
{
from
+=
count
-
1
;
to
+=
count
-
1
;
while
(
count
--
>
0
)
{
// Copy backwards
*
to
--
=
*
from
--
;
}
}
}
static
void
pd_conjoint_jlongs_atomic
(
jlong
*
from
,
jlong
*
to
,
size_t
count
)
{
...
...
src/share/vm/classfile/javaClasses.cpp
浏览文件 @
889f6d33
...
...
@@ -503,12 +503,8 @@ oop java_lang_Class::create_mirror(KlassHandle k, TRAPS) {
if
(
SystemDictionary
::
Class_klass_loaded
()
&&
(
k
->
oop_is_instance
()
||
k
->
oop_is_javaArray
()))
{
// Allocate mirror (java.lang.Class instance)
Handle
mirror
=
instanceMirrorKlass
::
cast
(
SystemDictionary
::
Class_klass
())
->
allocate_instance
(
k
,
CHECK_0
);
// Setup indirections
mirror
->
obj_field_put
(
_klass_offset
,
k
());
k
->
set_java_mirror
(
mirror
());
instanceMirrorKlass
*
mk
=
instanceMirrorKlass
::
cast
(
mirror
->
klass
());
java_lang_Class
::
set_oop_size
(
mirror
(),
mk
->
instance_size
(
k
));
java_lang_Class
::
set_static_oop_field_count
(
mirror
(),
mk
->
compute_static_oop_field_count
(
mirror
()));
// It might also have a component mirror. This mirror must already exist.
...
...
@@ -571,9 +567,10 @@ oop java_lang_Class::create_basic_type_mirror(const char* basic_type_name, Basic
assert
(
aklass
!=
NULL
,
"correct bootstrap"
);
set_array_klass
(
java_class
,
aklass
);
}
#ifdef ASSERT
instanceMirrorKlass
*
mk
=
instanceMirrorKlass
::
cast
(
SystemDictionary
::
Class_klass
());
java_lang_Class
::
set_oop_size
(
java_class
,
mk
->
instance_size
(
oop
(
NULL
))
);
java_lang_Class
::
set_static_oop_field_count
(
java_class
,
0
);
assert
(
java_lang_Class
::
static_oop_field_count
(
java_class
)
==
0
,
"should have been zeroed by allocation"
);
#endif
return
java_class
;
}
...
...
@@ -587,6 +584,12 @@ klassOop java_lang_Class::as_klassOop(oop java_class) {
}
void
java_lang_Class
::
set_klass
(
oop
java_class
,
klassOop
klass
)
{
assert
(
java_lang_Class
::
is_instance
(
java_class
),
"must be a Class object"
);
java_class
->
obj_field_put
(
_klass_offset
,
klass
);
}
void
java_lang_Class
::
print_signature
(
oop
java_class
,
outputStream
*
st
)
{
assert
(
java_lang_Class
::
is_instance
(
java_class
),
"must be a Class object"
);
Symbol
*
name
=
NULL
;
...
...
src/share/vm/classfile/javaClasses.hpp
浏览文件 @
889f6d33
...
...
@@ -188,6 +188,7 @@ class java_lang_Class : AllStatic {
static
oop
create_basic_type_mirror
(
const
char
*
basic_type_name
,
BasicType
type
,
TRAPS
);
// Conversion
static
klassOop
as_klassOop
(
oop
java_class
);
static
void
set_klass
(
oop
java_class
,
klassOop
klass
);
static
BasicType
as_BasicType
(
oop
java_class
,
klassOop
*
reference_klass
=
NULL
);
static
BasicType
as_BasicType
(
oop
java_class
,
KlassHandle
*
reference_klass
)
{
klassOop
refk_oop
=
NULL
;
...
...
src/share/vm/gc_interface/collectedHeap.cpp
浏览文件 @
889f6d33
...
...
@@ -28,6 +28,7 @@
#include "gc_interface/collectedHeap.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "oops/oop.inline.hpp"
#include "oops/instanceMirrorKlass.hpp"
#include "runtime/init.hpp"
#include "services/heapDumper.hpp"
#ifdef TARGET_OS_FAMILY_linux
...
...
@@ -436,3 +437,37 @@ void CollectedHeap::post_full_gc_dump() {
inspector
.
doit
();
}
}
oop
CollectedHeap
::
Class_obj_allocate
(
KlassHandle
klass
,
int
size
,
KlassHandle
real_klass
,
TRAPS
)
{
debug_only
(
check_for_valid_allocation_state
());
assert
(
!
Universe
::
heap
()
->
is_gc_active
(),
"Allocation during gc not allowed"
);
assert
(
size
>=
0
,
"int won't convert to size_t"
);
HeapWord
*
obj
;
if
(
JavaObjectsInPerm
)
{
obj
=
common_permanent_mem_allocate_init
(
size
,
CHECK_NULL
);
}
else
{
assert
(
ScavengeRootsInCode
>
0
,
"must be"
);
obj
=
common_mem_allocate_init
(
size
,
CHECK_NULL
);
}
post_allocation_setup_common
(
klass
,
obj
,
size
);
assert
(
Universe
::
is_bootstrapping
()
||
!
((
oop
)
obj
)
->
blueprint
()
->
oop_is_array
(),
"must not be an array"
);
NOT_PRODUCT
(
Universe
::
heap
()
->
check_for_bad_heap_word_value
(
obj
,
size
));
oop
mirror
=
(
oop
)
obj
;
java_lang_Class
::
set_oop_size
(
mirror
,
size
);
// Setup indirections
if
(
!
real_klass
.
is_null
())
{
java_lang_Class
::
set_klass
(
mirror
,
real_klass
());
real_klass
->
set_java_mirror
(
mirror
);
}
instanceMirrorKlass
*
mk
=
instanceMirrorKlass
::
cast
(
mirror
->
klass
());
assert
(
size
==
mk
->
instance_size
(
real_klass
),
"should have been set"
);
// notify jvmti and dtrace
post_allocation_notify
(
klass
,
(
oop
)
obj
);
return
mirror
;
}
src/share/vm/gc_interface/collectedHeap.hpp
浏览文件 @
889f6d33
...
...
@@ -319,6 +319,9 @@ class CollectedHeap : public CHeapObj {
// VM (then terminate).
virtual
void
preload_and_dump
(
TRAPS
)
{
ShouldNotReachHere
();
}
// Allocate and initialize instances of Class
static
oop
Class_obj_allocate
(
KlassHandle
klass
,
int
size
,
KlassHandle
real_klass
,
TRAPS
);
// General obj/array allocation facilities.
inline
static
oop
obj_allocate
(
KlassHandle
klass
,
int
size
,
TRAPS
);
inline
static
oop
array_allocate
(
KlassHandle
klass
,
int
size
,
int
length
,
TRAPS
);
...
...
src/share/vm/oops/instanceMirrorKlass.cpp
浏览文件 @
889f6d33
...
...
@@ -288,15 +288,7 @@ instanceOop instanceMirrorKlass::allocate_instance(KlassHandle k, TRAPS) {
// Query before forming handle.
int
size
=
instance_size
(
k
);
KlassHandle
h_k
(
THREAD
,
as_klassOop
());
instanceOop
i
;
if
(
JavaObjectsInPerm
)
{
i
=
(
instanceOop
)
CollectedHeap
::
permanent_obj_allocate
(
h_k
,
size
,
CHECK_NULL
);
}
else
{
assert
(
ScavengeRootsInCode
>
0
,
"must be"
);
i
=
(
instanceOop
)
CollectedHeap
::
obj_allocate
(
h_k
,
size
,
CHECK_NULL
);
}
instanceOop
i
=
(
instanceOop
)
CollectedHeap
::
Class_obj_allocate
(
h_k
,
size
,
k
,
CHECK_NULL
);
return
i
;
}
...
...
test/runtime/7100935/TestConjointAtomicArraycopy.java
0 → 100644
浏览文件 @
889f6d33
/*
* Copyright 2011 SAP AG. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test TestConjointAtomicArraycopy
* @bug 7100935
* @summary verify that oops are copied element-wise atomic
* @run main/othervm -Xint TestConjointAtomicArraycopy
* @run main/othervm -Xcomp -Xbatch TestConjointAtomicArraycopy
* @author axel.siebenborn@sap.com
*/
public
class
TestConjointAtomicArraycopy
{
static
volatile
Object
[]
testArray
=
new
Object
[
4
];
static
short
[]
a1
=
new
short
[
8
];
static
short
[]
a2
=
new
short
[
8
];
static
short
[]
a3
=
new
short
[
8
];
static
volatile
boolean
keepRunning
=
true
;
static
void
testOopsCopy
()
throws
InterruptedException
{
}
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
for
(
int
i
=
0
;
i
<
testArray
.
length
;
i
++){
testArray
[
i
]
=
new
String
(
"A"
);
}
Thread
writer
=
new
Thread
(
new
Runnable
(){
public
void
run
(){
for
(
int
i
=
0
;
i
<
1000000
;
i
++)
{
System
.
arraycopy
(
testArray
,
1
,
testArray
,
0
,
3
);
testArray
[
2
]
=
new
String
(
"a"
);
}
}
});
Thread
reader
=
new
Thread
(
new
Runnable
(){
public
void
run
(){
while
(
keepRunning
){
String
name
=
testArray
[
2
].
getClass
().
getName
();
if
(!(
name
.
endsWith
(
"String"
))){
throw
new
RuntimeException
(
"got wrong class name"
);
}
}
}
});
keepRunning
=
true
;
reader
.
start
();
writer
.
start
();
writer
.
join
();
keepRunning
=
false
;
reader
.
join
();
}
}
test/runtime/7100935/TestShortArraycopy.java
0 → 100644
浏览文件 @
889f6d33
/*
* Copyright 2011 SAP AG. 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test TestShortArraycopy
* @bug 7100935
* @summary verify that shorts are copied element-wise atomic.
* @run main/othervm -Xint TestShortArraycopy
* @run main/othervm -Xcomp -Xbatch TestShortArraycopy
* @author volker.simonis@gmail.com
*/
public
class
TestShortArraycopy
{
static
short
[]
a1
=
new
short
[
8
];
static
short
[]
a2
=
new
short
[
8
];
static
short
[]
a3
=
new
short
[
8
];
static
volatile
boolean
keepRunning
=
true
;
public
static
void
main
(
String
[]
args
)
throws
InterruptedException
{
for
(
int
i
=
0
;
i
<
a1
.
length
;
i
++)
{
a1
[
i
]
=
(
short
)
0xffff
;
a2
[
i
]
=
(
short
)
0xffff
;
a3
[
i
]
=
(
short
)
0x0000
;
}
Thread
reader
=
new
Thread
()
{
public
void
run
()
{
while
(
keepRunning
)
{
for
(
int
j
=
0
;
j
<
a1
.
length
;
j
++)
{
short
s
=
a1
[
j
];
if
(
s
!=
(
short
)
0xffff
&&
s
!=
(
short
)
0x0000
)
{
System
.
out
.
println
(
"Error: s = "
+
s
);
throw
new
RuntimeException
(
"wrong result"
);
}
}
}
}
};
Thread
writer
=
new
Thread
()
{
public
void
run
()
{
for
(
int
i
=
0
;
i
<
1000000
;
i
++)
{
System
.
arraycopy
(
a2
,
5
,
a1
,
3
,
3
);
System
.
arraycopy
(
a3
,
5
,
a1
,
3
,
3
);
}
}
};
keepRunning
=
true
;
reader
.
start
();
writer
.
start
();
writer
.
join
();
keepRunning
=
false
;
reader
.
join
();
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录