mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 19:44:41 +02:00
6862945: 4/3 conversion of jmethodID to methodOop in JVMTI is too expensive
Refactor JNIHandles::checked_resolve_jmethod_id() into fast and paranoid parts. Reviewed-by: never, alanb
This commit is contained in:
parent
10e13deca1
commit
aca1d9534f
2 changed files with 17 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -196,12 +196,16 @@ inline methodOop JNIHandles::resolve_jmethod_id(jmethodID mid) {
|
|||
};
|
||||
|
||||
inline methodOop JNIHandles::checked_resolve_jmethod_id(jmethodID mid) {
|
||||
jobject handle = (jobject)mid;
|
||||
if (is_weak_global_handle(handle)) {
|
||||
return (methodOop) resolve_non_null(handle);
|
||||
} else {
|
||||
if (mid == NULL) {
|
||||
return (methodOop) NULL;
|
||||
}
|
||||
|
||||
oop o = resolve_non_null((jobject) mid);
|
||||
if (!o->is_method()) {
|
||||
return (methodOop) NULL;
|
||||
}
|
||||
|
||||
return (methodOop) o;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue