Mercurial > hg > truffle
annotate src/share/vm/interpreter/linkResolver.hpp @ 18134:6a2f814224b1
hotspot/graal: simplify CTW logic. now, the following configurations are supported:
(1) CTW with Graal, graal compiled by itself with bootstrap (--vm graal -XX:+BootstrapGraal -XX:-TieredCompilation -XX:+CompileTheWorld)
(2) CTW with Graal, graal compiled by C1/itself aka. tiered with bootstrap (--vm graal -XX:+BootstrapGraal -XX:+TieredCompilation +XX:+CompileTheWorld)
(3) CTW with Graal, graal compiled by itself without bootstrap (--vm graal -XX:-BootstrapGraal -XX:-TieredCompilation -XX:+CompileTheWorld)
(4) CTW with Graal, graal compiled by C1/itself aka. tiered without bootstrap (--vm graal -XX:-BootstrapGraal -XX:+TieredCompilation -XX:+CompileTheWorld)
(5) CTW with Graal, graal compiled by C1/C2 aka. hosted (--vm server -XX:+CompileTheWorld)
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Tue, 21 Oct 2014 10:17:06 +0200 |
parents | c583759bbcfd |
children | be896a1983c0 |
rev | line source |
---|---|
0 | 1 /* |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
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 | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1508
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1508
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1508
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_INTERPRETER_LINKRESOLVER_HPP |
26 #define SHARE_VM_INTERPRETER_LINKRESOLVER_HPP | |
27 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6266
diff
changeset
|
28 #include "oops/method.hpp" |
1972 | 29 #include "utilities/top.hpp" |
30 | |
0 | 31 // All the necessary definitions for run-time link resolution. |
32 | |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
33 // CallInfo provides all the information gathered for a particular |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
34 // linked call site after resolving it. A link is any reference |
0 | 35 // made from within the bytecodes of a method to an object outside of |
36 // that method. If the info is invalid, the link has not been resolved | |
37 // successfully. | |
38 | |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
39 class CallInfo VALUE_OBJ_CLASS_SPEC { |
0 | 40 public: |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
41 // Ways that a method call might be selected (or not) based on receiver type. |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
42 // Note that an invokevirtual instruction might be linked with no_dispatch, |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
43 // and an invokeinterface instruction might be linked with any of the three options |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
44 enum CallKind { |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
45 direct_call, // jump into resolved_method (must be concrete) |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
46 vtable_call, // select recv.klass.method_at_vtable(index) |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
47 itable_call, // select recv.klass.method_at_itable(resolved_method.holder, index) |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
48 unknown_kind = -1 |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
49 }; |
0 | 50 private: |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
51 KlassHandle _resolved_klass; // static receiver klass, resolved from a symbolic reference |
0 | 52 KlassHandle _selected_klass; // dynamic receiver class (same as static, or subklass) |
53 methodHandle _resolved_method; // static target method | |
54 methodHandle _selected_method; // dynamic (actual) target method | |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
55 CallKind _call_kind; // kind of call (static(=bytecode static/special + |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
56 // others inferred), vtable, itable) |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
57 int _call_index; // vtable or itable index of selected class method (if any) |
6266
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
2426
diff
changeset
|
58 Handle _resolved_appendix; // extra argument in constant pool (if CPCE::has_appendix) |
6822
f6b0eb4e44cf
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
6725
diff
changeset
|
59 Handle _resolved_method_type; // MethodType (for invokedynamic and invokehandle call sites) |
0 | 60 |
6822
f6b0eb4e44cf
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
6725
diff
changeset
|
61 void set_static( KlassHandle resolved_klass, methodHandle resolved_method , TRAPS); |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
62 void set_interface(KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method, int itable_index , TRAPS); |
6822
f6b0eb4e44cf
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
6725
diff
changeset
|
63 void set_virtual( KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method, int vtable_index , TRAPS); |
f6b0eb4e44cf
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
6725
diff
changeset
|
64 void set_handle( methodHandle resolved_method, Handle resolved_appendix, Handle resolved_method_type, TRAPS); |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
65 void set_common( KlassHandle resolved_klass, KlassHandle selected_klass, methodHandle resolved_method, methodHandle selected_method, CallKind kind, int index, TRAPS); |
0 | 66 |
67 friend class LinkResolver; | |
68 | |
69 public: | |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
70 CallInfo() { |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
71 #ifndef PRODUCT |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
72 _call_kind = CallInfo::unknown_kind; |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
73 _call_index = Method::garbage_vtable_index; |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
74 #endif //PRODUCT |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
75 } |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
76 |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
77 // utility to extract an effective CallInfo from a method and an optional receiver limit |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
78 // does not queue the method for compilation |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
79 CallInfo(Method* resolved_method, Klass* resolved_klass = NULL); |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
80 |
0 | 81 KlassHandle resolved_klass() const { return _resolved_klass; } |
82 KlassHandle selected_klass() const { return _selected_klass; } | |
83 methodHandle resolved_method() const { return _resolved_method; } | |
84 methodHandle selected_method() const { return _selected_method; } | |
6266
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
2426
diff
changeset
|
85 Handle resolved_appendix() const { return _resolved_appendix; } |
6822
f6b0eb4e44cf
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
6725
diff
changeset
|
86 Handle resolved_method_type() const { return _resolved_method_type; } |
0 | 87 |
88 BasicType result_type() const { return selected_method()->result_type(); } | |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
89 CallKind call_kind() const { return _call_kind; } |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
90 int call_index() const { return _call_index; } |
0 | 91 int vtable_index() const { |
92 // Even for interface calls the vtable index could be non-negative. | |
93 // See CallInfo::set_interface. | |
94 assert(has_vtable_index() || is_statically_bound(), ""); | |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
95 assert(call_kind() == vtable_call || call_kind() == direct_call, ""); |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
96 // The returned value is < 0 if the call is statically bound. |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
97 // But, the returned value may be >= 0 even if the kind is direct_call. |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
98 // It is up to the caller to decide which way to go. |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
99 return _call_index; |
0 | 100 } |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
101 int itable_index() const { |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
102 assert(call_kind() == itable_call, ""); |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
103 // The returned value is always >= 0, a valid itable index. |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
104 return _call_index; |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
105 } |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
106 |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
107 // debugging |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
108 #ifdef ASSERT |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
109 bool has_vtable_index() const { return _call_index >= 0 && _call_kind != CallInfo::itable_call; } |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
110 bool is_statically_bound() const { return _call_index == Method::nonvirtual_vtable_index; } |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
111 #endif //ASSERT |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
112 void verify() PRODUCT_RETURN; |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
113 void print() PRODUCT_RETURN; |
0 | 114 }; |
115 | |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
116 // Link information for getfield/putfield & getstatic/putstatic bytecodes |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
117 // is represented using a fieldDescriptor. |
0 | 118 |
119 // The LinkResolver is used to resolve constant-pool references at run-time. | |
120 // It does all necessary link-time checks & throws exceptions if necessary. | |
121 | |
122 class LinkResolver: AllStatic { | |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
123 friend class klassVtable; |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
124 friend class klassItable; |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
125 |
0 | 126 private: |
13436
9fbabcbb875b
8028741: Interface Method Resolution should skip static and non-public methods in j.l.Object
hseigel
parents:
13413
diff
changeset
|
127 static void lookup_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, bool checkpolymorphism, bool in_imethod_resolve, TRAPS); |
15722
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
128 #ifdef GRAAL |
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
129 public: |
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
130 #endif |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
131 static void lookup_instance_method_in_klasses (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); |
15722
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
132 #ifdef GRAAL |
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
133 private: |
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
134 #endif |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
135 static void lookup_method_in_interfaces (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS); |
6266
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
2426
diff
changeset
|
136 static void lookup_polymorphic_method (methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, |
6822
f6b0eb4e44cf
7200949: JSR 292: rubybench/bench/time/bench_base64.rb fails with jruby.jar not on boot class path
twisti
parents:
6725
diff
changeset
|
137 KlassHandle current_klass, Handle *appendix_result_or_null, Handle *method_type_result, TRAPS); |
0 | 138 |
139 static void resolve_klass (KlassHandle& result, constantPoolHandle pool, int index, TRAPS); | |
140 | |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
141 static void resolve_pool (KlassHandle& resolved_klass, Symbol*& method_name, Symbol*& method_signature, KlassHandle& current_klass, constantPoolHandle pool, int index, TRAPS); |
0 | 142 |
13413 | 143 static void resolve_interface_method(methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, bool nostatics, TRAPS); |
12858
2f8728d92483
8026299: invokespecial gets ICCE when it should get AME.
acorn
parents:
12823
diff
changeset
|
144 static void resolve_method (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, bool require_methodref, TRAPS); |
0 | 145 |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
146 static void linktime_resolve_static_method (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS); |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
147 static void linktime_resolve_special_method (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS); |
15722
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
148 #ifdef GRAAL |
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
149 public: |
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
150 #endif |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
151 static void linktime_resolve_virtual_method (methodHandle &resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature,KlassHandle current_klass, bool check_access, TRAPS); |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
152 static void linktime_resolve_interface_method (methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS); |
15722
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
153 #ifdef GRAAL |
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
154 private: |
c583759bbcfd
ResolvedJavaType.resolveMethod now takes a callerType that is used to check access rules. Make it work for default methods.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
13451
diff
changeset
|
155 #endif |
0 | 156 |
157 static void runtime_resolve_special_method (CallInfo& result, methodHandle resolved_method, KlassHandle resolved_klass, KlassHandle current_klass, bool check_access, TRAPS); | |
158 static void runtime_resolve_virtual_method (CallInfo& result, methodHandle resolved_method, KlassHandle resolved_klass, Handle recv, KlassHandle recv_klass, bool check_null_and_abstract, TRAPS); | |
159 static void runtime_resolve_interface_method (CallInfo& result, methodHandle resolved_method, KlassHandle resolved_klass, Handle recv, KlassHandle recv_klass, bool check_null_and_abstract, TRAPS); | |
160 | |
161 static void check_field_accessability (KlassHandle ref_klass, KlassHandle resolved_klass, KlassHandle sel_klass, fieldDescriptor& fd, TRAPS); | |
162 static void check_method_accessability (KlassHandle ref_klass, KlassHandle resolved_klass, KlassHandle sel_klass, methodHandle sel_method, TRAPS); | |
163 | |
164 public: | |
165 // constant pool resolving | |
166 static void check_klass_accessability(KlassHandle ref_klass, KlassHandle sel_klass, TRAPS); | |
167 | |
6266
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
2426
diff
changeset
|
168 // static resolving calls (will not run any Java code); used only from Bytecode_invoke::static_target |
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
2426
diff
changeset
|
169 static void resolve_method_statically(methodHandle& method_result, KlassHandle& klass_result, |
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
2426
diff
changeset
|
170 Bytecodes::Code code, constantPoolHandle pool, int index, TRAPS); |
0 | 171 |
172 // runtime/static resolving for fields | |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
173 static void resolve_field_access(fieldDescriptor& result, constantPoolHandle pool, int index, Bytecodes::Code byte, TRAPS); |
12356
359f7e70ae7f
Reduce HotSpot diff and fix previous merge
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
12264
diff
changeset
|
174 static void resolve_field_access(fieldDescriptor& result, constantPoolHandle pool, int index, Bytecodes::Code byte, bool check_access, bool initialize_class, TRAPS); |
12264
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
175 static void resolve_field(fieldDescriptor& result, KlassHandle resolved_klass, Symbol* field_name, Symbol* field_signature, |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
176 KlassHandle current_klass, Bytecodes::Code access_kind, bool check_access, bool initialize_class, TRAPS); |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
177 |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
178 // source of access_kind codes: |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
179 static Bytecodes::Code field_access_kind(bool is_static, bool is_put) { |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
180 return (is_static |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
181 ? (is_put ? Bytecodes::_putstatic : Bytecodes::_getstatic) |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
182 : (is_put ? Bytecodes::_putfield : Bytecodes::_getfield )); |
b2e698d2276c
8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation
drchase
parents:
6822
diff
changeset
|
183 } |
0 | 184 |
185 // runtime resolving: | |
186 // resolved_klass = specified class (i.e., static receiver class) | |
187 // current_klass = sending method holder (i.e., class containing the method containing the call being resolved) | |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
188 static void resolve_static_call (CallInfo& result, KlassHandle& resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, bool initialize_klass, TRAPS); |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
189 static void resolve_special_call (CallInfo& result, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS); |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
190 static void resolve_virtual_call (CallInfo& result, Handle recv, KlassHandle recv_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, bool check_null_and_abstract, TRAPS); |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
191 static void resolve_interface_call(CallInfo& result, Handle recv, KlassHandle recv_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, bool check_null_and_abstract, TRAPS); |
6266
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
2426
diff
changeset
|
192 static void resolve_handle_call (CallInfo& result, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, TRAPS); |
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
2426
diff
changeset
|
193 static void resolve_dynamic_call (CallInfo& result, Handle bootstrap_specifier, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, TRAPS); |
0 | 194 |
195 // same as above for compile-time resolution; but returns null handle instead of throwing an exception on error | |
196 // also, does not initialize klass (i.e., no side effects) | |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
197 static methodHandle resolve_virtual_call_or_null (KlassHandle receiver_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass); |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
198 static methodHandle resolve_interface_call_or_null(KlassHandle receiver_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass); |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
199 static methodHandle resolve_static_call_or_null (KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass); |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
200 static methodHandle resolve_special_call_or_null (KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass); |
13055
fce21ac5968d
8027229: ICCE expected for >=2 maximally specific default methods.
acorn
parents:
12858
diff
changeset
|
201 static int vtable_index_of_interface_method(KlassHandle klass, methodHandle resolved_method); |
0 | 202 |
203 // same as above for compile-time resolution; returns vtable_index if current_klass if linked | |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
204 static int resolve_virtual_vtable_index (KlassHandle receiver_klass, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass); |
0 | 205 |
206 // static resolving for compiler (does not throw exceptions, returns null handle if unsuccessful) | |
2177
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
207 static methodHandle linktime_resolve_virtual_method_or_null (KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access); |
3582bf76420e
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
1972
diff
changeset
|
208 static methodHandle linktime_resolve_interface_method_or_null(KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access); |
0 | 209 |
210 // runtime resolving from constant pool | |
211 static void resolve_invokestatic (CallInfo& result, constantPoolHandle pool, int index, TRAPS); | |
212 static void resolve_invokespecial (CallInfo& result, constantPoolHandle pool, int index, TRAPS); | |
213 static void resolve_invokevirtual (CallInfo& result, Handle recv, constantPoolHandle pool, int index, TRAPS); | |
214 static void resolve_invokeinterface(CallInfo& result, Handle recv, constantPoolHandle pool, int index, TRAPS); | |
726
be93aad57795
6655646: dynamic languages need dynamically linked call sites
jrose
parents:
710
diff
changeset
|
215 static void resolve_invokedynamic (CallInfo& result, constantPoolHandle pool, int index, TRAPS); |
6266
1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
2426
diff
changeset
|
216 static void resolve_invokehandle (CallInfo& result, constantPoolHandle pool, int index, TRAPS); |
0 | 217 |
218 static void resolve_invoke (CallInfo& result, Handle recv, constantPoolHandle pool, int index, Bytecodes::Code byte, TRAPS); | |
219 }; | |
1972 | 220 |
221 #endif // SHARE_VM_INTERPRETER_LINKRESOLVER_HPP |