src/share/vm/prims/jvmtiImpl.cpp

Print this page




 274   return _method != NULL &&
 275          _bci >= 0;
 276 }
 277 
 278 address JvmtiBreakpoint::getBcp() {
 279   return _method->bcp_from(_bci);
 280 }
 281 
 282 void JvmtiBreakpoint::each_method_version_do(method_action meth_act) {
 283   ((Method*)_method->*meth_act)(_bci);
 284 
 285   // add/remove breakpoint to/from versions of the method that
 286   // are EMCP. Directly or transitively obsolete methods are
 287   // not saved in the PreviousVersionNodes.
 288   Thread *thread = Thread::current();
 289   instanceKlassHandle ikh = instanceKlassHandle(thread, _method->method_holder());
 290   Symbol* m_name = _method->name();
 291   Symbol* m_signature = _method->signature();
 292 
 293   // search previous versions if they exist
 294   PreviousVersionWalker pvw(thread, (InstanceKlass *)ikh());
 295   for (PreviousVersionNode * pv_node = pvw.next_previous_version();
 296        pv_node != NULL; pv_node = pvw.next_previous_version()) {
 297     GrowableArray<Method*>* methods = pv_node->prev_EMCP_methods();
 298 
 299     if (methods == NULL) {
 300       // We have run into a PreviousVersion generation where
 301       // all methods were made obsolete during that generation's
 302       // RedefineClasses() operation. At the time of that
 303       // operation, all EMCP methods were flushed so we don't
 304       // have to go back any further.
 305       //
 306       // A NULL methods array is different than an empty methods
 307       // array. We cannot infer any optimizations about older
 308       // generations from an empty methods array for the current
 309       // generation.
 310       break;
 311     }
 312 
 313     for (int i = methods->length() - 1; i >= 0; i--) {
 314       Method* method = methods->at(i);
 315       // obsolete methods that are running are not deleted from
 316       // previous version array, but they are skipped here.
 317       if (!method->is_obsolete() &&
 318           method->name() == m_name &&
 319           method->signature() == m_signature) {
 320         RC_TRACE(0x00000800, ("%sing breakpoint in %s(%s)",
 321           meth_act == &Method::set_breakpoint ? "sett" : "clear",
 322           method->name()->as_C_string(),
 323           method->signature()->as_C_string()));
 324 
 325         (method->*meth_act)(_bci);
 326         break;
 327       }
 328     }
 329   }
 330 }
 331 




 274   return _method != NULL &&
 275          _bci >= 0;
 276 }
 277 
 278 address JvmtiBreakpoint::getBcp() {
 279   return _method->bcp_from(_bci);
 280 }
 281 
 282 void JvmtiBreakpoint::each_method_version_do(method_action meth_act) {
 283   ((Method*)_method->*meth_act)(_bci);
 284 
 285   // add/remove breakpoint to/from versions of the method that
 286   // are EMCP. Directly or transitively obsolete methods are
 287   // not saved in the PreviousVersionNodes.
 288   Thread *thread = Thread::current();
 289   instanceKlassHandle ikh = instanceKlassHandle(thread, _method->method_holder());
 290   Symbol* m_name = _method->name();
 291   Symbol* m_signature = _method->signature();
 292 
 293   // search previous versions if they exist
 294   for (InstanceKlass* pv_node = ikh->previous_versions();
 295        pv_node != NULL;
 296        pv_node = pv_node->previous_versions()) {
 297     Array<Method*>* methods = pv_node->methods();














 298 
 299     for (int i = methods->length() - 1; i >= 0; i--) {
 300       Method* method = methods->at(i);
 301       // obsolete methods that are running are not deleted from
 302       // previous version array, but they are skipped here.
 303       if (!method->is_obsolete() &&
 304           method->name() == m_name &&
 305           method->signature() == m_signature) {
 306         RC_TRACE(0x00000800, ("%sing breakpoint in %s(%s)",
 307           meth_act == &Method::set_breakpoint ? "sett" : "clear",
 308           method->name()->as_C_string(),
 309           method->signature()->as_C_string()));
 310 
 311         (method->*meth_act)(_bci);
 312         break;
 313       }
 314     }
 315   }
 316 }
 317