src/share/vm/runtime/thread.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/runtime/thread.hpp

src/share/vm/runtime/thread.hpp

Print this page

        

*** 303,312 **** --- 303,313 ---- // Testers virtual bool is_VM_thread() const { return false; } virtual bool is_Java_thread() const { return false; } virtual bool is_Compiler_thread() const { return false; } + virtual bool is_Code_cache_sweeper_thread() const { return false; } virtual bool is_hidden_from_external_view() const { return false; } virtual bool is_jvmti_agent_thread() const { return false; } // True iff the thread can perform GC operations at a safepoint. // Generally will be true only of VM thread and parallel GC WorkGang // threads.
*** 1744,1753 **** --- 1745,1772 ---- inline CompilerThread* JavaThread::as_CompilerThread() { assert(is_Compiler_thread(), "just checking"); return (CompilerThread*)this; } + // Dedicated thread to sweep the code cache + class CodeCacheSweeperThread : public JavaThread { + nmethod* _scanned_nmethod; // nmethod being scanned by the sweeper + public: + CodeCacheSweeperThread(); + // Track the nmethod currently being scanned by the sweeper + void set_scanned_nmethod(nmethod* nm) { + assert(_scanned_nmethod == NULL || nm == NULL, "should reset to NULL before writing a new value"); + _scanned_nmethod = nm; + } + + bool is_Code_cache_sweeper_thread() const { return true; } + // GC support + // Apply "f->do_oop" to all root oops in "this". + // Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames + void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf); + }; + // A thread used for Compilation. class CompilerThread : public JavaThread { friend class VMStructs; private: CompilerCounters* _counters;
*** 1756,1766 **** CompileLog* _log; CompileTask* _task; CompileQueue* _queue; BufferBlob* _buffer_blob; - nmethod* _scanned_nmethod; // nmethod being scanned by the sweeper AbstractCompiler* _compiler; public: static CompilerThread* current(); --- 1775,1784 ----
*** 1790,1804 **** // Set once, for good. assert(_log == NULL, "set only once"); _log = log; } - // GC support - // Apply "f->do_oop" to all root oops in "this". - // Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames - void oops_do(OopClosure* f, CLDClosure* cld_f, CodeBlobClosure* cf); - #ifndef PRODUCT private: IdealGraphPrinter *_ideal_graph_printer; public: IdealGraphPrinter *ideal_graph_printer() { return _ideal_graph_printer; } --- 1808,1817 ----
*** 1806,1821 **** #endif // Get/set the thread's current task CompileTask* task() { return _task; } void set_task(CompileTask* task) { _task = task; } - - // Track the nmethod currently being scanned by the sweeper - void set_scanned_nmethod(nmethod* nm) { - assert(_scanned_nmethod == NULL || nm == NULL, "should reset to NULL before writing a new value"); - _scanned_nmethod = nm; - } }; inline CompilerThread* CompilerThread::current() { return JavaThread::current()->as_CompilerThread(); } --- 1819,1828 ----
src/share/vm/runtime/thread.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File