Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
18d312f9
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看板
提交
18d312f9
编写于
7月 03, 2013
作者:
T
tamao
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
01e9c00e
81592497
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
134 addition
and
11 deletion
+134
-11
src/share/vm/gc_implementation/g1/g1CardCounts.cpp
src/share/vm/gc_implementation/g1/g1CardCounts.cpp
+2
-5
src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
...share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
+1
-1
src/share/vm/runtime/arguments.cpp
src/share/vm/runtime/arguments.cpp
+12
-2
src/share/vm/runtime/globals.cpp
src/share/vm/runtime/globals.cpp
+48
-2
src/share/vm/runtime/globals.hpp
src/share/vm/runtime/globals.hpp
+2
-1
test/gc/arguments/TestUnrecognizedVMOptionsHandling.java
test/gc/arguments/TestUnrecognizedVMOptionsHandling.java
+69
-0
未找到文件。
src/share/vm/gc_implementation/g1/g1CardCounts.cpp
浏览文件 @
18d312f9
...
@@ -152,12 +152,9 @@ uint G1CardCounts::add_card_count(jbyte* card_ptr) {
...
@@ -152,12 +152,9 @@ uint G1CardCounts::add_card_count(jbyte* card_ptr) {
if
(
card_num
<
_committed_max_card_num
)
{
if
(
card_num
<
_committed_max_card_num
)
{
count
=
(
uint
)
_card_counts
[
card_num
];
count
=
(
uint
)
_card_counts
[
card_num
];
if
(
count
<
G1ConcRSHotCardLimit
)
{
if
(
count
<
G1ConcRSHotCardLimit
)
{
_card_counts
[
card_num
]
+=
1
;
_card_counts
[
card_num
]
=
(
jubyte
)(
MIN2
((
uintx
)(
_card_counts
[
card_num
]
+
1
),
G1ConcRSHotCardLimit
));
}
}
assert
(
_card_counts
[
card_num
]
<=
G1ConcRSHotCardLimit
,
err_msg
(
"Refinement count overflow? "
"new count: "
UINT32_FORMAT
,
(
uint
)
_card_counts
[
card_num
]));
}
}
}
}
return
count
;
return
count
;
...
...
src/share/vm/gc_implementation/g1/g1SATBCardTableModRefBS.cpp
浏览文件 @
18d312f9
...
@@ -47,7 +47,7 @@ void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
...
@@ -47,7 +47,7 @@ void G1SATBCardTableModRefBS::enqueue(oop pre_val) {
JavaThread
*
jt
=
(
JavaThread
*
)
thr
;
JavaThread
*
jt
=
(
JavaThread
*
)
thr
;
jt
->
satb_mark_queue
().
enqueue
(
pre_val
);
jt
->
satb_mark_queue
().
enqueue
(
pre_val
);
}
else
{
}
else
{
MutexLocker
x
(
Shared_SATB_Q_lock
);
MutexLocker
Ex
x
(
Shared_SATB_Q_lock
,
Mutex
::
_no_safepoint_check_flag
);
JavaThread
::
satb_mark_queue_set
().
shared_satb_queue
()
->
enqueue
(
pre_val
);
JavaThread
::
satb_mark_queue_set
().
shared_satb_queue
()
->
enqueue
(
pre_val
);
}
}
}
}
...
...
src/share/vm/runtime/arguments.cpp
浏览文件 @
18d312f9
...
@@ -849,7 +849,7 @@ bool Arguments::process_argument(const char* arg,
...
@@ -849,7 +849,7 @@ bool Arguments::process_argument(const char* arg,
arg_len
=
equal_sign
-
argname
;
arg_len
=
equal_sign
-
argname
;
}
}
Flag
*
found_flag
=
Flag
::
find_flag
((
char
*
)
argname
,
arg_len
,
true
);
Flag
*
found_flag
=
Flag
::
find_flag
((
c
onst
c
har
*
)
argname
,
arg_len
,
true
);
if
(
found_flag
!=
NULL
)
{
if
(
found_flag
!=
NULL
)
{
char
locked_message_buf
[
BUFLEN
];
char
locked_message_buf
[
BUFLEN
];
found_flag
->
get_locked_message
(
locked_message_buf
,
BUFLEN
);
found_flag
->
get_locked_message
(
locked_message_buf
,
BUFLEN
);
...
@@ -870,6 +870,14 @@ bool Arguments::process_argument(const char* arg,
...
@@ -870,6 +870,14 @@ bool Arguments::process_argument(const char* arg,
}
else
{
}
else
{
jio_fprintf
(
defaultStream
::
error_stream
(),
jio_fprintf
(
defaultStream
::
error_stream
(),
"Unrecognized VM option '%s'
\n
"
,
argname
);
"Unrecognized VM option '%s'
\n
"
,
argname
);
Flag
*
fuzzy_matched
=
Flag
::
fuzzy_match
((
const
char
*
)
argname
,
arg_len
,
true
);
if
(
fuzzy_matched
!=
NULL
)
{
jio_fprintf
(
defaultStream
::
error_stream
(),
"Did you mean '%s%s%s'?
\n
"
,
(
fuzzy_matched
->
is_bool
())
?
"(+/-)"
:
""
,
fuzzy_matched
->
name
,
(
fuzzy_matched
->
is_bool
())
?
""
:
"=<value>"
);
}
}
}
// allow for commandline "commenting out" options like -XX:#+Verbose
// allow for commandline "commenting out" options like -XX:#+Verbose
...
@@ -1571,7 +1579,9 @@ void Arguments::set_heap_base_min_address() {
...
@@ -1571,7 +1579,9 @@ void Arguments::set_heap_base_min_address() {
// By default HeapBaseMinAddress is 2G on all platforms except Solaris x86.
// By default HeapBaseMinAddress is 2G on all platforms except Solaris x86.
// G1 currently needs a lot of C-heap, so on Solaris we have to give G1
// G1 currently needs a lot of C-heap, so on Solaris we have to give G1
// some extra space for the C-heap compared to other collectors.
// some extra space for the C-heap compared to other collectors.
FLAG_SET_ERGO
(
uintx
,
HeapBaseMinAddress
,
1
*
G
);
// Use FLAG_SET_DEFAULT here rather than FLAG_SET_ERGO to make sure that
// code that checks for default values work correctly.
FLAG_SET_DEFAULT
(
HeapBaseMinAddress
,
1
*
G
);
}
}
}
}
...
...
src/share/vm/runtime/globals.cpp
浏览文件 @
18d312f9
...
@@ -276,14 +276,14 @@ static Flag flagTable[] = {
...
@@ -276,14 +276,14 @@ static Flag flagTable[] = {
Flag
*
Flag
::
flags
=
flagTable
;
Flag
*
Flag
::
flags
=
flagTable
;
size_t
Flag
::
numFlags
=
(
sizeof
(
flagTable
)
/
sizeof
(
Flag
));
size_t
Flag
::
numFlags
=
(
sizeof
(
flagTable
)
/
sizeof
(
Flag
));
inline
bool
str_equal
(
const
char
*
s
,
char
*
q
,
size_t
len
)
{
inline
bool
str_equal
(
const
char
*
s
,
c
onst
c
har
*
q
,
size_t
len
)
{
// s is null terminated, q is not!
// s is null terminated, q is not!
if
(
strlen
(
s
)
!=
(
unsigned
int
)
len
)
return
false
;
if
(
strlen
(
s
)
!=
(
unsigned
int
)
len
)
return
false
;
return
strncmp
(
s
,
q
,
len
)
==
0
;
return
strncmp
(
s
,
q
,
len
)
==
0
;
}
}
// Search the flag table for a named flag
// Search the flag table for a named flag
Flag
*
Flag
::
find_flag
(
char
*
name
,
size_t
length
,
bool
allow_locked
)
{
Flag
*
Flag
::
find_flag
(
c
onst
c
har
*
name
,
size_t
length
,
bool
allow_locked
)
{
for
(
Flag
*
current
=
&
flagTable
[
0
];
current
->
name
!=
NULL
;
current
++
)
{
for
(
Flag
*
current
=
&
flagTable
[
0
];
current
->
name
!=
NULL
;
current
++
)
{
if
(
str_equal
(
current
->
name
,
name
,
length
))
{
if
(
str_equal
(
current
->
name
,
name
,
length
))
{
// Found a matching entry. Report locked flags only if allowed.
// Found a matching entry. Report locked flags only if allowed.
...
@@ -301,6 +301,52 @@ Flag* Flag::find_flag(char* name, size_t length, bool allow_locked) {
...
@@ -301,6 +301,52 @@ Flag* Flag::find_flag(char* name, size_t length, bool allow_locked) {
return
NULL
;
return
NULL
;
}
}
// Compute string similarity based on Dice's coefficient
static
float
str_similar
(
const
char
*
str1
,
const
char
*
str2
,
size_t
len2
)
{
int
len1
=
(
int
)
strlen
(
str1
);
int
total
=
len1
+
(
int
)
len2
;
int
hit
=
0
;
for
(
int
i
=
0
;
i
<
len1
-
1
;
++
i
)
{
for
(
int
j
=
0
;
j
<
(
int
)
len2
-
1
;
++
j
)
{
if
((
str1
[
i
]
==
str2
[
j
])
&&
(
str1
[
i
+
1
]
==
str2
[
j
+
1
]))
{
++
hit
;
break
;
}
}
}
return
2.0
f
*
(
float
)
hit
/
(
float
)
total
;
}
Flag
*
Flag
::
fuzzy_match
(
const
char
*
name
,
size_t
length
,
bool
allow_locked
)
{
float
VMOptionsFuzzyMatchSimilarity
=
0.7
f
;
Flag
*
match
=
NULL
;
float
score
;
float
max_score
=
-
1
;
for
(
Flag
*
current
=
&
flagTable
[
0
];
current
->
name
!=
NULL
;
current
++
)
{
score
=
str_similar
(
current
->
name
,
name
,
length
);
if
(
score
>
max_score
)
{
max_score
=
score
;
match
=
current
;
}
}
if
(
!
(
match
->
is_unlocked
()
||
match
->
is_unlocker
()))
{
if
(
!
allow_locked
)
{
return
NULL
;
}
}
if
(
max_score
<
VMOptionsFuzzyMatchSimilarity
)
{
return
NULL
;
}
return
match
;
}
// Returns the address of the index'th element
// Returns the address of the index'th element
static
Flag
*
address_of_flag
(
CommandLineFlagWithType
flag
)
{
static
Flag
*
address_of_flag
(
CommandLineFlagWithType
flag
)
{
assert
((
size_t
)
flag
<
Flag
::
numFlags
,
"bad command line flag index"
);
assert
((
size_t
)
flag
<
Flag
::
numFlags
,
"bad command line flag index"
);
...
...
src/share/vm/runtime/globals.hpp
浏览文件 @
18d312f9
...
@@ -220,7 +220,8 @@ struct Flag {
...
@@ -220,7 +220,8 @@ struct Flag {
// number of flags
// number of flags
static
size_t
numFlags
;
static
size_t
numFlags
;
static
Flag
*
find_flag
(
char
*
name
,
size_t
length
,
bool
allow_locked
=
false
);
static
Flag
*
find_flag
(
const
char
*
name
,
size_t
length
,
bool
allow_locked
=
false
);
static
Flag
*
fuzzy_match
(
const
char
*
name
,
size_t
length
,
bool
allow_locked
=
false
);
bool
is_bool
()
const
{
return
strcmp
(
type
,
"bool"
)
==
0
;
}
bool
is_bool
()
const
{
return
strcmp
(
type
,
"bool"
)
==
0
;
}
bool
get_bool
()
const
{
return
*
((
bool
*
)
addr
);
}
bool
get_bool
()
const
{
return
*
((
bool
*
)
addr
);
}
...
...
test/gc/arguments/TestUnrecognizedVMOptionsHandling.java
0 → 100644
浏览文件 @
18d312f9
/*
* 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 TestUnrecognizedVMOptionsHandling
* @key gc
* @bug 8017611
* @summary Tests handling unrecognized VM options
* @library /testlibrary
* @run main/othervm TestUnrecognizedVMOptionsHandling
*/
import
com.oracle.java.testlibrary.*
;
public
class
TestUnrecognizedVMOptionsHandling
{
public
static
void
main
(
String
args
[])
throws
Exception
{
// The first two JAVA processes are expected to fail, but with a correct VM option suggestion
ProcessBuilder
pb
=
ProcessTools
.
createJavaProcessBuilder
(
"-XX:+PrintGc"
,
"-version"
);
OutputAnalyzer
outputWithError
=
new
OutputAnalyzer
(
pb
.
start
());
outputWithError
.
shouldContain
(
"Did you mean '(+/-)PrintGC'?"
);
if
(
outputWithError
.
getExitValue
()
==
0
)
{
throw
new
RuntimeException
(
"Not expected to get exit value 0"
);
}
pb
=
ProcessTools
.
createJavaProcessBuilder
(
"-XX:MaxiumHeapSize=500m"
,
"-version"
);
outputWithError
=
new
OutputAnalyzer
(
pb
.
start
());
outputWithError
.
shouldContain
(
"Did you mean 'MaxHeapSize=<value>'?"
);
if
(
outputWithError
.
getExitValue
()
==
0
)
{
throw
new
RuntimeException
(
"Not expected to get exit value 0"
);
}
// The last JAVA process should run successfully for the purpose of sanity check
pb
=
ProcessTools
.
createJavaProcessBuilder
(
"-XX:+PrintGC"
,
"-version"
);
OutputAnalyzer
outputWithNoError
=
new
OutputAnalyzer
(
pb
.
start
());
outputWithNoError
.
shouldNotContain
(
"Did you mean '(+/-)PrintGC'?"
);
outputWithNoError
.
shouldHaveExitValue
(
0
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录