src/share/vm/prims/jvmtiImpl.cpp
Print this page
rev 4530 : 6843375: Debuggee VM crashes performing mark-sweep-compact
Reviewed-by: stefank, jmasa
*** 370,392 ****
_breakpoints->set_at_safepoint(*_bp);
break;
case CLEAR_BREAKPOINT:
_breakpoints->clear_at_safepoint(*_bp);
break;
- case CLEAR_ALL_BREAKPOINT:
- _breakpoints->clearall_at_safepoint();
- break;
default:
assert(false, "Unknown operation");
}
}
void VM_ChangeBreakpoints::oops_do(OopClosure* f) {
! // This operation keeps breakpoints alive
! if (_breakpoints != NULL) {
! _breakpoints->oops_do(f);
! }
if (_bp != NULL) {
_bp->oops_do(f);
}
}
--- 370,387 ----
_breakpoints->set_at_safepoint(*_bp);
break;
case CLEAR_BREAKPOINT:
_breakpoints->clear_at_safepoint(*_bp);
break;
default:
assert(false, "Unknown operation");
}
}
void VM_ChangeBreakpoints::oops_do(OopClosure* f) {
! // The JvmtiBreakpoints in _breakpoints will be visited via
! // JvmtiExport::oops_do.
if (_bp != NULL) {
_bp->oops_do(f);
}
}
*** 443,479 ****
_bps.remove(i);
bp.clear();
}
}
- void JvmtiBreakpoints::clearall_at_safepoint() {
- assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint");
-
- int len = _bps.length();
- for (int i=0; i<len; i++) {
- _bps.at(i).clear();
- }
- _bps.clear();
- }
-
int JvmtiBreakpoints::length() { return _bps.length(); }
int JvmtiBreakpoints::set(JvmtiBreakpoint& bp) {
if ( _bps.find(bp) != -1) {
return JVMTI_ERROR_DUPLICATE;
}
! VM_ChangeBreakpoints set_breakpoint(this,VM_ChangeBreakpoints::SET_BREAKPOINT, &bp);
VMThread::execute(&set_breakpoint);
return JVMTI_ERROR_NONE;
}
int JvmtiBreakpoints::clear(JvmtiBreakpoint& bp) {
if ( _bps.find(bp) == -1) {
return JVMTI_ERROR_NOT_FOUND;
}
! VM_ChangeBreakpoints clear_breakpoint(this,VM_ChangeBreakpoints::CLEAR_BREAKPOINT, &bp);
VMThread::execute(&clear_breakpoint);
return JVMTI_ERROR_NONE;
}
void JvmtiBreakpoints::clearall_in_class_at_safepoint(klassOop klass) {
--- 438,464 ----
_bps.remove(i);
bp.clear();
}
}
int JvmtiBreakpoints::length() { return _bps.length(); }
int JvmtiBreakpoints::set(JvmtiBreakpoint& bp) {
if ( _bps.find(bp) != -1) {
return JVMTI_ERROR_DUPLICATE;
}
! VM_ChangeBreakpoints set_breakpoint(VM_ChangeBreakpoints::SET_BREAKPOINT, &bp);
VMThread::execute(&set_breakpoint);
return JVMTI_ERROR_NONE;
}
int JvmtiBreakpoints::clear(JvmtiBreakpoint& bp) {
if ( _bps.find(bp) == -1) {
return JVMTI_ERROR_NOT_FOUND;
}
! VM_ChangeBreakpoints clear_breakpoint(VM_ChangeBreakpoints::CLEAR_BREAKPOINT, &bp);
VMThread::execute(&clear_breakpoint);
return JVMTI_ERROR_NONE;
}
void JvmtiBreakpoints::clearall_in_class_at_safepoint(klassOop klass) {
*** 500,514 ****
}
}
}
}
- void JvmtiBreakpoints::clearall() {
- VM_ChangeBreakpoints clearall_breakpoint(this,VM_ChangeBreakpoints::CLEAR_ALL_BREAKPOINT);
- VMThread::execute(&clearall_breakpoint);
- }
-
//
// class JvmtiCurrentBreakpoints
//
JvmtiBreakpoints *JvmtiCurrentBreakpoints::_jvmti_breakpoints = NULL;
--- 485,494 ----