Print this page
rev 4530 : 6843375: Debuggee VM crashes performing mark-sweep-compact
Reviewed-by: stefank, jmasa

Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/prims/jvmtiImpl.cpp
          +++ new/src/share/vm/prims/jvmtiImpl.cpp
↓ open down ↓ 364 lines elided ↑ open up ↑
 365  365  //
 366  366  
 367  367  void VM_ChangeBreakpoints::doit() {
 368  368    switch (_operation) {
 369  369    case SET_BREAKPOINT:
 370  370      _breakpoints->set_at_safepoint(*_bp);
 371  371      break;
 372  372    case CLEAR_BREAKPOINT:
 373  373      _breakpoints->clear_at_safepoint(*_bp);
 374  374      break;
 375      -  case CLEAR_ALL_BREAKPOINT:
 376      -    _breakpoints->clearall_at_safepoint();
 377      -    break;
 378  375    default:
 379  376      assert(false, "Unknown operation");
 380  377    }
 381  378  }
 382  379  
 383  380  void VM_ChangeBreakpoints::oops_do(OopClosure* f) {
 384      -  // This operation keeps breakpoints alive
 385      -  if (_breakpoints != NULL) {
 386      -    _breakpoints->oops_do(f);
 387      -  }
      381 +  // The JvmtiBreakpoints in _breakpoints will be visited via
      382 +  // JvmtiExport::oops_do.
 388  383    if (_bp != NULL) {
 389  384      _bp->oops_do(f);
 390  385    }
 391  386  }
 392  387  
 393  388  //
 394  389  // class JvmtiBreakpoints
 395  390  //
 396  391  // a JVMTI internal collection of JvmtiBreakpoint
 397  392  //
↓ open down ↓ 40 lines elided ↑ open up ↑
 438  433  void JvmtiBreakpoints::clear_at_safepoint(JvmtiBreakpoint& bp) {
 439  434    assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
 440  435  
 441  436    int i = _bps.find(bp);
 442  437    if (i != -1) {
 443  438      _bps.remove(i);
 444  439      bp.clear();
 445  440    }
 446  441  }
 447  442  
 448      -void JvmtiBreakpoints::clearall_at_safepoint() {
 449      -  assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
 450      -
 451      -  int len = _bps.length();
 452      -  for (int i=0; i<len; i++) {
 453      -    _bps.at(i).clear();
 454      -  }
 455      -  _bps.clear();
 456      -}
 457      -
 458  443  int JvmtiBreakpoints::length() { return _bps.length(); }
 459  444  
 460  445  int JvmtiBreakpoints::set(JvmtiBreakpoint& bp) {
 461  446    if ( _bps.find(bp) != -1) {
 462  447       return JVMTI_ERROR_DUPLICATE;
 463  448    }
 464      -  VM_ChangeBreakpoints set_breakpoint(this,VM_ChangeBreakpoints::SET_BREAKPOINT, &bp);
      449 +  VM_ChangeBreakpoints set_breakpoint(VM_ChangeBreakpoints::SET_BREAKPOINT, &bp);
 465  450    VMThread::execute(&set_breakpoint);
 466  451    return JVMTI_ERROR_NONE;
 467  452  }
 468  453  
 469  454  int JvmtiBreakpoints::clear(JvmtiBreakpoint& bp) {
 470  455    if ( _bps.find(bp) == -1) {
 471  456       return JVMTI_ERROR_NOT_FOUND;
 472  457    }
 473  458  
 474      -  VM_ChangeBreakpoints clear_breakpoint(this,VM_ChangeBreakpoints::CLEAR_BREAKPOINT, &bp);
      459 +  VM_ChangeBreakpoints clear_breakpoint(VM_ChangeBreakpoints::CLEAR_BREAKPOINT, &bp);
 475  460    VMThread::execute(&clear_breakpoint);
 476  461    return JVMTI_ERROR_NONE;
 477  462  }
 478  463  
 479  464  void JvmtiBreakpoints::clearall_in_class_at_safepoint(klassOop klass) {
 480  465    bool changed = true;
 481  466    // We are going to run thru the list of bkpts
 482  467    // and delete some.  This deletion probably alters
 483  468    // the list in some implementation defined way such
 484  469    // that when we delete entry i, the next entry might
↓ open down ↓ 10 lines elided ↑ open up ↑
 495  480          bp.clear();
 496  481          _bps.remove(i);
 497  482          // This changed 'i' so we have to start over.
 498  483          changed = true;
 499  484          break;
 500  485        }
 501  486      }
 502  487    }
 503  488  }
 504  489  
 505      -void JvmtiBreakpoints::clearall() {
 506      -  VM_ChangeBreakpoints clearall_breakpoint(this,VM_ChangeBreakpoints::CLEAR_ALL_BREAKPOINT);
 507      -  VMThread::execute(&clearall_breakpoint);
 508      -}
 509      -
 510  490  //
 511  491  // class JvmtiCurrentBreakpoints
 512  492  //
 513  493  
 514  494  JvmtiBreakpoints *JvmtiCurrentBreakpoints::_jvmti_breakpoints  = NULL;
 515  495  address *         JvmtiCurrentBreakpoints::_breakpoint_list    = NULL;
 516  496  
 517  497  
 518  498  JvmtiBreakpoints& JvmtiCurrentBreakpoints::get_jvmti_breakpoints() {
 519  499    if (_jvmti_breakpoints != NULL) return (*_jvmti_breakpoints);
↓ open down ↓ 591 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX