< prev index next >

src/share/vm/ci/ciEnv.cpp

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -702,17 +702,18 @@
 // name, signature, and bytecode.
 Method* ciEnv::lookup_method(InstanceKlass*  accessor,
                                InstanceKlass*  holder,
                                Symbol*       name,
                                Symbol*       sig,
-                               Bytecodes::Code bc) {
+                               Bytecodes::Code bc,
+                               constantTag    tag) {
   EXCEPTION_CONTEXT;
   KlassHandle h_accessor(THREAD, accessor);
   KlassHandle h_holder(THREAD, holder);
   LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
   methodHandle dest_method;
-  LinkInfo link_info(h_holder, name, sig, h_accessor, /*check_access*/true);
+  LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag);
   switch (bc) {
   case Bytecodes::_invokestatic:
     dest_method =
       LinkResolver::resolve_static_call_or_null(link_info);
     break;

@@ -794,11 +795,13 @@
       }
     }
 
     if (holder_is_accessible) {  // Our declared holder is loaded.
       InstanceKlass* lookup = declared_holder->get_instanceKlass();
-      Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc);
+      constantTag tag = cpool->tag_ref_at(index);
+      assert(accessor->get_instanceKlass() == cpool->pool_holder(), "not the pool holder?");
+      Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc, tag);
       if (m != NULL &&
           (bc == Bytecodes::_invokestatic
            ?  m->method_holder()->is_not_initialized()
            : !m->method_holder()->is_loaded())) {
         m = NULL;
< prev index next >