comparison src/share/vm/runtime/thread.hpp @ 3696:dc7902820c9b

Make NMethodSweeper work on any JavaThread
author Gilles Duboscq <gilles.m.duboscq@gmail.com>
date Thu, 24 Nov 2011 17:24:43 +0100
parents 0e8a2a629afb
children 04b9a2566eec
comparison
equal deleted inserted replaced
3693:60d31b1fada5 3696:dc7902820c9b
843 843
844 volatile oop _graal_deopt_info; 844 volatile oop _graal_deopt_info;
845 845
846 StackGuardState _stack_guard_state; 846 StackGuardState _stack_guard_state;
847 847
848 nmethod* _scanned_nmethod; // nmethod being scanned by the sweeper
849
848 // Compiler exception handling (NOTE: The _exception_oop is *NOT* the same as _pending_exception. It is 850 // Compiler exception handling (NOTE: The _exception_oop is *NOT* the same as _pending_exception. It is
849 // used to temp. parsing values into and out of the runtime system during exception handling for compiled 851 // used to temp. parsing values into and out of the runtime system during exception handling for compiled
850 // code) 852 // code)
851 volatile oop _exception_oop; // Exception thrown in compiled code 853 volatile oop _exception_oop; // Exception thrown in compiled code
852 volatile address _exception_pc; // PC where exception happened 854 volatile address _exception_pc; // PC where exception happened
937 jni_detach 939 jni_detach
938 }; 940 };
939 void exit(bool destroy_vm, ExitType exit_type = normal_exit); 941 void exit(bool destroy_vm, ExitType exit_type = normal_exit);
940 942
941 void cleanup_failed_attach_current_thread(); 943 void cleanup_failed_attach_current_thread();
944
945 // Track the nmethod currently being scanned by the sweeper
946 void set_scanned_nmethod(nmethod* nm) {
947 assert(_scanned_nmethod == NULL || nm == NULL, "should reset to NULL before writing a new value");
948 _scanned_nmethod = nm;
949 }
942 950
943 // Testers 951 // Testers
944 virtual bool is_Java_thread() const { return true; } 952 virtual bool is_Java_thread() const { return true; }
945 953
946 // Thread chain operations 954 // Thread chain operations
1712 1720
1713 CompileLog* _log; 1721 CompileLog* _log;
1714 CompileTask* _task; 1722 CompileTask* _task;
1715 CompileQueue* _queue; 1723 CompileQueue* _queue;
1716 1724
1717 nmethod* _scanned_nmethod; // nmethod being scanned by the sweeper
1718 1725
1719 public: 1726 public:
1720 1727
1721 static CompilerThread* current(); 1728 static CompilerThread* current();
1722 1729
1736 // Set once, for good. 1743 // Set once, for good.
1737 assert(_log == NULL, "set only once"); 1744 assert(_log == NULL, "set only once");
1738 _log = log; 1745 _log = log;
1739 } 1746 }
1740 1747
1741 // GC support
1742 // Apply "f->do_oop" to all root oops in "this".
1743 // Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames
1744 void oops_do(OopClosure* f, CodeBlobClosure* cf);
1745
1746 #ifndef PRODUCT 1748 #ifndef PRODUCT
1747 private: 1749 private:
1748 IdealGraphPrinter *_ideal_graph_printer; 1750 IdealGraphPrinter *_ideal_graph_printer;
1749 public: 1751 public:
1750 IdealGraphPrinter *ideal_graph_printer() { return _ideal_graph_printer; } 1752 IdealGraphPrinter *ideal_graph_printer() { return _ideal_graph_printer; }
1752 #endif 1754 #endif
1753 1755
1754 // Get/set the thread's current task 1756 // Get/set the thread's current task
1755 CompileTask* task() { return _task; } 1757 CompileTask* task() { return _task; }
1756 void set_task(CompileTask* task) { _task = task; } 1758 void set_task(CompileTask* task) { _task = task; }
1757
1758 // Track the nmethod currently being scanned by the sweeper
1759 void set_scanned_nmethod(nmethod* nm) {
1760 assert(_scanned_nmethod == NULL || nm == NULL, "should reset to NULL before writing a new value");
1761 _scanned_nmethod = nm;
1762 }
1763 }; 1759 };
1764 1760
1765 inline CompilerThread* CompilerThread::current() { 1761 inline CompilerThread* CompilerThread::current() {
1766 return JavaThread::current()->as_CompilerThread(); 1762 return JavaThread::current()->as_CompilerThread();
1767 } 1763 }