Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
f8f12702
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看板
提交
f8f12702
编写于
7月 23, 2011
作者:
C
coleenp
浏览文件
操作
浏览文件
下载
差异文件
Merge
上级
22f3d649
65ca0632
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
73 addition
and
19 deletion
+73
-19
make/jprt.gmk
make/jprt.gmk
+3
-3
src/share/vm/classfile/javaClasses.cpp
src/share/vm/classfile/javaClasses.cpp
+27
-1
src/share/vm/classfile/javaClasses.hpp
src/share/vm/classfile/javaClasses.hpp
+7
-1
src/share/vm/prims/jvmtiTagMap.cpp
src/share/vm/prims/jvmtiTagMap.cpp
+36
-14
未找到文件。
make/jprt.gmk
浏览文件 @
f8f12702
...
...
@@ -34,13 +34,13 @@ else
endif
jprt_build_productEmb:
$(MAKE) JAVASE_EMBEDDED=true jprt_build_product
$(MAKE) JAVASE_EMBEDDED=true
MINIMIZE_RAM_USAGE=true
jprt_build_product
jprt_build_debugEmb:
$(MAKE) JAVASE_EMBEDDED=true jprt_build_debug
$(MAKE) JAVASE_EMBEDDED=true
MINIMIZE_RAM_USAGE=true
jprt_build_debug
jprt_build_fastdebugEmb:
$(MAKE) JAVASE_EMBEDDED=true jprt_build_fastdebug
$(MAKE) JAVASE_EMBEDDED=true
MINIMIZE_RAM_USAGE=true
jprt_build_fastdebug
jprt_build_productOpen:
$(MAKE) OPENJDK=true jprt_build_product
...
...
src/share/vm/classfile/javaClasses.cpp
浏览文件 @
f8f12702
...
...
@@ -1019,6 +1019,16 @@ void java_lang_ThreadGroup::compute_offsets() {
compute_offset
(
_ngroups_offset
,
k
,
vmSymbols
::
ngroups_name
(),
vmSymbols
::
int_signature
());
}
oop
java_lang_Throwable
::
unassigned_stacktrace
()
{
instanceKlass
*
ik
=
instanceKlass
::
cast
(
SystemDictionary
::
Throwable_klass
());
address
addr
=
ik
->
static_field_addr
(
static_unassigned_stacktrace_offset
);
if
(
UseCompressedOops
)
{
return
oopDesc
::
load_decode_heap_oop
((
narrowOop
*
)
addr
);
}
else
{
return
oopDesc
::
load_decode_heap_oop
((
oop
*
)
addr
);
}
}
oop
java_lang_Throwable
::
backtrace
(
oop
throwable
)
{
return
throwable
->
obj_field_acquire
(
backtrace_offset
);
}
...
...
@@ -1044,9 +1054,13 @@ void java_lang_Throwable::set_message(oop throwable, oop value) {
}
void
java_lang_Throwable
::
set_stacktrace
(
oop
throwable
,
oop
st_element_array
)
{
throwable
->
obj_field_put
(
stackTrace_offset
,
st_element_array
);
}
void
java_lang_Throwable
::
clear_stacktrace
(
oop
throwable
)
{
assert
(
JDK_Version
::
is_gte_jdk14x_version
(),
"should only be called in >= 1.4"
);
throwable
->
obj_field_put
(
stackTrace_offset
,
NULL
);
set_stacktrace
(
throwable
,
NULL
);
}
...
...
@@ -1340,6 +1354,7 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle met
if
(
JDK_Version
::
is_gte_jdk14x_version
())
{
// New since 1.4, clear lazily constructed Java level stacktrace if
// refilling occurs
// This is unnecessary in 1.7+ but harmless
clear_stacktrace
(
throwable
());
}
...
...
@@ -1541,6 +1556,15 @@ void java_lang_Throwable::fill_in_stack_trace_of_preallocated_backtrace(Handle t
// Bail-out for deep stacks
if
(
chunk_count
>=
max_chunks
)
break
;
}
// For Java 7+ we support the Throwable immutability protocol defined for Java 7. This support
// was missing in 7u0 so in 7u0 there is a workaround in the Throwable class. That workaround
// can be removed in a JDK using this JVM version
if
(
JDK_Version
::
is_gte_jdk17x_version
())
{
java_lang_Throwable
::
set_stacktrace
(
throwable
(),
java_lang_Throwable
::
unassigned_stacktrace
());
assert
(
java_lang_Throwable
::
unassigned_stacktrace
()
!=
NULL
,
"not initialized"
);
}
}
...
...
@@ -2770,6 +2794,7 @@ int java_lang_Throwable::backtrace_offset;
int
java_lang_Throwable
::
detailMessage_offset
;
int
java_lang_Throwable
::
cause_offset
;
int
java_lang_Throwable
::
stackTrace_offset
;
int
java_lang_Throwable
::
static_unassigned_stacktrace_offset
;
int
java_lang_reflect_AccessibleObject
::
override_offset
;
int
java_lang_reflect_Method
::
clazz_offset
;
int
java_lang_reflect_Method
::
name_offset
;
...
...
@@ -2947,6 +2972,7 @@ void JavaClasses::compute_hard_coded_offsets() {
java_lang_Throwable
::
detailMessage_offset
=
java_lang_Throwable
::
hc_detailMessage_offset
*
x
+
header
;
java_lang_Throwable
::
cause_offset
=
java_lang_Throwable
::
hc_cause_offset
*
x
+
header
;
java_lang_Throwable
::
stackTrace_offset
=
java_lang_Throwable
::
hc_stackTrace_offset
*
x
+
header
;
java_lang_Throwable
::
static_unassigned_stacktrace_offset
=
java_lang_Throwable
::
hc_static_unassigned_stacktrace_offset
*
x
;
// java_lang_boxing_object
java_lang_boxing_object
::
value_offset
=
java_lang_boxing_object
::
hc_value_offset
+
header
;
...
...
src/share/vm/classfile/javaClasses.hpp
浏览文件 @
f8f12702
...
...
@@ -393,6 +393,9 @@ class java_lang_Throwable: AllStatic {
hc_cause_offset
=
2
,
// New since 1.4
hc_stackTrace_offset
=
3
// New since 1.4
};
enum
{
hc_static_unassigned_stacktrace_offset
=
0
// New since 1.7
};
// Trace constants
enum
{
trace_methods_offset
=
0
,
...
...
@@ -406,6 +409,7 @@ class java_lang_Throwable: AllStatic {
static
int
detailMessage_offset
;
static
int
cause_offset
;
static
int
stackTrace_offset
;
static
int
static_unassigned_stacktrace_offset
;
// Printing
static
char
*
print_stack_element_to_buffer
(
methodOop
method
,
int
bci
);
...
...
@@ -414,6 +418,9 @@ class java_lang_Throwable: AllStatic {
static
void
clear_stacktrace
(
oop
throwable
);
// No stack trace available
static
const
char
*
no_stack_trace_message
();
// Stacktrace (post JDK 1.7.0 to allow immutability protocol to be followed)
static
void
set_stacktrace
(
oop
throwable
,
oop
st_element_array
);
static
oop
unassigned_stacktrace
();
public:
// Backtrace
...
...
@@ -438,7 +445,6 @@ class java_lang_Throwable: AllStatic {
static
void
allocate_backtrace
(
Handle
throwable
,
TRAPS
);
// Fill in current stack trace for throwable with preallocated backtrace (no GC)
static
void
fill_in_stack_trace_of_preallocated_backtrace
(
Handle
throwable
);
// Fill in current stack trace, can cause GC
static
void
fill_in_stack_trace
(
Handle
throwable
,
methodHandle
method
,
TRAPS
);
static
void
fill_in_stack_trace
(
Handle
throwable
,
methodHandle
method
=
methodHandle
());
...
...
src/share/vm/prims/jvmtiTagMap.cpp
浏览文件 @
f8f12702
...
...
@@ -1647,6 +1647,7 @@ class ObjectMarker : AllStatic {
// saved headers
static
GrowableArray
<
oop
>*
_saved_oop_stack
;
static
GrowableArray
<
markOop
>*
_saved_mark_stack
;
static
bool
_needs_reset
;
// do we need to reset mark bits?
public:
static
void
init
();
// initialize
...
...
@@ -1654,10 +1655,14 @@ class ObjectMarker : AllStatic {
static
inline
void
mark
(
oop
o
);
// mark an object
static
inline
bool
visited
(
oop
o
);
// check if object has been visited
static
inline
bool
needs_reset
()
{
return
_needs_reset
;
}
static
inline
void
set_needs_reset
(
bool
v
)
{
_needs_reset
=
v
;
}
};
GrowableArray
<
oop
>*
ObjectMarker
::
_saved_oop_stack
=
NULL
;
GrowableArray
<
markOop
>*
ObjectMarker
::
_saved_mark_stack
=
NULL
;
bool
ObjectMarker
::
_needs_reset
=
true
;
// need to reset mark bits by default
// initialize ObjectMarker - prepares for object marking
void
ObjectMarker
::
init
()
{
...
...
@@ -1680,7 +1685,13 @@ void ObjectMarker::done() {
// iterate over all objects and restore the mark bits to
// their initial value
RestoreMarksClosure
blk
;
Universe
::
heap
()
->
object_iterate
(
&
blk
);
if
(
needs_reset
())
{
Universe
::
heap
()
->
object_iterate
(
&
blk
);
}
else
{
// We don't need to reset mark bits on this call, but reset the
// flag to the default for the next call.
set_needs_reset
(
true
);
}
// When sharing is enabled we need to restore the headers of the objects
// in the readwrite space too.
...
...
@@ -3023,7 +3034,8 @@ inline bool VM_HeapWalkOperation::iterate_over_object(oop o) {
}
// collects all simple (non-stack) roots.
// Collects all simple (non-stack) roots except for threads;
// threads are handled in collect_stack_roots() as an optimization.
// if there's a heap root callback provided then the callback is
// invoked for each simple root.
// if an object reference callback is provided then all simple
...
...
@@ -3054,16 +3066,7 @@ inline bool VM_HeapWalkOperation::collect_simple_roots() {
return
false
;
}
// Threads
for
(
JavaThread
*
thread
=
Threads
::
first
();
thread
!=
NULL
;
thread
=
thread
->
next
())
{
oop
threadObj
=
thread
->
threadObj
();
if
(
threadObj
!=
NULL
&&
!
thread
->
is_exiting
()
&&
!
thread
->
is_hidden_from_external_view
())
{
bool
cont
=
CallbackInvoker
::
report_simple_root
(
JVMTI_HEAP_REFERENCE_THREAD
,
threadObj
);
if
(
!
cont
)
{
return
false
;
}
}
}
// threads are now handled in collect_stack_roots()
// Other kinds of roots maintained by HotSpot
// Many of these won't be visible but others (such as instances of important
...
...
@@ -3175,13 +3178,20 @@ inline bool VM_HeapWalkOperation::collect_stack_roots(JavaThread* java_thread,
}
// collects all stack roots - for each thread it walks the execution
// Collects the simple roots for all threads and collects all
// stack roots - for each thread it walks the execution
// stack to find all references and local JNI refs.
inline
bool
VM_HeapWalkOperation
::
collect_stack_roots
()
{
JNILocalRootsClosure
blk
;
for
(
JavaThread
*
thread
=
Threads
::
first
();
thread
!=
NULL
;
thread
=
thread
->
next
())
{
oop
threadObj
=
thread
->
threadObj
();
if
(
threadObj
!=
NULL
&&
!
thread
->
is_exiting
()
&&
!
thread
->
is_hidden_from_external_view
())
{
// Collect the simple root for this thread before we
// collect its stack roots
if
(
!
CallbackInvoker
::
report_simple_root
(
JVMTI_HEAP_REFERENCE_THREAD
,
threadObj
))
{
return
false
;
}
if
(
!
collect_stack_roots
(
thread
,
&
blk
))
{
return
false
;
}
...
...
@@ -3235,8 +3245,20 @@ void VM_HeapWalkOperation::doit() {
// the heap walk starts with an initial object or the heap roots
if
(
initial_object
().
is_null
())
{
if
(
!
collect_simple_roots
())
return
;
// If either collect_stack_roots() or collect_simple_roots()
// returns false at this point, then there are no mark bits
// to reset.
ObjectMarker
::
set_needs_reset
(
false
);
// Calling collect_stack_roots() before collect_simple_roots()
// can result in a big performance boost for an agent that is
// focused on analyzing references in the thread stacks.
if
(
!
collect_stack_roots
())
return
;
if
(
!
collect_simple_roots
())
return
;
// no early return so enable heap traversal to reset the mark bits
ObjectMarker
::
set_needs_reset
(
true
);
}
else
{
visit_stack
()
->
push
(
initial_object
()());
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录