equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * Copyright (c) 2012 Red Hat, Inc. |
3 * Copyright (c) 2012 Red Hat, Inc. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5 * |
5 * |
6 * This code is free software; you can redistribute it and/or modify it |
6 * This code is free software; you can redistribute it and/or modify it |
7 * under the terms of the GNU General Public License version 2 only, as |
7 * under the terms of the GNU General Public License version 2 only, as |
860 JNI_LEAF(jobjectRefType, jni_GetObjectRefType(JNIEnv *env, jobject obj)) |
860 JNI_LEAF(jobjectRefType, jni_GetObjectRefType(JNIEnv *env, jobject obj)) |
861 JNIWrapper("GetObjectRefType"); |
861 JNIWrapper("GetObjectRefType"); |
862 |
862 |
863 HOTSPOT_JNI_GETOBJECTREFTYPE_ENTRY(env, obj); |
863 HOTSPOT_JNI_GETOBJECTREFTYPE_ENTRY(env, obj); |
864 |
864 |
865 jobjectRefType ret; |
865 jobjectRefType ret = JNIHandles::handle_type(thread, obj); |
866 if (JNIHandles::is_local_handle(thread, obj) || |
|
867 JNIHandles::is_frame_handle(thread, obj)) |
|
868 ret = JNILocalRefType; |
|
869 else if (JNIHandles::is_global_handle(obj)) |
|
870 ret = JNIGlobalRefType; |
|
871 else if (JNIHandles::is_weak_global_handle(obj)) |
|
872 ret = JNIWeakGlobalRefType; |
|
873 else |
|
874 ret = JNIInvalidRefType; |
|
875 |
866 |
876 HOTSPOT_JNI_GETOBJECTREFTYPE_RETURN((void *) ret); |
867 HOTSPOT_JNI_GETOBJECTREFTYPE_RETURN((void *) ret); |
877 return ret; |
868 return ret; |
878 JNI_END |
869 JNI_END |
879 |
870 |