< prev index next >

src/hotspot/share/runtime/vmOperations.hpp

Print this page

 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #ifndef SHARE_RUNTIME_VMOPERATIONS_HPP
 26 #define SHARE_RUNTIME_VMOPERATIONS_HPP
 27 
 28 #include "oops/oop.hpp"
 29 #include "runtime/javaThread.hpp"
 30 #include "runtime/vmOperation.hpp"
 31 #include "runtime/threadSMR.hpp"
 32 
 33 class ObjectMonitorsHashtable;
 34 
 35 // A hodge podge of commonly used VM Operations
 36 
 37 class VM_EmptyOperation : public VM_Operation {
 38 public:
 39   virtual void doit() final {}
 40   virtual bool skip_thread_oop_barriers() const final {
 41     // Neither the doit function nor the safepoint
 42     // cleanup tasks read oops in the Java threads.
 43     return true;
 44   }
 45 };
 46 
 47 class VM_Halt: public VM_EmptyOperation {
 48  public:
 49   VMOp_Type type() const { return VMOp_Halt; }
 50 };
 51 
 52 class VM_SafepointALot: public VM_EmptyOperation {
 53  public:

187 
188   DeadlockCycle* result()      { return _deadlocks; };
189   VMOp_Type type() const       { return VMOp_FindDeadlocks; }
190   void doit();
191 };
192 
193 class ThreadDumpResult;
194 class ThreadSnapshot;
195 class ThreadConcurrentLocks;
196 
197 class VM_ThreadDump : public VM_Operation {
198  private:
199   ThreadDumpResult*              _result;
200   int                            _num_threads;
201   GrowableArray<instanceHandle>* _threads;
202   int                            _max_depth;
203   bool                           _with_locked_monitors;
204   bool                           _with_locked_synchronizers;
205 
206   void snapshot_thread(JavaThread* java_thread, ThreadConcurrentLocks* tcl,
207                        ObjectMonitorsHashtable* table);
208 
209  public:
210   VM_ThreadDump(ThreadDumpResult* result,
211                 int max_depth,  // -1 indicates entire stack
212                 bool with_locked_monitors,
213                 bool with_locked_synchronizers);
214 
215   VM_ThreadDump(ThreadDumpResult* result,
216                 GrowableArray<instanceHandle>* threads,
217                 int num_threads, // -1 indicates entire stack
218                 int max_depth,
219                 bool with_locked_monitors,
220                 bool with_locked_synchronizers);
221 
222   VMOp_Type type() const { return VMOp_ThreadDump; }
223   void doit();
224   bool doit_prologue();
225   void doit_epilogue();
226 };
227 

 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #ifndef SHARE_RUNTIME_VMOPERATIONS_HPP
 26 #define SHARE_RUNTIME_VMOPERATIONS_HPP
 27 
 28 #include "oops/oop.hpp"
 29 #include "runtime/javaThread.hpp"
 30 #include "runtime/vmOperation.hpp"
 31 #include "runtime/threadSMR.hpp"
 32 
 33 class ObjectMonitorsView;
 34 
 35 // A hodge podge of commonly used VM Operations
 36 
 37 class VM_EmptyOperation : public VM_Operation {
 38 public:
 39   virtual void doit() final {}
 40   virtual bool skip_thread_oop_barriers() const final {
 41     // Neither the doit function nor the safepoint
 42     // cleanup tasks read oops in the Java threads.
 43     return true;
 44   }
 45 };
 46 
 47 class VM_Halt: public VM_EmptyOperation {
 48  public:
 49   VMOp_Type type() const { return VMOp_Halt; }
 50 };
 51 
 52 class VM_SafepointALot: public VM_EmptyOperation {
 53  public:

187 
188   DeadlockCycle* result()      { return _deadlocks; };
189   VMOp_Type type() const       { return VMOp_FindDeadlocks; }
190   void doit();
191 };
192 
193 class ThreadDumpResult;
194 class ThreadSnapshot;
195 class ThreadConcurrentLocks;
196 
197 class VM_ThreadDump : public VM_Operation {
198  private:
199   ThreadDumpResult*              _result;
200   int                            _num_threads;
201   GrowableArray<instanceHandle>* _threads;
202   int                            _max_depth;
203   bool                           _with_locked_monitors;
204   bool                           _with_locked_synchronizers;
205 
206   void snapshot_thread(JavaThread* java_thread, ThreadConcurrentLocks* tcl,
207                        ObjectMonitorsView* monitors);
208 
209  public:
210   VM_ThreadDump(ThreadDumpResult* result,
211                 int max_depth,  // -1 indicates entire stack
212                 bool with_locked_monitors,
213                 bool with_locked_synchronizers);
214 
215   VM_ThreadDump(ThreadDumpResult* result,
216                 GrowableArray<instanceHandle>* threads,
217                 int num_threads, // -1 indicates entire stack
218                 int max_depth,
219                 bool with_locked_monitors,
220                 bool with_locked_synchronizers);
221 
222   VMOp_Type type() const { return VMOp_ThreadDump; }
223   void doit();
224   bool doit_prologue();
225   void doit_epilogue();
226 };
227 
< prev index next >