Skip to content

Commit 8234312

Browse files
committed
8185348: Major performance regression in GetMethodDeclaringClass and other JVMTI Method functions
Reviewed-by: phh
1 parent 1694987 commit 8234312

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

hotspot/src/share/vm/oops/method.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,9 +1903,6 @@ bool Method::is_method_id(jmethodID mid) {
19031903

19041904
Method* Method::checked_resolve_jmethod_id(jmethodID mid) {
19051905
if (mid == NULL) return NULL;
1906-
if (!Method::is_method_id(mid)) {
1907-
return NULL;
1908-
}
19091906
Method* o = resolve_jmethod_id(mid);
19101907
if (o == NULL || o == JNIMethodBlock::_free_method || !((Metadata*)o)->is_method()) {
19111908
return NULL;

hotspot/src/share/vm/prims/jniCheck.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,11 @@ Method* jniCheck::validate_jmethod_id(JavaThread* thr, jmethodID method_id) {
468468
if (moop == NULL) {
469469
ReportJNIFatalError(thr, fatal_wrong_class_or_method);
470470
}
471+
// jmethodIDs are supposed to be weak handles in the class loader data,
472+
// but that can be expensive so check it last
473+
else if (!Method::is_method_id(method_id)) {
474+
ReportJNIFatalError(thr, fatal_non_weak_method);
475+
}
471476
return moop;
472477
}
473478

0 commit comments

Comments
 (0)