hotspot/src/share/vm/interpreter/linkResolver.hpp
changeset 38719 133bf85c3f36
parent 38051 d092550d625d
child 39421 a9652c919db8
--- a/hotspot/src/share/vm/interpreter/linkResolver.hpp	Thu May 26 20:43:13 2016 -0400
+++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp	Fri May 27 10:52:39 2016 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -137,20 +137,35 @@
   KlassHandle _resolved_klass;  // class that the constant pool entry points to
   KlassHandle _current_klass;   // class that owns the constant pool
   bool        _check_access;
+  constantTag _tag;
  public:
+  enum AccessCheck {
+     needs_access_check,
+     skip_access_check
+  };
+
   LinkInfo(const constantPoolHandle& pool, int index, TRAPS);
+
   // Condensed information from other call sites within the vm.
-  LinkInfo(KlassHandle resolved_klass, Symbol* name, Symbol* signature,
-           KlassHandle current_klass, bool check_access = true) :
+  LinkInfo(KlassHandle resolved_klass, Symbol* name, Symbol* signature, KlassHandle current_klass,
+           AccessCheck check_access = needs_access_check,
+           constantTag tag = JVM_CONSTANT_Invalid) :
     _resolved_klass(resolved_klass),
     _name(name), _signature(signature), _current_klass(current_klass),
-    _check_access(check_access) {}
+    _check_access(check_access == needs_access_check), _tag(tag) {}
+
+  // Case where we just find the method and don't check access against the current class
+  LinkInfo(KlassHandle resolved_klass, Symbol*name, Symbol* signature) :
+    _resolved_klass(resolved_klass),
+    _name(name), _signature(signature), _current_klass(NULL),
+    _check_access(false), _tag(JVM_CONSTANT_Invalid) {}
 
   // accessors
   Symbol* name() const               { return _name; }
   Symbol* signature() const          { return _signature; }
   KlassHandle resolved_klass() const { return _resolved_klass; }
   KlassHandle current_klass() const  { return _current_klass; }
+  constantTag tag() const            { return _tag; }
   bool check_access() const          { return _check_access; }
   char* method_string() const;
 
@@ -192,7 +207,7 @@
                                              KlassHandle sel_klass, TRAPS);
 
   static methodHandle resolve_interface_method(const LinkInfo& link_info, Bytecodes::Code code, TRAPS);
-  static methodHandle resolve_method          (const LinkInfo& link_info, bool require_methodref, TRAPS);
+  static methodHandle resolve_method          (const LinkInfo& link_info, Bytecodes::Code code, TRAPS);
 
   static methodHandle linktime_resolve_static_method    (const LinkInfo& link_info, TRAPS);
   static methodHandle linktime_resolve_special_method   (const LinkInfo& link_info, TRAPS);