Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
b8fb9915
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看板
提交
b8fb9915
编写于
3月 15, 2016
作者:
S
stefank
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8151539: Remove duplicate AlwaysTrueClosures
Reviewed-by: tschatzl, mgerdin, kbarrett, drwhite
上级
19213e14
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
27 addition
and
51 deletion
+27
-51
src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
+1
-7
src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
...are/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
+1
-8
src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
.../gc_implementation/parallelScavenge/psParallelCompact.cpp
+1
-8
src/share/vm/memory/genCollectedHeap.cpp
src/share/vm/memory/genCollectedHeap.cpp
+1
-7
src/share/vm/memory/iterator.hpp
src/share/vm/memory/iterator.hpp
+10
-0
src/share/vm/memory/referenceProcessor.cpp
src/share/vm/memory/referenceProcessor.cpp
+1
-7
src/share/vm/prims/whitebox.cpp
src/share/vm/prims/whitebox.cpp
+1
-5
src/share/vm/runtime/jniHandles.cpp
src/share/vm/runtime/jniHandles.cpp
+9
-9
src/share/vm/runtime/jniHandles.hpp
src/share/vm/runtime/jniHandles.hpp
+2
-0
未找到文件。
src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
浏览文件 @
b8fb9915
...
@@ -237,12 +237,6 @@ class G1AdjustPointersClosure: public HeapRegionClosure {
...
@@ -237,12 +237,6 @@ class G1AdjustPointersClosure: public HeapRegionClosure {
}
}
};
};
class
G1AlwaysTrueClosure
:
public
BoolObjectClosure
{
public:
bool
do_object_b
(
oop
p
)
{
return
true
;
}
};
static
G1AlwaysTrueClosure
always_true
;
void
G1MarkSweep
::
mark_sweep_phase3
()
{
void
G1MarkSweep
::
mark_sweep_phase3
()
{
G1CollectedHeap
*
g1h
=
G1CollectedHeap
::
heap
();
G1CollectedHeap
*
g1h
=
G1CollectedHeap
::
heap
();
...
@@ -266,7 +260,7 @@ void G1MarkSweep::mark_sweep_phase3() {
...
@@ -266,7 +260,7 @@ void G1MarkSweep::mark_sweep_phase3() {
// Now adjust pointers in remaining weak roots. (All of which should
// Now adjust pointers in remaining weak roots. (All of which should
// have been cleared if they pointed to non-surviving objects.)
// have been cleared if they pointed to non-surviving objects.)
JNIHandles
::
weak_oops_do
(
&
always_true
,
&
GenMarkSweep
::
adjust_pointer_closure
);
JNIHandles
::
weak_oops_do
(
&
GenMarkSweep
::
adjust_pointer_closure
);
if
(
G1StringDedup
::
is_enabled
())
{
if
(
G1StringDedup
::
is_enabled
())
{
G1StringDedup
::
oops_do
(
&
GenMarkSweep
::
adjust_pointer_closure
);
G1StringDedup
::
oops_do
(
&
GenMarkSweep
::
adjust_pointer_closure
);
...
...
src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp
浏览文件 @
b8fb9915
...
@@ -594,13 +594,6 @@ void PSMarkSweep::mark_sweep_phase2() {
...
@@ -594,13 +594,6 @@ void PSMarkSweep::mark_sweep_phase2() {
old_gen
->
precompact
();
old_gen
->
precompact
();
}
}
// This should be moved to the shared markSweep code!
class
PSAlwaysTrueClosure
:
public
BoolObjectClosure
{
public:
bool
do_object_b
(
oop
p
)
{
return
true
;
}
};
static
PSAlwaysTrueClosure
always_true
;
void
PSMarkSweep
::
mark_sweep_phase3
()
{
void
PSMarkSweep
::
mark_sweep_phase3
()
{
// Adjust the pointers to reflect the new locations
// Adjust the pointers to reflect the new locations
GCTraceTime
tm
(
"phase 3"
,
PrintGCDetails
&&
Verbose
,
true
,
_gc_timer
,
_gc_tracer
->
gc_id
());
GCTraceTime
tm
(
"phase 3"
,
PrintGCDetails
&&
Verbose
,
true
,
_gc_timer
,
_gc_tracer
->
gc_id
());
...
@@ -630,7 +623,7 @@ void PSMarkSweep::mark_sweep_phase3() {
...
@@ -630,7 +623,7 @@ void PSMarkSweep::mark_sweep_phase3() {
// Now adjust pointers in remaining weak roots. (All of which should
// Now adjust pointers in remaining weak roots. (All of which should
// have been cleared if they pointed to non-surviving objects.)
// have been cleared if they pointed to non-surviving objects.)
// Global (weak) JNI handles
// Global (weak) JNI handles
JNIHandles
::
weak_oops_do
(
&
always_true
,
adjust_pointer_closure
());
JNIHandles
::
weak_oops_do
(
adjust_pointer_closure
());
CodeBlobToOopClosure
adjust_from_blobs
(
adjust_pointer_closure
(),
CodeBlobToOopClosure
::
FixRelocations
);
CodeBlobToOopClosure
adjust_from_blobs
(
adjust_pointer_closure
(),
CodeBlobToOopClosure
::
FixRelocations
);
CodeCache
::
blobs_do
(
&
adjust_from_blobs
);
CodeCache
::
blobs_do
(
&
adjust_from_blobs
);
...
...
src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
浏览文件 @
b8fb9915
...
@@ -2441,13 +2441,6 @@ void PSParallelCompact::follow_class_loader(ParCompactionManager* cm,
...
@@ -2441,13 +2441,6 @@ void PSParallelCompact::follow_class_loader(ParCompactionManager* cm,
cld
->
oops_do
(
&
mark_and_push_closure
,
&
follow_klass_closure
,
true
);
cld
->
oops_do
(
&
mark_and_push_closure
,
&
follow_klass_closure
,
true
);
}
}
// This should be moved to the shared markSweep code!
class
PSAlwaysTrueClosure
:
public
BoolObjectClosure
{
public:
bool
do_object_b
(
oop
p
)
{
return
true
;
}
};
static
PSAlwaysTrueClosure
always_true
;
void
PSParallelCompact
::
adjust_roots
()
{
void
PSParallelCompact
::
adjust_roots
()
{
// Adjust the pointers to reflect the new locations
// Adjust the pointers to reflect the new locations
GCTraceTime
tm
(
"adjust roots"
,
print_phases
(),
true
,
&
_gc_timer
,
_gc_tracer
.
gc_id
());
GCTraceTime
tm
(
"adjust roots"
,
print_phases
(),
true
,
&
_gc_timer
,
_gc_tracer
.
gc_id
());
...
@@ -2470,7 +2463,7 @@ void PSParallelCompact::adjust_roots() {
...
@@ -2470,7 +2463,7 @@ void PSParallelCompact::adjust_roots() {
// Now adjust pointers in remaining weak roots. (All of which should
// Now adjust pointers in remaining weak roots. (All of which should
// have been cleared if they pointed to non-surviving objects.)
// have been cleared if they pointed to non-surviving objects.)
// Global (weak) JNI handles
// Global (weak) JNI handles
JNIHandles
::
weak_oops_do
(
&
always_true
,
adjust_pointer_closure
());
JNIHandles
::
weak_oops_do
(
adjust_pointer_closure
());
CodeBlobToOopClosure
adjust_from_blobs
(
adjust_pointer_closure
(),
CodeBlobToOopClosure
::
FixRelocations
);
CodeBlobToOopClosure
adjust_from_blobs
(
adjust_pointer_closure
(),
CodeBlobToOopClosure
::
FixRelocations
);
CodeCache
::
blobs_do
(
&
adjust_from_blobs
);
CodeCache
::
blobs_do
(
&
adjust_from_blobs
);
...
...
src/share/vm/memory/genCollectedHeap.cpp
浏览文件 @
b8fb9915
...
@@ -745,14 +745,8 @@ void GenCollectedHeap::gen_process_roots(int level,
...
@@ -745,14 +745,8 @@ void GenCollectedHeap::gen_process_roots(int level,
}
}
class
AlwaysTrueClosure
:
public
BoolObjectClosure
{
public:
bool
do_object_b
(
oop
p
)
{
return
true
;
}
};
static
AlwaysTrueClosure
always_true
;
void
GenCollectedHeap
::
gen_process_weak_roots
(
OopClosure
*
root_closure
)
{
void
GenCollectedHeap
::
gen_process_weak_roots
(
OopClosure
*
root_closure
)
{
JNIHandles
::
weak_oops_do
(
&
always_true
,
root_closure
);
JNIHandles
::
weak_oops_do
(
root_closure
);
for
(
int
i
=
0
;
i
<
_n_gens
;
i
++
)
{
for
(
int
i
=
0
;
i
<
_n_gens
;
i
++
)
{
_gens
[
i
]
->
ref_processor
()
->
weak_oops_do
(
root_closure
);
_gens
[
i
]
->
ref_processor
()
->
weak_oops_do
(
root_closure
);
}
}
...
...
src/share/vm/memory/iterator.hpp
浏览文件 @
b8fb9915
...
@@ -219,6 +219,16 @@ class BoolObjectClosure : public Closure {
...
@@ -219,6 +219,16 @@ class BoolObjectClosure : public Closure {
virtual
bool
do_object_b
(
oop
obj
)
=
0
;
virtual
bool
do_object_b
(
oop
obj
)
=
0
;
};
};
class
AlwaysTrueClosure
:
public
BoolObjectClosure
{
public:
bool
do_object_b
(
oop
p
)
{
return
true
;
}
};
class
AlwaysFalseClosure
:
public
BoolObjectClosure
{
public:
bool
do_object_b
(
oop
p
)
{
return
false
;
}
};
// Applies an oop closure to all ref fields in objects iterated over in an
// Applies an oop closure to all ref fields in objects iterated over in an
// object iteration.
// object iteration.
class
ObjectToOopClosure
:
public
ObjectClosure
{
class
ObjectToOopClosure
:
public
ObjectClosure
{
...
...
src/share/vm/memory/referenceProcessor.cpp
浏览文件 @
b8fb9915
...
@@ -275,11 +275,6 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references(
...
@@ -275,11 +275,6 @@ ReferenceProcessorStats ReferenceProcessor::process_discovered_references(
#ifndef PRODUCT
#ifndef PRODUCT
// Calculate the number of jni handles.
// Calculate the number of jni handles.
uint
ReferenceProcessor
::
count_jni_refs
()
{
uint
ReferenceProcessor
::
count_jni_refs
()
{
class
AlwaysAliveClosure
:
public
BoolObjectClosure
{
public:
virtual
bool
do_object_b
(
oop
obj
)
{
return
true
;
}
};
class
CountHandleClosure
:
public
OopClosure
{
class
CountHandleClosure
:
public
OopClosure
{
private:
private:
int
_count
;
int
_count
;
...
@@ -290,8 +285,7 @@ uint ReferenceProcessor::count_jni_refs() {
...
@@ -290,8 +285,7 @@ uint ReferenceProcessor::count_jni_refs() {
int
count
()
{
return
_count
;
}
int
count
()
{
return
_count
;
}
};
};
CountHandleClosure
global_handle_count
;
CountHandleClosure
global_handle_count
;
AlwaysAliveClosure
always_alive
;
JNIHandles
::
weak_oops_do
(
&
global_handle_count
);
JNIHandles
::
weak_oops_do
(
&
always_alive
,
&
global_handle_count
);
return
global_handle_count
.
count
();
return
global_handle_count
.
count
();
}
}
#endif
#endif
...
...
src/share/vm/prims/whitebox.cpp
浏览文件 @
b8fb9915
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "memory/metadataFactory.hpp"
#include "memory/metadataFactory.hpp"
#include "memory/metaspaceShared.hpp"
#include "memory/metaspaceShared.hpp"
#include "memory/iterator.hpp"
#include "memory/universe.hpp"
#include "memory/universe.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.inline.hpp"
...
@@ -583,11 +584,6 @@ class VM_WhiteBoxOperation : public VM_Operation {
...
@@ -583,11 +584,6 @@ class VM_WhiteBoxOperation : public VM_Operation {
bool
allow_nested_vm_operations
()
const
{
return
true
;
}
bool
allow_nested_vm_operations
()
const
{
return
true
;
}
};
};
class
AlwaysFalseClosure
:
public
BoolObjectClosure
{
public:
bool
do_object_b
(
oop
p
)
{
return
false
;
}
};
static
AlwaysFalseClosure
always_false
;
static
AlwaysFalseClosure
always_false
;
class
VM_WhiteBoxCleanMethodData
:
public
VM_WhiteBoxOperation
{
class
VM_WhiteBoxCleanMethodData
:
public
VM_WhiteBoxOperation
{
...
...
src/share/vm/runtime/jniHandles.cpp
浏览文件 @
b8fb9915
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include "precompiled.hpp"
#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
#include "classfile/systemDictionary.hpp"
#include "memory/iterator.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.inline.hpp"
#include "prims/jvmtiExport.hpp"
#include "prims/jvmtiExport.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/jniHandles.hpp"
...
@@ -129,6 +130,12 @@ void JNIHandles::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
...
@@ -129,6 +130,12 @@ void JNIHandles::weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f) {
}
}
void
JNIHandles
::
weak_oops_do
(
OopClosure
*
f
)
{
AlwaysTrueClosure
always_true
;
weak_oops_do
(
&
always_true
,
f
);
}
void
JNIHandles
::
initialize
()
{
void
JNIHandles
::
initialize
()
{
_global_handles
=
JNIHandleBlock
::
allocate_block
();
_global_handles
=
JNIHandleBlock
::
allocate_block
();
_weak_global_handles
=
JNIHandleBlock
::
allocate_block
();
_weak_global_handles
=
JNIHandleBlock
::
allocate_block
();
...
@@ -186,11 +193,6 @@ long JNIHandles::weak_global_handle_memory_usage() {
...
@@ -186,11 +193,6 @@ long JNIHandles::weak_global_handle_memory_usage() {
}
}
class
AlwaysAliveClosure
:
public
BoolObjectClosure
{
public:
bool
do_object_b
(
oop
obj
)
{
return
true
;
}
};
class
CountHandleClosure
:
public
OopClosure
{
class
CountHandleClosure
:
public
OopClosure
{
private:
private:
int
_count
;
int
_count
;
...
@@ -212,9 +214,8 @@ void JNIHandles::print_on(outputStream* st) {
...
@@ -212,9 +214,8 @@ void JNIHandles::print_on(outputStream* st) {
"JNIHandles not initialized"
);
"JNIHandles not initialized"
);
CountHandleClosure
global_handle_count
;
CountHandleClosure
global_handle_count
;
AlwaysAliveClosure
always_alive
;
oops_do
(
&
global_handle_count
);
oops_do
(
&
global_handle_count
);
weak_oops_do
(
&
always_alive
,
&
global_handle_count
);
weak_oops_do
(
&
global_handle_count
);
st
->
print_cr
(
"JNI global references: %d"
,
global_handle_count
.
count
());
st
->
print_cr
(
"JNI global references: %d"
,
global_handle_count
.
count
());
st
->
cr
();
st
->
cr
();
...
@@ -231,10 +232,9 @@ public:
...
@@ -231,10 +232,9 @@ public:
void
JNIHandles
::
verify
()
{
void
JNIHandles
::
verify
()
{
VerifyHandleClosure
verify_handle
;
VerifyHandleClosure
verify_handle
;
AlwaysAliveClosure
always_alive
;
oops_do
(
&
verify_handle
);
oops_do
(
&
verify_handle
);
weak_oops_do
(
&
always_alive
,
&
verify_handle
);
weak_oops_do
(
&
verify_handle
);
}
}
...
...
src/share/vm/runtime/jniHandles.hpp
浏览文件 @
b8fb9915
...
@@ -86,6 +86,8 @@ class JNIHandles : AllStatic {
...
@@ -86,6 +86,8 @@ class JNIHandles : AllStatic {
static
void
oops_do
(
OopClosure
*
f
);
static
void
oops_do
(
OopClosure
*
f
);
// Traversal of weak global handles. Unreachable oops are cleared.
// Traversal of weak global handles. Unreachable oops are cleared.
static
void
weak_oops_do
(
BoolObjectClosure
*
is_alive
,
OopClosure
*
f
);
static
void
weak_oops_do
(
BoolObjectClosure
*
is_alive
,
OopClosure
*
f
);
// Traversal of weak global handles.
static
void
weak_oops_do
(
OopClosure
*
f
);
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录