hotspot/src/share/vm/prims/jvmtiImpl.hpp
changeset 18025 b7bcf7497f93
parent 15432 9d976ca484d8
child 21519 72e63a0dbda2
equal deleted inserted replaced
18024:f9e300086063 18025:b7bcf7497f93
   202 };
   202 };
   203 
   203 
   204 
   204 
   205 ///////////////////////////////////////////////////////////////
   205 ///////////////////////////////////////////////////////////////
   206 //
   206 //
   207 // class VM_ChangeBreakpoints
       
   208 // Used by              : JvmtiBreakpoints
       
   209 // Used by JVMTI methods: none directly.
       
   210 // Note: A Helper class.
       
   211 //
       
   212 // VM_ChangeBreakpoints implements a VM_Operation for ALL modifications to the JvmtiBreakpoints class.
       
   213 //
       
   214 
       
   215 class VM_ChangeBreakpoints : public VM_Operation {
       
   216 private:
       
   217   JvmtiBreakpoints* _breakpoints;
       
   218   int               _operation;
       
   219   JvmtiBreakpoint*  _bp;
       
   220 
       
   221 public:
       
   222   enum { SET_BREAKPOINT=0, CLEAR_BREAKPOINT=1, CLEAR_ALL_BREAKPOINT=2 };
       
   223 
       
   224   VM_ChangeBreakpoints(JvmtiBreakpoints* breakpoints, int operation) {
       
   225     _breakpoints = breakpoints;
       
   226     _bp = NULL;
       
   227     _operation = operation;
       
   228     assert(breakpoints != NULL, "breakpoints != NULL");
       
   229     assert(operation == CLEAR_ALL_BREAKPOINT, "unknown breakpoint operation");
       
   230   }
       
   231   VM_ChangeBreakpoints(JvmtiBreakpoints* breakpoints, int operation, JvmtiBreakpoint *bp) {
       
   232     _breakpoints = breakpoints;
       
   233     _bp = bp;
       
   234     _operation = operation;
       
   235     assert(breakpoints != NULL, "breakpoints != NULL");
       
   236     assert(bp != NULL, "bp != NULL");
       
   237     assert(operation == SET_BREAKPOINT || operation == CLEAR_BREAKPOINT , "unknown breakpoint operation");
       
   238   }
       
   239 
       
   240   VMOp_Type type() const { return VMOp_ChangeBreakpoints; }
       
   241   void doit();
       
   242   void oops_do(OopClosure* f);
       
   243 };
       
   244 
       
   245 
       
   246 ///////////////////////////////////////////////////////////////
       
   247 //
       
   248 // class JvmtiBreakpoints
   207 // class JvmtiBreakpoints
   249 // Used by              : JvmtiCurrentBreakpoints
   208 // Used by              : JvmtiCurrentBreakpoints
   250 // Used by JVMTI methods: none directly
   209 // Used by JVMTI methods: none directly
   251 // Note: A Helper class
   210 // Note: A Helper class
   252 //
   211 //
   269   // to insure they only occur at safepoints.
   228   // to insure they only occur at safepoints.
   270   // Todo: add checks for safepoint
   229   // Todo: add checks for safepoint
   271   friend class VM_ChangeBreakpoints;
   230   friend class VM_ChangeBreakpoints;
   272   void set_at_safepoint(JvmtiBreakpoint& bp);
   231   void set_at_safepoint(JvmtiBreakpoint& bp);
   273   void clear_at_safepoint(JvmtiBreakpoint& bp);
   232   void clear_at_safepoint(JvmtiBreakpoint& bp);
   274   void clearall_at_safepoint();
       
   275 
   233 
   276   static void do_element(GrowableElement *e);
   234   static void do_element(GrowableElement *e);
   277 
   235 
   278 public:
   236 public:
   279   JvmtiBreakpoints(void listener_fun(void *, address *));
   237   JvmtiBreakpoints(void listener_fun(void *, address *));
   284   void print();
   242   void print();
   285 
   243 
   286   int  set(JvmtiBreakpoint& bp);
   244   int  set(JvmtiBreakpoint& bp);
   287   int  clear(JvmtiBreakpoint& bp);
   245   int  clear(JvmtiBreakpoint& bp);
   288   void clearall_in_class_at_safepoint(Klass* klass);
   246   void clearall_in_class_at_safepoint(Klass* klass);
   289   void clearall();
       
   290   void gc_epilogue();
   247   void gc_epilogue();
   291 };
   248 };
   292 
   249 
   293 
   250 
   294 ///////////////////////////////////////////////////////////////
   251 ///////////////////////////////////////////////////////////////
   341     for ( ; (*bps) != NULL; bps++) {
   298     for ( ; (*bps) != NULL; bps++) {
   342       if ((*bps) == bcp) return true;
   299       if ((*bps) == bcp) return true;
   343     }
   300     }
   344     return false;
   301     return false;
   345 }
   302 }
       
   303 
       
   304 
       
   305 ///////////////////////////////////////////////////////////////
       
   306 //
       
   307 // class VM_ChangeBreakpoints
       
   308 // Used by              : JvmtiBreakpoints
       
   309 // Used by JVMTI methods: none directly.
       
   310 // Note: A Helper class.
       
   311 //
       
   312 // VM_ChangeBreakpoints implements a VM_Operation for ALL modifications to the JvmtiBreakpoints class.
       
   313 //
       
   314 
       
   315 class VM_ChangeBreakpoints : public VM_Operation {
       
   316 private:
       
   317   JvmtiBreakpoints* _breakpoints;
       
   318   int               _operation;
       
   319   JvmtiBreakpoint*  _bp;
       
   320 
       
   321 public:
       
   322   enum { SET_BREAKPOINT=0, CLEAR_BREAKPOINT=1 };
       
   323 
       
   324   VM_ChangeBreakpoints(int operation, JvmtiBreakpoint *bp) {
       
   325     JvmtiBreakpoints& current_bps = JvmtiCurrentBreakpoints::get_jvmti_breakpoints();
       
   326     _breakpoints = &current_bps;
       
   327     _bp = bp;
       
   328     _operation = operation;
       
   329     assert(bp != NULL, "bp != NULL");
       
   330   }
       
   331 
       
   332   VMOp_Type type() const { return VMOp_ChangeBreakpoints; }
       
   333   void doit();
       
   334   void oops_do(OopClosure* f);
       
   335 };
       
   336 
   346 
   337 
   347 ///////////////////////////////////////////////////////////////
   338 ///////////////////////////////////////////////////////////////
   348 // The get/set local operations must only be done by the VM thread
   339 // The get/set local operations must only be done by the VM thread
   349 // because the interpreter version needs to access oop maps, which can
   340 // because the interpreter version needs to access oop maps, which can
   350 // only safely be done by the VM thread
   341 // only safely be done by the VM thread