hotspot/src/share/vm/prims/methodHandles.cpp
changeset 46262 83280d968b96
parent 42664 29142a56c193
child 46271 979ebd346ecf
equal deleted inserted replaced
46261:75ce8b72e3c9 46262:83280d968b96
     1 /*
     1 /*
     2  * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2008, 2017, 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.
  1207     // Reflection::verify_class_access can only handle instance classes.
  1207     // Reflection::verify_class_access can only handle instance classes.
  1208     if (reference_klass != NULL && reference_klass->is_instance_klass()) {
  1208     if (reference_klass != NULL && reference_klass->is_instance_klass()) {
  1209       // Emulate LinkResolver::check_klass_accessability.
  1209       // Emulate LinkResolver::check_klass_accessability.
  1210       Klass* caller = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh));
  1210       Klass* caller = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh));
  1211       if (Reflection::verify_class_access(caller,
  1211       if (Reflection::verify_class_access(caller,
  1212                                           reference_klass,
  1212                                           InstanceKlass::cast(reference_klass),
  1213                                           true) != Reflection::ACCESS_OK) {
  1213                                           true) != Reflection::ACCESS_OK) {
  1214         THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), reference_klass->external_name());
  1214         THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), reference_klass->external_name());
  1215       }
  1215       }
  1216     }
  1216     }
  1217   }
  1217   }