src/share/vm/runtime/jniHandles.hpp

changeset 1352
1760a1cbed36
parent 435
a61af66fc99e
child 1445
354d3184f6b2
child 1890
d3562366cbfd
equal deleted inserted replaced
1316:16c930df1e9b 1352:1760a1cbed36
1 /* 1 /*
2 * Copyright 1998-2007 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
194 inline methodOop JNIHandles::resolve_jmethod_id(jmethodID mid) { 194 inline methodOop JNIHandles::resolve_jmethod_id(jmethodID mid) {
195 return (methodOop) resolve_non_null((jobject)mid); 195 return (methodOop) resolve_non_null((jobject)mid);
196 }; 196 };
197 197
198 inline methodOop JNIHandles::checked_resolve_jmethod_id(jmethodID mid) { 198 inline methodOop JNIHandles::checked_resolve_jmethod_id(jmethodID mid) {
199 jobject handle = (jobject)mid; 199 if (mid == NULL) {
200 if (is_weak_global_handle(handle)) {
201 return (methodOop) resolve_non_null(handle);
202 } else {
203 return (methodOop) NULL; 200 return (methodOop) NULL;
204 } 201 }
202
203 oop o = resolve_non_null((jobject) mid);
204 if (!o->is_method()) {
205 return (methodOop) NULL;
206 }
207
208 return (methodOop) o;
205 }; 209 };
206 210
207 211
208 inline void JNIHandles::destroy_local(jobject handle) { 212 inline void JNIHandles::destroy_local(jobject handle) {
209 if (handle != NULL) { 213 if (handle != NULL) {

mercurial