src/share/vm/prims/jvmtiEnv.cpp
Print this page
rev 5449 : 8025834: NPE in Parallel Scavenge with -XX:+CheckUnhandledOops
*** 1983,1993 ****
// verify that the breakpoint is not past the end of the method
if (location >= (jlocation) method_oop->code_size()) {
return JVMTI_ERROR_INVALID_LOCATION;
}
! ResourceMark rm;
JvmtiBreakpoint bp(method_oop, location);
JvmtiBreakpoints& jvmti_breakpoints = JvmtiCurrentBreakpoints::get_jvmti_breakpoints();
if (jvmti_breakpoints.set(bp) == JVMTI_ERROR_DUPLICATE)
return JVMTI_ERROR_DUPLICATE;
--- 1983,1993 ----
// verify that the breakpoint is not past the end of the method
if (location >= (jlocation) method_oop->code_size()) {
return JVMTI_ERROR_INVALID_LOCATION;
}
! HandleMark hm;
JvmtiBreakpoint bp(method_oop, location);
JvmtiBreakpoints& jvmti_breakpoints = JvmtiCurrentBreakpoints::get_jvmti_breakpoints();
if (jvmti_breakpoints.set(bp) == JVMTI_ERROR_DUPLICATE)
return JVMTI_ERROR_DUPLICATE;
*** 2001,2022 ****
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
jvmtiError
JvmtiEnv::ClearBreakpoint(Method* method_oop, jlocation location) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
-
if (location < 0) { // simple invalid location check first
return JVMTI_ERROR_INVALID_LOCATION;
}
-
// verify that the breakpoint is not past the end of the method
if (location >= (jlocation) method_oop->code_size()) {
return JVMTI_ERROR_INVALID_LOCATION;
}
JvmtiBreakpoint bp(method_oop, location);
-
JvmtiBreakpoints& jvmti_breakpoints = JvmtiCurrentBreakpoints::get_jvmti_breakpoints();
if (jvmti_breakpoints.clear(bp) == JVMTI_ERROR_NOT_FOUND)
return JVMTI_ERROR_NOT_FOUND;
if (TraceJVMTICalls) {
--- 2001,2020 ----
// method_oop - pre-checked for validity, but may be NULL meaning obsolete method
jvmtiError
JvmtiEnv::ClearBreakpoint(Method* method_oop, jlocation location) {
NULL_CHECK(method_oop, JVMTI_ERROR_INVALID_METHODID);
if (location < 0) { // simple invalid location check first
return JVMTI_ERROR_INVALID_LOCATION;
}
// verify that the breakpoint is not past the end of the method
if (location >= (jlocation) method_oop->code_size()) {
return JVMTI_ERROR_INVALID_LOCATION;
}
+ HandleMark hm;
JvmtiBreakpoint bp(method_oop, location);
JvmtiBreakpoints& jvmti_breakpoints = JvmtiCurrentBreakpoints::get_jvmti_breakpoints();
if (jvmti_breakpoints.clear(bp) == JVMTI_ERROR_NOT_FOUND)
return JVMTI_ERROR_NOT_FOUND;
if (TraceJVMTICalls) {