comparison src/share/vm/interpreter/linkResolver.hpp @ 7066:7d815d842ee0

Merge.
author Christian Haeubl <haeubl@ssw.jku.at>
date Fri, 23 Nov 2012 11:50:27 +0100
parents f6b0eb4e44cf
children b2e698d2276c
comparison
equal deleted inserted replaced
7065:cfacf5d5bade 7066:7d815d842ee0
1 /* 1 /*
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2012, 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.
23 */ 23 */
24 24
25 #ifndef SHARE_VM_INTERPRETER_LINKRESOLVER_HPP 25 #ifndef SHARE_VM_INTERPRETER_LINKRESOLVER_HPP
26 #define SHARE_VM_INTERPRETER_LINKRESOLVER_HPP 26 #define SHARE_VM_INTERPRETER_LINKRESOLVER_HPP
27 27
28 #include "oops/methodOop.hpp" 28 #include "oops/method.hpp"
29 #include "utilities/top.hpp" 29 #include "utilities/top.hpp"
30 30
31 // All the necessary definitions for run-time link resolution. 31 // All the necessary definitions for run-time link resolution.
32 32
33 // LinkInfo & its subclasses provide all the information gathered 33 // LinkInfo & its subclasses provide all the information gathered
74 KlassHandle _selected_klass; // dynamic receiver class (same as static, or subklass) 74 KlassHandle _selected_klass; // dynamic receiver class (same as static, or subklass)
75 methodHandle _resolved_method; // static target method 75 methodHandle _resolved_method; // static target method
76 methodHandle _selected_method; // dynamic (actual) target method 76 methodHandle _selected_method; // dynamic (actual) target method
77 int _vtable_index; // vtable index of selected method 77 int _vtable_index; // vtable index of selected method
78 Handle _resolved_appendix; // extra argument in constant pool (if CPCE::has_appendix) 78 Handle _resolved_appendix; // extra argument in constant pool (if CPCE::has_appendix)
79 Handle _resolved_method_type; // MethodType (for invokedynamic and invokehandle call sites)
79 80
80 void set_static( KlassHandle resolved_klass, methodHandle resolved_method , TRAPS); 81 void set_static( KlassHandle resolved_klass, methodHandle resolved_method , TRAPS);
81 void set_interface(KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method , TRAPS); 82 void set_interface(KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method , TRAPS);
82 void set_virtual( KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method, int vtable_index, TRAPS); 83 void set_virtual( KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method, int vtable_index , TRAPS);
83 void set_handle( methodHandle resolved_method, Handle resolved_appendix, TRAPS); 84 void set_handle( methodHandle resolved_method, Handle resolved_appendix, Handle resolved_method_type, TRAPS);
84 void set_common( KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method, int vtable_index, TRAPS); 85 void set_common( KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method, int vtable_index , TRAPS);
85 86
86 friend class LinkResolver; 87 friend class LinkResolver;
87 88
88 public: 89 public:
89 KlassHandle resolved_klass() const { return _resolved_klass; } 90 KlassHandle resolved_klass() const { return _resolved_klass; }
90 KlassHandle selected_klass() const { return _selected_klass; } 91 KlassHandle selected_klass() const { return _selected_klass; }
91 methodHandle resolved_method() const { return _resolved_method; } 92 methodHandle resolved_method() const { return _resolved_method; }
92 methodHandle selected_method() const { return _selected_method; } 93 methodHandle selected_method() const { return _selected_method; }
93 Handle resolved_appendix() const { return _resolved_appendix; } 94 Handle resolved_appendix() const { return _resolved_appendix; }
95 Handle resolved_method_type() const { return _resolved_method_type; }
94 96
95 BasicType result_type() const { return selected_method()->result_type(); } 97 BasicType result_type() const { return selected_method()->result_type(); }
96 bool has_vtable_index() const { return _vtable_index >= 0; } 98 bool has_vtable_index() const { return _vtable_index >= 0; }
97 bool is_statically_bound() const { return _vtable_index == methodOopDesc::nonvirtual_vtable_index; } 99 bool is_statically_bound() const { return _vtable_index == Method::nonvirtual_vtable_index; }
98 int vtable_index() const { 100 int vtable_index() const {
99 // Even for interface calls the vtable index could be non-negative. 101 // Even for interface calls the vtable index could be non-negative.
100 // See CallInfo::set_interface. 102 // See CallInfo::set_interface.
101 assert(has_vtable_index() || is_statically_bound(), ""); 103 assert(has_vtable_index() || is_statically_bound(), "");
102 return _vtable_index; 104 return _vtable_index;
111 private: 113 private:
112 static void lookup_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); 114 static void lookup_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS);
113 static void lookup_instance_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); 115 static void lookup_instance_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS);
114 static void lookup_method_in_interfaces (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); 116 static void lookup_method_in_interfaces (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS);
115 static void lookup_polymorphic_method (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, 117 static void lookup_polymorphic_method (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature,
116 KlassHandle current_klass, Handle* appendix_result_or_null, TRAPS); 118 KlassHandle current_klass, Handle *appendix_result_or_null, Handle *method_type_result, TRAPS);
117 119
118 static int vtable_index_of_miranda_method(KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); 120 static int vtable_index_of_miranda_method(KlassHandle klass, Symbol* name, Symbol* signature, TRAPS);
119 121
120 static void resolve_klass (KlassHandle& result, constantPoolHandle pool, int index, TRAPS); 122 static void resolve_klass (KlassHandle& result, constantPoolHandle pool, int index, TRAPS);
121 static void resolve_klass_no_update (KlassHandle& result, constantPoolHandle pool, int index, TRAPS); // no update of constantPool entry 123 static void resolve_klass_no_update (KlassHandle& result, constantPoolHandle pool, int index, TRAPS); // no update of constantPool entry