src/hotspot/share/prims/jniCheck.cpp
changeset 48787 7638bf98a312
parent 48390 fe6fb69336b5
child 48808 2b0b7f222800
equal deleted inserted replaced
48786:cc231bd80c8b 48787:7638bf98a312
     1 /*
     1 /*
     2  * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2001, 2018, Oracle and/or its affiliates. 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.
   433   }
   433   }
   434   return orig_result;
   434   return orig_result;
   435 }
   435 }
   436 
   436 
   437 oop jniCheck::validate_handle(JavaThread* thr, jobject obj) {
   437 oop jniCheck::validate_handle(JavaThread* thr, jobject obj) {
   438   if (JNIHandles::is_frame_handle(thr, obj) ||
   438   if (JNIHandles::handle_type(thr, obj) != JNIInvalidRefType) {
   439       JNIHandles::is_local_handle(thr, obj) ||
       
   440       JNIHandles::is_global_handle(obj) ||
       
   441       JNIHandles::is_weak_global_handle(obj)) {
       
   442     ASSERT_OOPS_ALLOWED;
   439     ASSERT_OOPS_ALLOWED;
   443     return JNIHandles::resolve_external_guard(obj);
   440     return JNIHandles::resolve_external_guard(obj);
   444   }
   441   }
   445   ReportJNIFatalError(thr, fatal_bad_ref_to_jni);
   442   ReportJNIFatalError(thr, fatal_bad_ref_to_jni);
   446   return NULL;
   443   return NULL;