89 template(GetFrameLocation) \
90 template(ChangeBreakpoints) \
91 template(GetOrSetLocal) \
92 template(GetCurrentLocation) \
93 template(EnterInterpOnlyMode) \
94 template(ChangeSingleStep) \
95 template(HeapWalkOperation) \
96 template(HeapIterateOperation) \
97 template(ReportJavaOutOfMemory) \
98 template(JFRCheckpoint) \
99 template(Exit) \
100 template(LinuxDllLoad) \
101 template(RotateGCLog) \
102 template(WhiteBoxOperation) \
103 template(ClassLoaderStatsOperation) \
104 template(DumpHashtable) \
105 template(DumpTouchedMethods) \
106 template(MarkActiveNMethods) \
107 template(PrintCompileQueue) \
108 template(PrintClassHierarchy) \
109
110 class VM_Operation: public CHeapObj<mtInternal> {
111 public:
112 enum Mode {
113 _safepoint, // blocking, safepoint, vm_op C-heap allocated
114 _no_safepoint, // blocking, no safepoint, vm_op C-Heap allocated
115 _concurrent, // non-blocking, no safepoint, vm_op C-Heap allocated
116 _async_safepoint // non-blocking, safepoint, vm_op C-Heap allocated
117 };
118
119 enum VMOp_Type {
120 VM_OPS_DO(VM_OP_ENUM)
121 VMOp_Terminating
122 };
123
124 private:
125 Thread* _calling_thread;
126 ThreadPriority _priority;
127 long _timestamp;
128 VM_Operation* _next;
414 static int wait_for_threads_in_native_to_block();
415 static int set_vm_exited();
416 static bool vm_exited() { return _vm_exited; }
417 static void block_if_vm_exited() {
418 if (_vm_exited) {
419 wait_if_vm_exited();
420 }
421 }
422 VMOp_Type type() const { return VMOp_Exit; }
423 void doit();
424 };
425
426 class VM_PrintCompileQueue: public VM_Operation {
427 private:
428 outputStream* _out;
429
430 public:
431 VM_PrintCompileQueue(outputStream* st) : _out(st) {}
432 VMOp_Type type() const { return VMOp_PrintCompileQueue; }
433 Mode evaluation_mode() const { return _safepoint; }
434 void doit();
435 };
436
437 #if INCLUDE_SERVICES
438 class VM_PrintClassHierarchy: public VM_Operation {
439 private:
440 outputStream* _out;
441 bool _print_interfaces;
442 bool _print_subclasses;
443 char* _classname;
444
445 public:
446 VM_PrintClassHierarchy(outputStream* st, bool print_interfaces, bool print_subclasses, char* classname) :
447 _out(st), _print_interfaces(print_interfaces), _print_subclasses(print_subclasses),
448 _classname(classname) {}
449 VMOp_Type type() const { return VMOp_PrintClassHierarchy; }
450 void doit();
451 };
452 #endif // INCLUDE_SERVICES
453
|
89 template(GetFrameLocation) \
90 template(ChangeBreakpoints) \
91 template(GetOrSetLocal) \
92 template(GetCurrentLocation) \
93 template(EnterInterpOnlyMode) \
94 template(ChangeSingleStep) \
95 template(HeapWalkOperation) \
96 template(HeapIterateOperation) \
97 template(ReportJavaOutOfMemory) \
98 template(JFRCheckpoint) \
99 template(Exit) \
100 template(LinuxDllLoad) \
101 template(RotateGCLog) \
102 template(WhiteBoxOperation) \
103 template(ClassLoaderStatsOperation) \
104 template(DumpHashtable) \
105 template(DumpTouchedMethods) \
106 template(MarkActiveNMethods) \
107 template(PrintCompileQueue) \
108 template(PrintClassHierarchy) \
109 template(VTBufferStats) \
110
111 class VM_Operation: public CHeapObj<mtInternal> {
112 public:
113 enum Mode {
114 _safepoint, // blocking, safepoint, vm_op C-heap allocated
115 _no_safepoint, // blocking, no safepoint, vm_op C-Heap allocated
116 _concurrent, // non-blocking, no safepoint, vm_op C-Heap allocated
117 _async_safepoint // non-blocking, safepoint, vm_op C-Heap allocated
118 };
119
120 enum VMOp_Type {
121 VM_OPS_DO(VM_OP_ENUM)
122 VMOp_Terminating
123 };
124
125 private:
126 Thread* _calling_thread;
127 ThreadPriority _priority;
128 long _timestamp;
129 VM_Operation* _next;
415 static int wait_for_threads_in_native_to_block();
416 static int set_vm_exited();
417 static bool vm_exited() { return _vm_exited; }
418 static void block_if_vm_exited() {
419 if (_vm_exited) {
420 wait_if_vm_exited();
421 }
422 }
423 VMOp_Type type() const { return VMOp_Exit; }
424 void doit();
425 };
426
427 class VM_PrintCompileQueue: public VM_Operation {
428 private:
429 outputStream* _out;
430
431 public:
432 VM_PrintCompileQueue(outputStream* st) : _out(st) {}
433 VMOp_Type type() const { return VMOp_PrintCompileQueue; }
434 Mode evaluation_mode() const { return _safepoint; }
435 void doit();
436 };
437
438 class VM_VTBufferStats: public VM_Operation {
439 private:
440 outputStream* _out;
441 public:
442 VM_VTBufferStats() { _out = tty; }
443 VM_VTBufferStats(outputStream* out) { _out = out; }
444 VMOp_Type type() const { return VMOp_VTBufferStats; }
445 void doit();
446 };
447
448 #if INCLUDE_SERVICES
449 class VM_PrintClassHierarchy: public VM_Operation {
450 private:
451 outputStream* _out;
452 bool _print_interfaces;
453 bool _print_subclasses;
454 char* _classname;
455
456 public:
457 VM_PrintClassHierarchy(outputStream* st, bool print_interfaces, bool print_subclasses, char* classname) :
458 _out(st), _print_interfaces(print_interfaces), _print_subclasses(print_subclasses),
459 _classname(classname) {}
460 VMOp_Type type() const { return VMOp_PrintClassHierarchy; }
461 void doit();
462 };
463 #endif // INCLUDE_SERVICES
464
|