Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
6caaeb4b
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看板
提交
6caaeb4b
编写于
1月 20, 2017
作者:
R
robm
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
498daef4
b496a7ef
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
69 addition
and
18 deletion
+69
-18
src/share/vm/code/nmethod.cpp
src/share/vm/code/nmethod.cpp
+1
-0
src/share/vm/prims/jvmtiEnv.cpp
src/share/vm/prims/jvmtiEnv.cpp
+15
-9
src/share/vm/prims/jvmtiEnvBase.hpp
src/share/vm/prims/jvmtiEnvBase.hpp
+14
-6
src/share/vm/runtime/arguments.cpp
src/share/vm/runtime/arguments.cpp
+31
-2
src/share/vm/runtime/globals.hpp
src/share/vm/runtime/globals.hpp
+5
-1
src/share/vm/runtime/sweeper.cpp
src/share/vm/runtime/sweeper.cpp
+3
-0
未找到文件。
src/share/vm/code/nmethod.cpp
浏览文件 @
6caaeb4b
...
@@ -1151,6 +1151,7 @@ void nmethod::clear_inline_caches() {
...
@@ -1151,6 +1151,7 @@ void nmethod::clear_inline_caches() {
// Clear ICStubs of all compiled ICs
// Clear ICStubs of all compiled ICs
void
nmethod
::
clear_ic_stubs
()
{
void
nmethod
::
clear_ic_stubs
()
{
assert_locked_or_safepoint
(
CompiledIC_lock
);
assert_locked_or_safepoint
(
CompiledIC_lock
);
ResourceMark
rm
;
RelocIterator
iter
(
this
);
RelocIterator
iter
(
this
);
while
(
iter
.
next
())
{
while
(
iter
.
next
())
{
if
(
iter
.
type
()
==
relocInfo
::
virtual_call_type
)
{
if
(
iter
.
type
()
==
relocInfo
::
virtual_call_type
)
{
...
...
src/share/vm/prims/jvmtiEnv.cpp
浏览文件 @
6caaeb4b
/*
/*
* Copyright (c) 2003, 201
6
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
7
, 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
...
@@ -1000,8 +1000,9 @@ JvmtiEnv::GetOwnedMonitorInfo(JavaThread* java_thread, jint* owned_monitor_count
...
@@ -1000,8 +1000,9 @@ JvmtiEnv::GetOwnedMonitorInfo(JavaThread* java_thread, jint* owned_monitor_count
GrowableArray
<
jvmtiMonitorStackDepthInfo
*>
*
owned_monitors_list
=
GrowableArray
<
jvmtiMonitorStackDepthInfo
*>
*
owned_monitors_list
=
new
(
ResourceObj
::
C_HEAP
,
mtInternal
)
GrowableArray
<
jvmtiMonitorStackDepthInfo
*>
(
1
,
true
);
new
(
ResourceObj
::
C_HEAP
,
mtInternal
)
GrowableArray
<
jvmtiMonitorStackDepthInfo
*>
(
1
,
true
);
uint32_t
debug_bits
=
0
;
// It is only safe to perform the direct operation on the current
if
(
is_thread_fully_suspended
(
java_thread
,
true
,
&
debug_bits
))
{
// thread. All other usage needs to use a vm-safepoint-op for safety.
if
(
java_thread
==
calling_thread
)
{
err
=
get_owned_monitors
(
calling_thread
,
java_thread
,
owned_monitors_list
);
err
=
get_owned_monitors
(
calling_thread
,
java_thread
,
owned_monitors_list
);
}
else
{
}
else
{
// JVMTI get monitors info at safepoint. Do not require target thread to
// JVMTI get monitors info at safepoint. Do not require target thread to
...
@@ -1045,8 +1046,9 @@ JvmtiEnv::GetOwnedMonitorStackDepthInfo(JavaThread* java_thread, jint* monitor_i
...
@@ -1045,8 +1046,9 @@ JvmtiEnv::GetOwnedMonitorStackDepthInfo(JavaThread* java_thread, jint* monitor_i
GrowableArray
<
jvmtiMonitorStackDepthInfo
*>
*
owned_monitors_list
=
GrowableArray
<
jvmtiMonitorStackDepthInfo
*>
*
owned_monitors_list
=
new
(
ResourceObj
::
C_HEAP
,
mtInternal
)
GrowableArray
<
jvmtiMonitorStackDepthInfo
*>
(
1
,
true
);
new
(
ResourceObj
::
C_HEAP
,
mtInternal
)
GrowableArray
<
jvmtiMonitorStackDepthInfo
*>
(
1
,
true
);
uint32_t
debug_bits
=
0
;
// It is only safe to perform the direct operation on the current
if
(
is_thread_fully_suspended
(
java_thread
,
true
,
&
debug_bits
))
{
// thread. All other usage needs to use a vm-safepoint-op for safety.
if
(
java_thread
==
calling_thread
)
{
err
=
get_owned_monitors
(
calling_thread
,
java_thread
,
owned_monitors_list
);
err
=
get_owned_monitors
(
calling_thread
,
java_thread
,
owned_monitors_list
);
}
else
{
}
else
{
// JVMTI get owned monitors info at safepoint. Do not require target thread to
// JVMTI get owned monitors info at safepoint. Do not require target thread to
...
@@ -1087,9 +1089,11 @@ JvmtiEnv::GetOwnedMonitorStackDepthInfo(JavaThread* java_thread, jint* monitor_i
...
@@ -1087,9 +1089,11 @@ JvmtiEnv::GetOwnedMonitorStackDepthInfo(JavaThread* java_thread, jint* monitor_i
jvmtiError
jvmtiError
JvmtiEnv
::
GetCurrentContendedMonitor
(
JavaThread
*
java_thread
,
jobject
*
monitor_ptr
)
{
JvmtiEnv
::
GetCurrentContendedMonitor
(
JavaThread
*
java_thread
,
jobject
*
monitor_ptr
)
{
jvmtiError
err
=
JVMTI_ERROR_NONE
;
jvmtiError
err
=
JVMTI_ERROR_NONE
;
uint32_t
debug_bits
=
0
;
JavaThread
*
calling_thread
=
JavaThread
::
current
();
JavaThread
*
calling_thread
=
JavaThread
::
current
();
if
(
is_thread_fully_suspended
(
java_thread
,
true
,
&
debug_bits
))
{
// It is only safe to perform the direct operation on the current
// thread. All other usage needs to use a vm-safepoint-op for safety.
if
(
java_thread
==
calling_thread
)
{
err
=
get_current_contended_monitor
(
calling_thread
,
java_thread
,
monitor_ptr
);
err
=
get_current_contended_monitor
(
calling_thread
,
java_thread
,
monitor_ptr
);
}
else
{
}
else
{
// get contended monitor information at safepoint.
// get contended monitor information at safepoint.
...
@@ -1298,8 +1302,10 @@ JvmtiEnv::GetThreadGroupChildren(jthreadGroup group, jint* thread_count_ptr, jth
...
@@ -1298,8 +1302,10 @@ JvmtiEnv::GetThreadGroupChildren(jthreadGroup group, jint* thread_count_ptr, jth
jvmtiError
jvmtiError
JvmtiEnv
::
GetStackTrace
(
JavaThread
*
java_thread
,
jint
start_depth
,
jint
max_frame_count
,
jvmtiFrameInfo
*
frame_buffer
,
jint
*
count_ptr
)
{
JvmtiEnv
::
GetStackTrace
(
JavaThread
*
java_thread
,
jint
start_depth
,
jint
max_frame_count
,
jvmtiFrameInfo
*
frame_buffer
,
jint
*
count_ptr
)
{
jvmtiError
err
=
JVMTI_ERROR_NONE
;
jvmtiError
err
=
JVMTI_ERROR_NONE
;
uint32_t
debug_bits
=
0
;
if
(
is_thread_fully_suspended
(
java_thread
,
true
,
&
debug_bits
))
{
// It is only safe to perform the direct operation on the current
// thread. All other usage needs to use a vm-safepoint-op for safety.
if
(
java_thread
==
JavaThread
::
current
())
{
err
=
get_stack_trace
(
java_thread
,
start_depth
,
max_frame_count
,
frame_buffer
,
count_ptr
);
err
=
get_stack_trace
(
java_thread
,
start_depth
,
max_frame_count
,
frame_buffer
,
count_ptr
);
}
else
{
}
else
{
// JVMTI get stack trace at safepoint. Do not require target thread to
// JVMTI get stack trace at safepoint. Do not require target thread to
...
...
src/share/vm/prims/jvmtiEnvBase.hpp
浏览文件 @
6caaeb4b
/*
/*
* Copyright (c) 2003, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
7
, 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
...
@@ -356,9 +356,13 @@ public:
...
@@ -356,9 +356,13 @@ public:
}
}
VMOp_Type
type
()
const
{
return
VMOp_GetOwnedMonitorInfo
;
}
VMOp_Type
type
()
const
{
return
VMOp_GetOwnedMonitorInfo
;
}
void
doit
()
{
void
doit
()
{
((
JvmtiEnvBase
*
)
_env
)
->
get_owned_monitors
(
_calling_thread
,
_java_thread
,
_result
=
JVMTI_ERROR_THREAD_NOT_ALIVE
;
if
(
Threads
::
includes
(
_java_thread
)
&&
!
_java_thread
->
is_exiting
()
&&
_java_thread
->
threadObj
()
!=
NULL
)
{
_result
=
((
JvmtiEnvBase
*
)
_env
)
->
get_owned_monitors
(
_calling_thread
,
_java_thread
,
_owned_monitors_list
);
_owned_monitors_list
);
}
}
}
jvmtiError
result
()
{
return
_result
;
}
jvmtiError
result
()
{
return
_result
;
}
};
};
...
@@ -439,10 +443,14 @@ public:
...
@@ -439,10 +443,14 @@ public:
jvmtiError
result
()
{
return
_result
;
}
jvmtiError
result
()
{
return
_result
;
}
VMOp_Type
type
()
const
{
return
VMOp_GetStackTrace
;
}
VMOp_Type
type
()
const
{
return
VMOp_GetStackTrace
;
}
void
doit
()
{
void
doit
()
{
_result
=
JVMTI_ERROR_THREAD_NOT_ALIVE
;
if
(
Threads
::
includes
(
_java_thread
)
&&
!
_java_thread
->
is_exiting
()
&&
_java_thread
->
threadObj
()
!=
NULL
)
{
_result
=
((
JvmtiEnvBase
*
)
_env
)
->
get_stack_trace
(
_java_thread
,
_result
=
((
JvmtiEnvBase
*
)
_env
)
->
get_stack_trace
(
_java_thread
,
_start_depth
,
_max_count
,
_start_depth
,
_max_count
,
_frame_buffer
,
_count_ptr
);
_frame_buffer
,
_count_ptr
);
}
}
}
};
};
// forward declaration
// forward declaration
...
...
src/share/vm/runtime/arguments.cpp
浏览文件 @
6caaeb4b
/*
/*
* Copyright (c) 1997, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
7
, 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
...
@@ -1768,10 +1768,39 @@ void Arguments::set_heap_size() {
...
@@ -1768,10 +1768,39 @@ void Arguments::set_heap_size() {
FLAG_SET_CMDLINE
(
uintx
,
MaxRAMFraction
,
DefaultMaxRAMFraction
);
FLAG_SET_CMDLINE
(
uintx
,
MaxRAMFraction
,
DefaultMaxRAMFraction
);
}
}
const
julong
phys_mem
=
julong
phys_mem
=
FLAG_IS_DEFAULT
(
MaxRAM
)
?
MIN2
(
os
::
physical_memory
(),
(
julong
)
MaxRAM
)
FLAG_IS_DEFAULT
(
MaxRAM
)
?
MIN2
(
os
::
physical_memory
(),
(
julong
)
MaxRAM
)
:
(
julong
)
MaxRAM
;
:
(
julong
)
MaxRAM
;
// Experimental support for CGroup memory limits
if
(
UseCGroupMemoryLimitForHeap
)
{
// This is a rough indicator that a CGroup limit may be in force
// for this process
const
char
*
lim_file
=
"/sys/fs/cgroup/memory/memory.limit_in_bytes"
;
FILE
*
fp
=
fopen
(
lim_file
,
"r"
);
if
(
fp
!=
NULL
)
{
julong
cgroup_max
=
0
;
int
ret
=
fscanf
(
fp
,
JULONG_FORMAT
,
&
cgroup_max
);
if
(
ret
==
1
&&
cgroup_max
>
0
)
{
// If unlimited, cgroup_max will be a very large, but unspecified
// value, so use initial phys_mem as a limit
if
(
PrintGCDetails
&&
Verbose
)
{
// Cannot use gclog_or_tty yet.
tty
->
print_cr
(
"Setting phys_mem to the min of cgroup limit ("
JULONG_FORMAT
"MB) and initial phys_mem ("
JULONG_FORMAT
"MB)"
,
cgroup_max
/
M
,
phys_mem
/
M
);
}
phys_mem
=
MIN2
(
cgroup_max
,
phys_mem
);
}
else
{
warning
(
"Unable to read/parse cgroup memory limit from %s: %s"
,
lim_file
,
errno
!=
0
?
strerror
(
errno
)
:
"unknown error"
);
}
fclose
(
fp
);
}
else
{
warning
(
"Unable to open cgroup memory limit file %s (%s)"
,
lim_file
,
strerror
(
errno
));
}
}
// If the maximum heap size has not been set with -Xmx,
// If the maximum heap size has not been set with -Xmx,
// then set it as fraction of the size of physical memory,
// then set it as fraction of the size of physical memory,
// respecting the maximum and minimum sizes of the heap.
// respecting the maximum and minimum sizes of the heap.
...
...
src/share/vm/runtime/globals.hpp
浏览文件 @
6caaeb4b
/*
/*
* Copyright (c) 1997, 201
6
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
7
, 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
...
@@ -2068,6 +2068,10 @@ class CommandLineFlags {
...
@@ -2068,6 +2068,10 @@ class CommandLineFlags {
"Maximum ergonomically set heap size (in bytes); zero means use " \
"Maximum ergonomically set heap size (in bytes); zero means use " \
"MaxRAM / MaxRAMFraction") \
"MaxRAM / MaxRAMFraction") \
\
\
experimental(bool, UseCGroupMemoryLimitForHeap, false, \
"Use CGroup memory limit as physical memory limit for heap " \
"sizing") \
\
product(uintx, MaxRAMFraction, 4, \
product(uintx, MaxRAMFraction, 4, \
"Maximum fraction (1/n) of real memory used for maximum heap " \
"Maximum fraction (1/n) of real memory used for maximum heap " \
"size") \
"size") \
...
...
src/share/vm/runtime/sweeper.cpp
浏览文件 @
6caaeb4b
...
@@ -319,6 +319,7 @@ void NMethodSweeper::possibly_sweep() {
...
@@ -319,6 +319,7 @@ void NMethodSweeper::possibly_sweep() {
}
}
void
NMethodSweeper
::
sweep_code_cache
()
{
void
NMethodSweeper
::
sweep_code_cache
()
{
ResourceMark
rm
;
Ticks
sweep_start_counter
=
Ticks
::
now
();
Ticks
sweep_start_counter
=
Ticks
::
now
();
_flushed_count
=
0
;
_flushed_count
=
0
;
...
@@ -626,6 +627,7 @@ int NMethodSweeper::process_nmethod(nmethod *nm) {
...
@@ -626,6 +627,7 @@ int NMethodSweeper::process_nmethod(nmethod *nm) {
// state of the code cache if it's requested.
// state of the code cache if it's requested.
void
NMethodSweeper
::
log_sweep
(
const
char
*
msg
,
const
char
*
format
,
...)
{
void
NMethodSweeper
::
log_sweep
(
const
char
*
msg
,
const
char
*
format
,
...)
{
if
(
PrintMethodFlushing
)
{
if
(
PrintMethodFlushing
)
{
ResourceMark
rm
;
stringStream
s
;
stringStream
s
;
// Dump code cache state into a buffer before locking the tty,
// Dump code cache state into a buffer before locking the tty,
// because log_state() will use locks causing lock conflicts.
// because log_state() will use locks causing lock conflicts.
...
@@ -643,6 +645,7 @@ void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) {
...
@@ -643,6 +645,7 @@ void NMethodSweeper::log_sweep(const char* msg, const char* format, ...) {
}
}
if
(
LogCompilation
&&
(
xtty
!=
NULL
))
{
if
(
LogCompilation
&&
(
xtty
!=
NULL
))
{
ResourceMark
rm
;
stringStream
s
;
stringStream
s
;
// Dump code cache state into a buffer before locking the tty,
// Dump code cache state into a buffer before locking the tty,
// because log_state() will use locks causing lock conflicts.
// because log_state() will use locks causing lock conflicts.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录