Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
cb1bcdcf
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看板
提交
cb1bcdcf
编写于
4月 04, 2013
作者:
M
mgerdin
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
a884225b
8b303da7
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
206 addition
and
51 deletion
+206
-51
agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
.../sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
+7
-2
src/share/vm/classfile/symbolTable.cpp
src/share/vm/classfile/symbolTable.cpp
+8
-3
src/share/vm/classfile/symbolTable.hpp
src/share/vm/classfile/symbolTable.hpp
+1
-0
src/share/vm/classfile/systemDictionary.cpp
src/share/vm/classfile/systemDictionary.cpp
+21
-9
src/share/vm/classfile/systemDictionary.hpp
src/share/vm/classfile/systemDictionary.hpp
+2
-2
src/share/vm/interpreter/linkResolver.cpp
src/share/vm/interpreter/linkResolver.cpp
+22
-17
src/share/vm/oops/constMethod.cpp
src/share/vm/oops/constMethod.cpp
+20
-0
src/share/vm/oops/constMethod.hpp
src/share/vm/oops/constMethod.hpp
+3
-0
src/share/vm/oops/klassVtable.cpp
src/share/vm/oops/klassVtable.cpp
+6
-4
src/share/vm/oops/method.cpp
src/share/vm/oops/method.cpp
+2
-0
src/share/vm/oops/symbol.cpp
src/share/vm/oops/symbol.cpp
+1
-1
src/share/vm/prims/whitebox.cpp
src/share/vm/prims/whitebox.cpp
+20
-0
src/share/vm/runtime/arguments.cpp
src/share/vm/runtime/arguments.cpp
+7
-0
src/share/vm/runtime/globals.hpp
src/share/vm/runtime/globals.hpp
+3
-0
src/share/vm/runtime/os.hpp
src/share/vm/runtime/os.hpp
+1
-1
src/share/vm/services/memTracker.hpp
src/share/vm/services/memTracker.hpp
+4
-4
src/share/vm/utilities/utf8.cpp
src/share/vm/utilities/utf8.cpp
+5
-3
src/share/vm/utilities/utf8.hpp
src/share/vm/utilities/utf8.hpp
+2
-2
test/runtime/7116786/Test7116786.java
test/runtime/7116786/Test7116786.java
+6
-3
test/runtime/interned/SanityTest.java
test/runtime/interned/SanityTest.java
+59
-0
test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
+6
-0
未找到文件。
agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
浏览文件 @
cb1bcdcf
...
...
@@ -572,9 +572,14 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger
DTFWHome
=
sysRoot
+
File
.
separator
+
".."
+
File
.
separator
+
"Program Files"
+
File
.
separator
+
"Debugging Tools For Windows"
;
searchList
.
add
(
DTFWHome
);
searchList
.
add
(
DTFWHome
+
" (x86)"
);
searchList
.
add
(
DTFWHome
+
" (x64)"
);
// Only add the search path for the current CPU architecture:
String
cpu
=
PlatformInfo
.
getCPU
();
if
(
cpu
.
equals
(
"x86"
))
{
searchList
.
add
(
DTFWHome
+
" (x86)"
);
}
else
if
(
cpu
.
equals
(
"amd64"
))
{
searchList
.
add
(
DTFWHome
+
" (x64)"
);
}
// The last place to search is the system directory:
searchList
.
add
(
sysRoot
+
File
.
separator
+
"system32"
);
}
...
...
src/share/vm/classfile/symbolTable.cpp
浏览文件 @
cb1bcdcf
...
...
@@ -677,9 +677,14 @@ oop StringTable::lookup(Symbol* symbol) {
ResourceMark
rm
;
int
length
;
jchar
*
chars
=
symbol
->
as_unicode
(
length
);
unsigned
int
hashValue
=
hash_string
(
chars
,
length
);
int
index
=
the_table
()
->
hash_to_index
(
hashValue
);
return
the_table
()
->
lookup
(
index
,
chars
,
length
,
hashValue
);
return
lookup
(
chars
,
length
);
}
oop
StringTable
::
lookup
(
jchar
*
name
,
int
len
)
{
unsigned
int
hash
=
hash_string
(
name
,
len
);
int
index
=
the_table
()
->
hash_to_index
(
hash
);
return
the_table
()
->
lookup
(
index
,
name
,
len
,
hash
);
}
...
...
src/share/vm/classfile/symbolTable.hpp
浏览文件 @
cb1bcdcf
...
...
@@ -287,6 +287,7 @@ public:
// Probing
static
oop
lookup
(
Symbol
*
symbol
);
static
oop
lookup
(
jchar
*
chars
,
int
length
);
// Interning
static
oop
intern
(
Symbol
*
symbol
,
TRAPS
);
...
...
src/share/vm/classfile/systemDictionary.cpp
浏览文件 @
cb1bcdcf
...
...
@@ -816,13 +816,28 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name, Handle cla
// We didn't go as far as Klass::restore_unshareable_info(),
// so nothing to clean up.
}
else
{
MutexLocker
mu
(
SystemDictionary_lock
,
THREAD
);
Klass
*
kk
=
find_class
(
name
,
ik
->
class_loader_data
());
Klass
*
kk
;
{
MutexLocker
mu
(
SystemDictionary_lock
,
THREAD
);
kk
=
find_class
(
name
,
ik
->
class_loader_data
());
}
if
(
kk
!=
NULL
)
{
// No clean up is needed if the shared class has been entered
// into system dictionary, as load_shared_class() won't be called
// again.
}
else
{
// This must be done outside of the SystemDictionary_lock to
// avoid deadlock.
//
// Note that Klass::restore_unshareable_info (called via
// load_instance_class above) is also called outside
// of SystemDictionary_lock. Other threads are blocked from
// loading this class because they are waiting on the
// SystemDictionary_lock until this thread removes
// the placeholder below.
//
// This need to be re-thought when parallel-capable non-boot
// classloaders are supported by CDS (today they're not).
clean_up_shared_class
(
ik
,
class_loader
,
THREAD
);
}
}
...
...
@@ -2185,10 +2200,9 @@ Symbol* SystemDictionary::find_resolution_error(constantPoolHandle pool, int whi
// Make sure all class components (including arrays) in the given
// signature will be resolved to the same class in both loaders.
// Returns the name of the type that failed a loader constraint check, or
// NULL if no constraint failed. The returned C string needs cleaning up
// with a ResourceMark in the caller. No exception except OOME is thrown.
// NULL if no constraint failed. No exception except OOME is thrown.
// Arrays are not added to the loader constraint table, their elements are.
char
*
SystemDictionary
::
check_signature_loaders
(
Symbol
*
signature
,
Symbol
*
SystemDictionary
::
check_signature_loaders
(
Symbol
*
signature
,
Handle
loader1
,
Handle
loader2
,
bool
is_method
,
TRAPS
)
{
// Nothing to do if loaders are the same.
...
...
@@ -2196,14 +2210,12 @@ char* SystemDictionary::check_signature_loaders(Symbol* signature,
return
NULL
;
}
ResourceMark
rm
(
THREAD
);
SignatureStream
sig_strm
(
signature
,
is_method
);
while
(
!
sig_strm
.
is_done
())
{
if
(
sig_strm
.
is_object
())
{
Symbol
*
s
=
sig_strm
.
as_symbol
(
CHECK_NULL
);
Symbol
*
sig
=
s
;
Symbol
*
sig
=
sig_strm
.
as_symbol
(
CHECK_NULL
);
if
(
!
add_loader_constraint
(
sig
,
loader1
,
loader2
,
THREAD
))
{
return
sig
->
as_C_string
()
;
return
sig
;
}
}
sig_strm
.
next
();
...
...
src/share/vm/classfile/systemDictionary.hpp
浏览文件 @
cb1bcdcf
...
...
@@ -483,8 +483,8 @@ public:
// Check class loader constraints
static
bool
add_loader_constraint
(
Symbol
*
name
,
Handle
loader1
,
Handle
loader2
,
TRAPS
);
static
char
*
check_signature_loaders
(
Symbol
*
signature
,
Handle
loader1
,
Handle
loader2
,
bool
is_method
,
TRAPS
);
static
Symbol
*
check_signature_loaders
(
Symbol
*
signature
,
Handle
loader1
,
Handle
loader2
,
bool
is_method
,
TRAPS
);
// JSR 292
// find a java.lang.invoke.MethodHandle.invoke* method for a given signature
...
...
src/share/vm/interpreter/linkResolver.cpp
浏览文件 @
cb1bcdcf
...
...
@@ -458,25 +458,27 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res
Handle
class_loader
(
THREAD
,
resolved_method
->
method_holder
()
->
class_loader
());
{
ResourceMark
rm
(
THREAD
);
char
*
failed_type_name
=
Symbol
*
failed_type_symbol
=
SystemDictionary
::
check_signature_loaders
(
method_signature
,
loader
,
class_loader
,
true
,
CHECK
);
if
(
failed_type_
name
!=
NULL
)
{
if
(
failed_type_
symbol
!=
NULL
)
{
const
char
*
msg
=
"loader constraint violation: when resolving method"
"
\"
%s
\"
the class loader (instance of %s) of the current class, %s,"
" and the class loader (instance of %s) for
resolved
class, %s, have"
" and the class loader (instance of %s) for
the method's defining
class, %s, have"
" different Class objects for the type %s used in the signature"
;
char
*
sig
=
Method
::
name_and_sig_as_C_string
(
resolved_klass
(),
method_name
,
method_signature
);
const
char
*
loader1
=
SystemDictionary
::
loader_name
(
loader
());
char
*
current
=
InstanceKlass
::
cast
(
current_klass
())
->
name
()
->
as_C_string
();
const
char
*
loader2
=
SystemDictionary
::
loader_name
(
class_loader
());
char
*
resolved
=
InstanceKlass
::
cast
(
resolved_klass
())
->
name
()
->
as_C_string
();
char
*
target
=
InstanceKlass
::
cast
(
resolved_method
->
method_holder
())
->
name
()
->
as_C_string
();
char
*
failed_type_name
=
failed_type_symbol
->
as_C_string
();
size_t
buflen
=
strlen
(
msg
)
+
strlen
(
sig
)
+
strlen
(
loader1
)
+
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
resolved
)
+
strlen
(
failed_type_name
);
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
target
)
+
strlen
(
failed_type_name
)
+
1
;
char
*
buf
=
NEW_RESOURCE_ARRAY_IN_THREAD
(
THREAD
,
char
,
buflen
);
jio_snprintf
(
buf
,
buflen
,
msg
,
sig
,
loader1
,
current
,
loader2
,
resolved
,
failed_type_name
);
target
,
failed_type_name
);
THROW_MSG
(
vmSymbols
::
java_lang_LinkageError
(),
buf
);
}
}
...
...
@@ -520,26 +522,28 @@ void LinkResolver::resolve_interface_method(methodHandle& resolved_method,
Handle
class_loader
(
THREAD
,
resolved_method
->
method_holder
()
->
class_loader
());
{
ResourceMark
rm
(
THREAD
);
char
*
failed_type_name
=
Symbol
*
failed_type_symbol
=
SystemDictionary
::
check_signature_loaders
(
method_signature
,
loader
,
class_loader
,
true
,
CHECK
);
if
(
failed_type_
name
!=
NULL
)
{
if
(
failed_type_
symbol
!=
NULL
)
{
const
char
*
msg
=
"loader constraint violation: when resolving "
"interface method
\"
%s
\"
the class loader (instance of %s) of the "
"current class, %s, and the class loader (instance of %s) for "
"
resolved
class, %s, have different Class objects for the type %s "
"
the method's defining
class, %s, have different Class objects for the type %s "
"used in the signature"
;
char
*
sig
=
Method
::
name_and_sig_as_C_string
(
resolved_klass
(),
method_name
,
method_signature
);
const
char
*
loader1
=
SystemDictionary
::
loader_name
(
loader
());
char
*
current
=
InstanceKlass
::
cast
(
current_klass
())
->
name
()
->
as_C_string
();
const
char
*
loader2
=
SystemDictionary
::
loader_name
(
class_loader
());
char
*
resolved
=
InstanceKlass
::
cast
(
resolved_klass
())
->
name
()
->
as_C_string
();
char
*
target
=
InstanceKlass
::
cast
(
resolved_method
->
method_holder
())
->
name
()
->
as_C_string
();
char
*
failed_type_name
=
failed_type_symbol
->
as_C_string
();
size_t
buflen
=
strlen
(
msg
)
+
strlen
(
sig
)
+
strlen
(
loader1
)
+
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
resolved
)
+
strlen
(
failed_type_name
);
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
target
)
+
strlen
(
failed_type_name
)
+
1
;
char
*
buf
=
NEW_RESOURCE_ARRAY_IN_THREAD
(
THREAD
,
char
,
buflen
);
jio_snprintf
(
buf
,
buflen
,
msg
,
sig
,
loader1
,
current
,
loader2
,
resolved
,
failed_type_name
);
target
,
failed_type_name
);
THROW_MSG
(
vmSymbols
::
java_lang_LinkageError
(),
buf
);
}
}
...
...
@@ -642,12 +646,12 @@ void LinkResolver::resolve_field(FieldAccessInfo& result, constantPoolHandle poo
Symbol
*
signature_ref
=
pool
->
signature_ref_at
(
index
);
{
ResourceMark
rm
(
THREAD
);
char
*
failed_type_name
=
Symbol
*
failed_type_symbol
=
SystemDictionary
::
check_signature_loaders
(
signature_ref
,
ref_loader
,
sel_loader
,
false
,
CHECK
);
if
(
failed_type_
name
!=
NULL
)
{
if
(
failed_type_
symbol
!=
NULL
)
{
const
char
*
msg
=
"loader constraint violation: when resolving field"
"
\"
%s
\"
the class loader (instance of %s) of the referring class, "
"%s, and the class loader (instance of %s) for the field's resolved "
...
...
@@ -656,8 +660,9 @@ void LinkResolver::resolve_field(FieldAccessInfo& result, constantPoolHandle poo
const
char
*
loader1
=
SystemDictionary
::
loader_name
(
ref_loader
());
char
*
sel
=
InstanceKlass
::
cast
(
sel_klass
())
->
name
()
->
as_C_string
();
const
char
*
loader2
=
SystemDictionary
::
loader_name
(
sel_loader
());
char
*
failed_type_name
=
failed_type_symbol
->
as_C_string
();
size_t
buflen
=
strlen
(
msg
)
+
strlen
(
field_name
)
+
strlen
(
loader1
)
+
strlen
(
sel
)
+
strlen
(
loader2
)
+
strlen
(
failed_type_name
);
strlen
(
sel
)
+
strlen
(
loader2
)
+
strlen
(
failed_type_name
)
+
1
;
char
*
buf
=
NEW_RESOURCE_ARRAY_IN_THREAD
(
THREAD
,
char
,
buflen
);
jio_snprintf
(
buf
,
buflen
,
msg
,
field_name
,
loader1
,
sel
,
loader2
,
failed_type_name
);
...
...
src/share/vm/oops/constMethod.cpp
浏览文件 @
cb1bcdcf
...
...
@@ -363,6 +363,26 @@ AnnotationArray** ConstMethod::default_annotations_addr() const {
return
(
AnnotationArray
**
)
constMethod_end
()
-
offset
;
}
// copy annotations from 'cm' to 'this'
void
ConstMethod
::
copy_annotations_from
(
ConstMethod
*
cm
)
{
if
(
cm
->
has_method_annotations
())
{
assert
(
has_method_annotations
(),
"should be allocated already"
);
set_method_annotations
(
cm
->
method_annotations
());
}
if
(
cm
->
has_parameter_annotations
())
{
assert
(
has_parameter_annotations
(),
"should be allocated already"
);
set_parameter_annotations
(
cm
->
parameter_annotations
());
}
if
(
cm
->
has_type_annotations
())
{
assert
(
has_type_annotations
(),
"should be allocated already"
);
set_type_annotations
(
cm
->
type_annotations
());
}
if
(
cm
->
has_default_annotations
())
{
assert
(
has_default_annotations
(),
"should be allocated already"
);
set_default_annotations
(
cm
->
default_annotations
());
}
}
// Printing
void
ConstMethod
::
print_on
(
outputStream
*
st
)
const
{
...
...
src/share/vm/oops/constMethod.hpp
浏览文件 @
cb1bcdcf
...
...
@@ -441,6 +441,9 @@ public:
return
has_default_annotations
()
?
default_annotations
()
->
length
()
:
0
;
}
// Copy annotations from other ConstMethod
void
copy_annotations_from
(
ConstMethod
*
cm
);
// byte codes
void
set_code
(
address
code
)
{
if
(
code_size
()
>
0
)
{
...
...
src/share/vm/oops/klassVtable.cpp
浏览文件 @
cb1bcdcf
...
...
@@ -327,11 +327,11 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar
if
(
target_loader
()
!=
super_loader
())
{
ResourceMark
rm
(
THREAD
);
char
*
failed_type_name
=
Symbol
*
failed_type_symbol
=
SystemDictionary
::
check_signature_loaders
(
signature
,
target_loader
,
super_loader
,
true
,
CHECK_
(
false
));
if
(
failed_type_
name
!=
NULL
)
{
if
(
failed_type_
symbol
!=
NULL
)
{
const
char
*
msg
=
"loader constraint violation: when resolving "
"overridden method
\"
%s
\"
the class loader (instance"
" of %s) of the current class, %s, and its superclass loader "
...
...
@@ -341,6 +341,7 @@ bool klassVtable::update_inherited_vtable(InstanceKlass* klass, methodHandle tar
const
char
*
loader1
=
SystemDictionary
::
loader_name
(
target_loader
());
char
*
current
=
_klass
->
name
()
->
as_C_string
();
const
char
*
loader2
=
SystemDictionary
::
loader_name
(
super_loader
());
char
*
failed_type_name
=
failed_type_symbol
->
as_C_string
();
size_t
buflen
=
strlen
(
msg
)
+
strlen
(
sig
)
+
strlen
(
loader1
)
+
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
failed_type_name
);
char
*
buf
=
NEW_RESOURCE_ARRAY_IN_THREAD
(
THREAD
,
char
,
buflen
);
...
...
@@ -787,12 +788,12 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass
Handle
method_holder_loader
(
THREAD
,
target
->
method_holder
()
->
class_loader
());
if
(
method_holder_loader
()
!=
interface_loader
())
{
ResourceMark
rm
(
THREAD
);
char
*
failed_type_name
=
Symbol
*
failed_type_symbol
=
SystemDictionary
::
check_signature_loaders
(
method_signature
,
method_holder_loader
,
interface_loader
,
true
,
CHECK
);
if
(
failed_type_
name
!=
NULL
)
{
if
(
failed_type_
symbol
!=
NULL
)
{
const
char
*
msg
=
"loader constraint violation in interface "
"itable initialization: when resolving method
\"
%s
\"
the class"
" loader (instance of %s) of the current class, %s, "
...
...
@@ -804,6 +805,7 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass
char
*
current
=
klass
->
name
()
->
as_C_string
();
const
char
*
loader2
=
SystemDictionary
::
loader_name
(
interface_loader
());
char
*
iface
=
InstanceKlass
::
cast
(
interf_h
())
->
name
()
->
as_C_string
();
char
*
failed_type_name
=
failed_type_symbol
->
as_C_string
();
size_t
buflen
=
strlen
(
msg
)
+
strlen
(
sig
)
+
strlen
(
loader1
)
+
strlen
(
current
)
+
strlen
(
loader2
)
+
strlen
(
iface
)
+
strlen
(
failed_type_name
);
...
...
src/share/vm/oops/method.cpp
浏览文件 @
cb1bcdcf
...
...
@@ -1170,6 +1170,8 @@ methodHandle Method::clone_with_new_data(methodHandle m, u_char* new_code, int n
newm
->
set_stackmap_data
(
stackmap_data
);
}
// copy annotations over to new method
newcm
->
copy_annotations_from
(
cm
);
return
newm
;
}
...
...
src/share/vm/oops/symbol.cpp
浏览文件 @
cb1bcdcf
...
...
@@ -162,7 +162,7 @@ char* Symbol::as_quoted_ascii() const {
const
char
*
ptr
=
(
const
char
*
)
&
_body
[
0
];
int
quoted_length
=
UTF8
::
quoted_ascii_length
(
ptr
,
utf8_length
());
char
*
result
=
NEW_RESOURCE_ARRAY
(
char
,
quoted_length
+
1
);
UTF8
::
as_quoted_ascii
(
ptr
,
result
,
quoted_length
+
1
);
UTF8
::
as_quoted_ascii
(
ptr
,
utf8_length
(),
result
,
quoted_length
+
1
);
return
result
;
}
...
...
src/share/vm/prims/whitebox.cpp
浏览文件 @
cb1bcdcf
...
...
@@ -254,6 +254,24 @@ WB_ENTRY(jint, WB_GetCompileQueuesSize(JNIEnv* env, jobject o))
CompileBroker
::
queue_size
(
CompLevel_full_profile
)
/* C1 */
;
WB_END
WB_ENTRY
(
jboolean
,
WB_IsInStringTable
(
JNIEnv
*
env
,
jobject
o
,
jstring
javaString
))
ResourceMark
rm
(
THREAD
);
int
len
;
jchar
*
name
=
java_lang_String
::
as_unicode_string
(
JNIHandles
::
resolve
(
javaString
),
len
);
oop
found_string
=
StringTable
::
the_table
()
->
lookup
(
name
,
len
);
if
(
found_string
==
NULL
)
{
return
false
;
}
return
true
;
WB_END
WB_ENTRY
(
void
,
WB_FullGC
(
JNIEnv
*
env
,
jobject
o
))
Universe
::
heap
()
->
collector_policy
()
->
set_should_clear_all_soft_refs
(
true
);
Universe
::
heap
()
->
collect
(
GCCause
::
_last_ditch_collection
);
WB_END
//Some convenience methods to deal with objects from java
int
WhiteBox
::
offset_for_field
(
const
char
*
field_name
,
oop
object
,
Symbol
*
signature_symbol
)
{
...
...
@@ -343,6 +361,8 @@ static JNINativeMethod methods[] = {
CC
"(Ljava/lang/reflect/Method;)I"
,
(
void
*
)
&
WB_GetMethodCompilationLevel
},
{
CC
"getCompileQueuesSize"
,
CC
"()I"
,
(
void
*
)
&
WB_GetCompileQueuesSize
},
{
CC
"isInStringTable"
,
CC
"(Ljava/lang/String;)Z"
,
(
void
*
)
&
WB_IsInStringTable
},
{
CC
"fullGC"
,
CC
"()V"
,
(
void
*
)
&
WB_FullGC
},
};
#undef CC
...
...
src/share/vm/runtime/arguments.cpp
浏览文件 @
cb1bcdcf
...
...
@@ -3327,6 +3327,13 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
}
check_deprecated_gcs
();
check_deprecated_gc_flags
();
if
(
AssumeMP
&&
!
UseSerialGC
)
{
if
(
FLAG_IS_DEFAULT
(
ParallelGCThreads
)
&&
ParallelGCThreads
==
1
)
{
warning
(
"If the number of processors is expected to increase from one, then"
" you should configure the number of parallel GC threads appropriately"
" using -XX:ParallelGCThreads=N"
);
}
}
#else // INCLUDE_ALL_GCS
assert
(
verify_serial_gc_flags
(),
"SerialGC unset"
);
#endif // INCLUDE_ALL_GCS
...
...
src/share/vm/runtime/globals.hpp
浏览文件 @
cb1bcdcf
...
...
@@ -457,6 +457,9 @@ class CommandLineFlags {
lp64_product(intx, ObjectAlignmentInBytes, 8, \
"Default object alignment in bytes, 8 is minimum") \
\
product(bool, AssumeMP, false, \
"Instruct the VM to assume multiple processors are available") \
\
/* UseMembar is theoretically a temp flag used for memory barrier \
* removal testing. It was supposed to be removed before FCS but has \
* been re-added (see 6401008) */
\
...
...
src/share/vm/runtime/os.hpp
浏览文件 @
cb1bcdcf
...
...
@@ -180,7 +180,7 @@ class os: AllStatic {
// Interface for detecting multiprocessor system
static
inline
bool
is_MP
()
{
assert
(
_processor_count
>
0
,
"invalid processor count"
);
return
_processor_count
>
1
;
return
_processor_count
>
1
||
AssumeMP
;
}
static
julong
available_memory
();
static
julong
physical_memory
();
...
...
src/share/vm/services/memTracker.hpp
浏览文件 @
cb1bcdcf
...
...
@@ -86,13 +86,13 @@ class MemTracker : AllStatic {
static
inline
void
set_autoShutdown
(
bool
value
)
{
}
static
void
shutdown
(
ShutdownReason
reason
)
{
}
static
inline
bool
shutdown_in_progress
()
{
}
static
inline
bool
shutdown_in_progress
()
{
return
false
;
}
static
bool
print_memory_usage
(
BaselineOutputer
&
out
,
size_t
unit
,
bool
summary_only
=
true
)
{
}
bool
summary_only
=
true
)
{
return
false
;
}
static
bool
compare_memory_usage
(
BaselineOutputer
&
out
,
size_t
unit
,
bool
summary_only
=
true
)
{
}
bool
summary_only
=
true
)
{
return
false
;
}
static
bool
wbtest_wait_for_data_merge
()
{
}
static
bool
wbtest_wait_for_data_merge
()
{
return
false
;
}
static
inline
void
sync
()
{
}
static
inline
void
thread_exiting
(
JavaThread
*
thread
)
{
}
...
...
src/share/vm/utilities/utf8.cpp
浏览文件 @
cb1bcdcf
/*
* Copyright (c) 1997, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
3
, 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
...
...
@@ -180,11 +180,12 @@ int UTF8::quoted_ascii_length(const char* utf8_str, int utf8_length) {
}
// converts a utf8 string to quoted ascii
void
UTF8
::
as_quoted_ascii
(
const
char
*
utf8_str
,
char
*
buf
,
int
buflen
)
{
void
UTF8
::
as_quoted_ascii
(
const
char
*
utf8_str
,
int
utf8_length
,
char
*
buf
,
int
buflen
)
{
const
char
*
ptr
=
utf8_str
;
const
char
*
utf8_end
=
ptr
+
utf8_length
;
char
*
p
=
buf
;
char
*
end
=
buf
+
buflen
;
while
(
*
ptr
!=
'\0'
)
{
while
(
ptr
<
utf8_end
)
{
jchar
c
;
ptr
=
UTF8
::
next
(
ptr
,
&
c
);
if
(
c
>=
32
&&
c
<
127
)
{
...
...
@@ -196,6 +197,7 @@ void UTF8::as_quoted_ascii(const char* utf8_str, char* buf, int buflen) {
p
+=
6
;
}
}
assert
(
p
<
end
,
"sanity"
);
*
p
=
'\0'
;
}
...
...
src/share/vm/utilities/utf8.hpp
浏览文件 @
cb1bcdcf
/*
* Copyright (c) 1997, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
3
, 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
...
...
@@ -45,7 +45,7 @@ class UTF8 : AllStatic {
static
int
quoted_ascii_length
(
const
char
*
utf8_str
,
int
utf8_length
);
// converts a utf8 string to quoted ascii
static
void
as_quoted_ascii
(
const
char
*
utf8_str
,
char
*
buf
,
int
buflen
);
static
void
as_quoted_ascii
(
const
char
*
utf8_str
,
int
utf8_length
,
char
*
buf
,
int
buflen
);
// converts a quoted ascii string to utf8 string. returns the original
// string unchanged if nothing needs to be done.
...
...
test/runtime/7116786/Test7116786.java
浏览文件 @
cb1bcdcf
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012,
2013,
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
...
...
@@ -338,9 +338,12 @@ class VerifyErrorCases {
"invalid constant pool index in ldc"
,
"Invalid index in ldc"
),
new
Case
(
"case58"
,
"verifier.cpp"
,
true
,
"verify_switch"
,
/* No longer a valid test case for bytecode version >= 51. Nonzero
* padding bytes are permitted with lookupswitch and tableswitch
* bytecodes as of JVMS 3d edition */
new
Case
(
"case58"
,
"verifier.cpp"
,
false
,
"verify_switch"
,
"bad switch padding"
,
"Nonzero padding byte in lookswitch or tableswitch"
),
"Nonzero padding byte in look
up
switch or tableswitch"
),
new
Case
(
"case59"
,
"verifier.cpp"
,
true
,
"verify_switch"
,
"tableswitch low is greater than high"
,
...
...
test/runtime/interned/SanityTest.java
0 → 100644
浏览文件 @
cb1bcdcf
/*
* Copyright (c) 2013, 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
* 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 SanityTest
* @summary Sanity check of String.intern() & GC
* @library /testlibrary /testlibrary/whitebox
* @build SanityTest
* @run main ClassFileInstaller sun.hotspot.WhiteBox
* @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI SanityTest
*/
import
java.util.*
;
import
sun.hotspot.WhiteBox
;
public
class
SanityTest
{
public
static
Object
tmp
;
public
static
void
main
(
String
...
args
)
{
WhiteBox
wb
=
WhiteBox
.
getWhiteBox
();
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
"1234x"
);
sb
.
append
(
"x56789"
);
String
str
=
sb
.
toString
();
if
(
wb
.
isInStringTable
(
str
))
{
throw
new
RuntimeException
(
"String "
+
str
+
" is already interned"
);
}
str
.
intern
();
if
(!
wb
.
isInStringTable
(
str
))
{
throw
new
RuntimeException
(
"String "
+
str
+
" is not interned"
);
}
str
=
sb
.
toString
();
wb
.
fullGC
();
if
(
wb
.
isInStringTable
(
str
))
{
throw
new
RuntimeException
(
"String "
+
str
+
" is in StringTable even after GC"
);
}
}
}
test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
浏览文件 @
cb1bcdcf
...
...
@@ -94,4 +94,10 @@ public class WhiteBox {
public
native
int
getMethodCompilationLevel
(
Method
method
);
public
native
boolean
setDontInlineMethod
(
Method
method
,
boolean
value
);
public
native
int
getCompileQueuesSize
();
//Intered strings
public
native
boolean
isInStringTable
(
String
str
);
// force Full GC
public
native
void
fullGC
();
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录