提交 23be3758 编写于 作者: S stefank

8035393: Use CLDClosure instead of CLDToOopClosure in frame::oops_interpreted_do

Reviewed-by: tschatzl, coleenp
上级 92b3c0e6
...@@ -65,7 +65,7 @@ void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) { ...@@ -65,7 +65,7 @@ void ScavengeRootsTask::do_it(GCTaskManager* manager, uint which) {
case threads: case threads:
{ {
ResourceMark rm; ResourceMark rm;
CLDToOopClosure* cld_closure = NULL; // Not needed. All CLDs are already visited. CLDClosure* cld_closure = NULL; // Not needed. All CLDs are already visited.
Threads::oops_do(&roots_closure, cld_closure, NULL); Threads::oops_do(&roots_closure, cld_closure, NULL);
} }
break; break;
...@@ -122,7 +122,7 @@ void ThreadRootsTask::do_it(GCTaskManager* manager, uint which) { ...@@ -122,7 +122,7 @@ void ThreadRootsTask::do_it(GCTaskManager* manager, uint which) {
PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which); PSPromotionManager* pm = PSPromotionManager::gc_thread_promotion_manager(which);
PSScavengeRootsClosure roots_closure(pm); PSScavengeRootsClosure roots_closure(pm);
CLDToOopClosure* roots_from_clds = NULL; // Not needed. All CLDs are already visited. CLDClosure* roots_from_clds = NULL; // Not needed. All CLDs are already visited.
CodeBlobToOopClosure roots_in_blobs(&roots_closure, /*do_marking=*/ true); CodeBlobToOopClosure roots_in_blobs(&roots_closure, /*do_marking=*/ true);
if (_java_thread != NULL) if (_java_thread != NULL)
......
...@@ -128,6 +128,11 @@ class KlassClosure : public Closure { ...@@ -128,6 +128,11 @@ class KlassClosure : public Closure {
virtual void do_klass(Klass* k) = 0; virtual void do_klass(Klass* k) = 0;
}; };
class CLDClosure : public Closure {
public:
virtual void do_cld(ClassLoaderData* cld) = 0;
};
class KlassToOopClosure : public KlassClosure { class KlassToOopClosure : public KlassClosure {
OopClosure* _oop_closure; OopClosure* _oop_closure;
public: public:
...@@ -135,7 +140,7 @@ class KlassToOopClosure : public KlassClosure { ...@@ -135,7 +140,7 @@ class KlassToOopClosure : public KlassClosure {
virtual void do_klass(Klass* k); virtual void do_klass(Klass* k);
}; };
class CLDToOopClosure { class CLDToOopClosure : public CLDClosure {
OopClosure* _oop_closure; OopClosure* _oop_closure;
KlassToOopClosure _klass_closure; KlassToOopClosure _klass_closure;
bool _must_claim_cld; bool _must_claim_cld;
......
...@@ -900,7 +900,7 @@ oop* frame::interpreter_callee_receiver_addr(Symbol* signature) { ...@@ -900,7 +900,7 @@ oop* frame::interpreter_callee_receiver_addr(Symbol* signature) {
} }
void frame::oops_interpreted_do(OopClosure* f, CLDToOopClosure* cld_f, void frame::oops_interpreted_do(OopClosure* f, CLDClosure* cld_f,
const RegisterMap* map, bool query_oop_map_cache) { const RegisterMap* map, bool query_oop_map_cache) {
assert(is_interpreted_frame(), "Not an interpreted frame"); assert(is_interpreted_frame(), "Not an interpreted frame");
assert(map != NULL, "map must be set"); assert(map != NULL, "map must be set");
...@@ -1140,7 +1140,7 @@ void frame::oops_entry_do(OopClosure* f, const RegisterMap* map) { ...@@ -1140,7 +1140,7 @@ void frame::oops_entry_do(OopClosure* f, const RegisterMap* map) {
} }
void frame::oops_do_internal(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache) { void frame::oops_do_internal(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache) {
#ifndef PRODUCT #ifndef PRODUCT
// simulate GC crash here to dump java thread in error report // simulate GC crash here to dump java thread in error report
if (CrashGCForDumpingJavaThread) { if (CrashGCForDumpingJavaThread) {
......
...@@ -419,19 +419,19 @@ class frame VALUE_OBJ_CLASS_SPEC { ...@@ -419,19 +419,19 @@ class frame VALUE_OBJ_CLASS_SPEC {
// Oops-do's // Oops-do's
void oops_compiled_arguments_do(Symbol* signature, bool has_receiver, bool has_appendix, const RegisterMap* reg_map, OopClosure* f); void oops_compiled_arguments_do(Symbol* signature, bool has_receiver, bool has_appendix, const RegisterMap* reg_map, OopClosure* f);
void oops_interpreted_do(OopClosure* f, CLDToOopClosure* cld_f, const RegisterMap* map, bool query_oop_map_cache = true); void oops_interpreted_do(OopClosure* f, CLDClosure* cld_f, const RegisterMap* map, bool query_oop_map_cache = true);
private: private:
void oops_interpreted_arguments_do(Symbol* signature, bool has_receiver, OopClosure* f); void oops_interpreted_arguments_do(Symbol* signature, bool has_receiver, OopClosure* f);
// Iteration of oops // Iteration of oops
void oops_do_internal(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache); void oops_do_internal(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map, bool use_interpreter_oop_map_cache);
void oops_entry_do(OopClosure* f, const RegisterMap* map); void oops_entry_do(OopClosure* f, const RegisterMap* map);
void oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* map); void oops_code_blob_do(OopClosure* f, CodeBlobClosure* cf, const RegisterMap* map);
int adjust_offset(Method* method, int index); // helper for above fn int adjust_offset(Method* method, int index); // helper for above fn
public: public:
// Memory management // Memory management
void oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map) { oops_do_internal(f, cld_f, cf, map, true); } void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf, RegisterMap* map) { oops_do_internal(f, cld_f, cf, map, true); }
void nmethods_do(CodeBlobClosure* cf); void nmethods_do(CodeBlobClosure* cf);
// RedefineClasses support for finding live interpreted methods on the stack // RedefineClasses support for finding live interpreted methods on the stack
......
...@@ -834,7 +834,7 @@ bool Thread::claim_oops_do_par_case(int strong_roots_parity) { ...@@ -834,7 +834,7 @@ bool Thread::claim_oops_do_par_case(int strong_roots_parity) {
return false; return false;
} }
void Thread::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) { void Thread::oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf) {
active_handles()->oops_do(f); active_handles()->oops_do(f);
// Do oop for ThreadShadow // Do oop for ThreadShadow
f->do_oop((oop*)&_pending_exception); f->do_oop((oop*)&_pending_exception);
...@@ -2730,7 +2730,7 @@ public: ...@@ -2730,7 +2730,7 @@ public:
} }
}; };
void JavaThread::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) { void JavaThread::oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf) {
// Verify that the deferred card marks have been flushed. // Verify that the deferred card marks have been flushed.
assert(deferred_card_mark().is_empty(), "Should be empty during GC"); assert(deferred_card_mark().is_empty(), "Should be empty during GC");
...@@ -3253,7 +3253,7 @@ CompilerThread::CompilerThread(CompileQueue* queue, CompilerCounters* counters) ...@@ -3253,7 +3253,7 @@ CompilerThread::CompilerThread(CompileQueue* queue, CompilerCounters* counters)
#endif #endif
} }
void CompilerThread::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) { void CompilerThread::oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf) {
JavaThread::oops_do(f, cld_f, cf); JavaThread::oops_do(f, cld_f, cf);
if (_scanned_nmethod != NULL && cf != NULL) { if (_scanned_nmethod != NULL && cf != NULL) {
// Safepoints can occur when the sweeper is scanning an nmethod so // Safepoints can occur when the sweeper is scanning an nmethod so
...@@ -4167,14 +4167,14 @@ bool Threads::includes(JavaThread* p) { ...@@ -4167,14 +4167,14 @@ bool Threads::includes(JavaThread* p) {
// uses the Threads_lock to gurantee this property. It also makes sure that // uses the Threads_lock to gurantee this property. It also makes sure that
// all threads gets blocked when exiting or starting). // all threads gets blocked when exiting or starting).
void Threads::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) { void Threads::oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf) {
ALL_JAVA_THREADS(p) { ALL_JAVA_THREADS(p) {
p->oops_do(f, cld_f, cf); p->oops_do(f, cld_f, cf);
} }
VMThread::vm_thread()->oops_do(f, cld_f, cf); VMThread::vm_thread()->oops_do(f, cld_f, cf);
} }
void Threads::possibly_parallel_oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) { void Threads::possibly_parallel_oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf) {
// Introduce a mechanism allowing parallel threads to claim threads as // Introduce a mechanism allowing parallel threads to claim threads as
// root groups. Overhead should be small enough to use all the time, // root groups. Overhead should be small enough to use all the time,
// even in sequential code. // even in sequential code.
......
...@@ -472,7 +472,7 @@ class Thread: public ThreadShadow { ...@@ -472,7 +472,7 @@ class Thread: public ThreadShadow {
// Apply "cld_f->do_cld" to CLDs that are otherwise not kept alive. // Apply "cld_f->do_cld" to CLDs that are otherwise not kept alive.
// Used by JavaThread::oops_do. // Used by JavaThread::oops_do.
// Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames // Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames
virtual void oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf); virtual void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf);
// Handles the parallel case for the method below. // Handles the parallel case for the method below.
private: private:
...@@ -1429,7 +1429,7 @@ class JavaThread: public Thread { ...@@ -1429,7 +1429,7 @@ class JavaThread: public Thread {
void frames_do(void f(frame*, const RegisterMap*)); void frames_do(void f(frame*, const RegisterMap*));
// Memory operations // Memory operations
void oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf); void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf);
// Sweeper operations // Sweeper operations
void nmethods_do(CodeBlobClosure* cf); void nmethods_do(CodeBlobClosure* cf);
...@@ -1860,7 +1860,7 @@ class CompilerThread : public JavaThread { ...@@ -1860,7 +1860,7 @@ class CompilerThread : public JavaThread {
// GC support // GC support
// Apply "f->do_oop" to all root oops in "this". // Apply "f->do_oop" to all root oops in "this".
// Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames // Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames
void oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf); void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf);
#ifndef PRODUCT #ifndef PRODUCT
private: private:
...@@ -1927,9 +1927,9 @@ class Threads: AllStatic { ...@@ -1927,9 +1927,9 @@ class Threads: AllStatic {
// Apply "f->do_oop" to all root oops in all threads. // Apply "f->do_oop" to all root oops in all threads.
// This version may only be called by sequential code. // This version may only be called by sequential code.
static void oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf); static void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf);
// This version may be called by sequential or parallel code. // This version may be called by sequential or parallel code.
static void possibly_parallel_oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf); static void possibly_parallel_oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf);
// This creates a list of GCTasks, one per thread. // This creates a list of GCTasks, one per thread.
static void create_thread_roots_tasks(GCTaskQueue* q); static void create_thread_roots_tasks(GCTaskQueue* q);
// This creates a list of GCTasks, one per thread, for marking objects. // This creates a list of GCTasks, one per thread, for marking objects.
......
...@@ -682,7 +682,7 @@ void VMThread::execute(VM_Operation* op) { ...@@ -682,7 +682,7 @@ void VMThread::execute(VM_Operation* op) {
} }
void VMThread::oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf) { void VMThread::oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf) {
Thread::oops_do(f, cld_f, cf); Thread::oops_do(f, cld_f, cf);
_vm_queue->oops_do(f); _vm_queue->oops_do(f);
} }
......
...@@ -126,7 +126,7 @@ class VMThread: public NamedThread { ...@@ -126,7 +126,7 @@ class VMThread: public NamedThread {
static VMThread* vm_thread() { return _vm_thread; } static VMThread* vm_thread() { return _vm_thread; }
// GC support // GC support
void oops_do(OopClosure* f, CLDToOopClosure* cld_f, CodeBlobClosure* cf); void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf);
// Debugging // Debugging
void print_on(outputStream* st) const; void print_on(outputStream* st) const;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册