hotspot/src/share/vm/jvmci/jvmciEnv.cpp
changeset 43938 f0e4bcc4d9f3
parent 40642 7f337136f657
child 46327 91576389a517
--- a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp	Mon Feb 06 08:32:08 2017 +0100
+++ b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp	Mon Feb 06 09:56:48 2017 -0800
@@ -283,13 +283,14 @@
 // Perform an appropriate method lookup based on accessor, holder,
 // name, signature, and bytecode.
 methodHandle JVMCIEnv::lookup_method(instanceKlassHandle h_accessor,
-                               instanceKlassHandle h_holder,
+                               KlassHandle   h_holder,
                                Symbol*       name,
                                Symbol*       sig,
                                Bytecodes::Code bc,
                                constantTag   tag) {
-  JVMCI_EXCEPTION_CONTEXT;
-  LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
+  // Accessibility checks are performed in JVMCIEnv::get_method_by_index_impl().
+  assert(check_klass_accessibility(h_accessor, h_holder), "holder not accessible");
+
   methodHandle dest_method;
   LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag);
   switch (bc) {
@@ -363,9 +364,8 @@
   }
 
   if (holder_is_accessible) { // Our declared holder is loaded.
-    instanceKlassHandle lookup = get_instance_klass_for_declared_method_holder(holder);
     constantTag tag = cpool->tag_ref_at(index);
-    methodHandle m = lookup_method(accessor, lookup, name_sym, sig_sym, bc, tag);
+    methodHandle m = lookup_method(accessor, holder, name_sym, sig_sym, bc, tag);
     if (!m.is_null() &&
         (bc == Bytecodes::_invokestatic
          ?  InstanceKlass::cast(m->method_holder())->is_not_initialized()