annotate src/cpu/x86/vm/interpreter_x86_32.cpp @ 3096:8073f5ad1d87

IdealGraphVisualizer: Rename predecessors to "Nodes Above" and successors to "Nodes Below" and actions "Expand Predecessors" and "Expand Successors" to "Expand Above" and "Expand Below" to avoid ambiguity with the Graal concept of successors and predecessors
author Peter Hofer <peter.hofer@jku.at>
date Wed, 29 Jun 2011 18:27:14 +0200
parents 38fea01eb669
children 3d2ab563047a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
2245
638119ce7cfd 7009309: JSR 292: compiler/6991596/Test6991596.java crashes on fastdebug JDK7/b122
twisti
parents: 1972
diff changeset
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1506
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1506
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: 1506
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #include "asm/assembler.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27 #include "interpreter/bytecodeHistogram.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "interpreter/interpreter.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "interpreter/interpreterGenerator.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
30 #include "interpreter/interpreterRuntime.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "interpreter/templateTable.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
32 #include "oops/arrayOop.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
33 #include "oops/methodDataOop.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
34 #include "oops/methodOop.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
35 #include "oops/oop.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
36 #include "prims/jvmtiExport.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
37 #include "prims/jvmtiThreadState.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
38 #include "prims/methodHandles.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
39 #include "runtime/arguments.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
40 #include "runtime/deoptimization.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
41 #include "runtime/frame.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
42 #include "runtime/sharedRuntime.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
43 #include "runtime/stubRoutines.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
44 #include "runtime/synchronizer.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
45 #include "runtime/timer.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
46 #include "runtime/vframeArray.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
47 #include "utilities/debug.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
48 #ifdef COMPILER1
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
49 #include "c1/c1_Runtime1.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
50 #endif
0
a61af66fc99e Initial load
duke
parents:
diff changeset
51
a61af66fc99e Initial load
duke
parents:
diff changeset
52 #define __ _masm->
a61af66fc99e Initial load
duke
parents:
diff changeset
53
a61af66fc99e Initial load
duke
parents:
diff changeset
54 //------------------------------------------------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 address AbstractInterpreterGenerator::generate_slow_signature_handler() {
a61af66fc99e Initial load
duke
parents:
diff changeset
57 address entry = __ pc();
a61af66fc99e Initial load
duke
parents:
diff changeset
58 // rbx,: method
a61af66fc99e Initial load
duke
parents:
diff changeset
59 // rcx: temporary
a61af66fc99e Initial load
duke
parents:
diff changeset
60 // rdi: pointer to locals
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // rsp: end of copied parameters area
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
62 __ mov(rcx, rsp);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
63 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::slow_signature_handler), rbx, rdi, rcx);
a61af66fc99e Initial load
duke
parents:
diff changeset
64 __ ret(0);
a61af66fc99e Initial load
duke
parents:
diff changeset
65 return entry;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 }
a61af66fc99e Initial load
duke
parents:
diff changeset
67
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 //
a61af66fc99e Initial load
duke
parents:
diff changeset
70 // Various method entries (that c++ and asm interpreter agree upon)
a61af66fc99e Initial load
duke
parents:
diff changeset
71 //------------------------------------------------------------------------------------------------------------------------
a61af66fc99e Initial load
duke
parents:
diff changeset
72 //
a61af66fc99e Initial load
duke
parents:
diff changeset
73 //
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75 // Empty method, generate a very fast return.
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 address InterpreterGenerator::generate_empty_entry(void) {
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 // rbx,: methodOop
a61af66fc99e Initial load
duke
parents:
diff changeset
80 // rcx: receiver (unused)
a61af66fc99e Initial load
duke
parents:
diff changeset
81 // rsi: previous interpreter state (C++ interpreter) must preserve
a61af66fc99e Initial load
duke
parents:
diff changeset
82 // rsi: sender sp must set sp to this value on return
a61af66fc99e Initial load
duke
parents:
diff changeset
83
a61af66fc99e Initial load
duke
parents:
diff changeset
84 if (!UseFastEmptyMethods) return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
85
a61af66fc99e Initial load
duke
parents:
diff changeset
86 address entry_point = __ pc();
a61af66fc99e Initial load
duke
parents:
diff changeset
87
a61af66fc99e Initial load
duke
parents:
diff changeset
88 // If we need a safepoint check, generate full interpreter entry.
a61af66fc99e Initial load
duke
parents:
diff changeset
89 Label slow_path;
a61af66fc99e Initial load
duke
parents:
diff changeset
90 ExternalAddress state(SafepointSynchronize::address_of_state());
a61af66fc99e Initial load
duke
parents:
diff changeset
91 __ cmp32(ExternalAddress(SafepointSynchronize::address_of_state()),
a61af66fc99e Initial load
duke
parents:
diff changeset
92 SafepointSynchronize::_not_synchronized);
a61af66fc99e Initial load
duke
parents:
diff changeset
93 __ jcc(Assembler::notEqual, slow_path);
a61af66fc99e Initial load
duke
parents:
diff changeset
94
a61af66fc99e Initial load
duke
parents:
diff changeset
95 // do nothing for empty methods (do not even increment invocation counter)
a61af66fc99e Initial load
duke
parents:
diff changeset
96 // Code: _return
a61af66fc99e Initial load
duke
parents:
diff changeset
97 // _return
a61af66fc99e Initial load
duke
parents:
diff changeset
98 // return w/o popping parameters
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
99 __ pop(rax);
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
100 __ mov(rsp, rsi);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
101 __ jmp(rax);
a61af66fc99e Initial load
duke
parents:
diff changeset
102
a61af66fc99e Initial load
duke
parents:
diff changeset
103 __ bind(slow_path);
a61af66fc99e Initial load
duke
parents:
diff changeset
104 (void) generate_normal_entry(false);
a61af66fc99e Initial load
duke
parents:
diff changeset
105 return entry_point;
a61af66fc99e Initial load
duke
parents:
diff changeset
106 }
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) {
a61af66fc99e Initial load
duke
parents:
diff changeset
109
a61af66fc99e Initial load
duke
parents:
diff changeset
110 // rbx,: methodOop
a61af66fc99e Initial load
duke
parents:
diff changeset
111 // rcx: scratrch
a61af66fc99e Initial load
duke
parents:
diff changeset
112 // rsi: sender sp
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 if (!InlineIntrinsics) return NULL; // Generate a vanilla entry
a61af66fc99e Initial load
duke
parents:
diff changeset
115
a61af66fc99e Initial load
duke
parents:
diff changeset
116 address entry_point = __ pc();
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 // These don't need a safepoint check because they aren't virtually
a61af66fc99e Initial load
duke
parents:
diff changeset
119 // callable. We won't enter these intrinsics from compiled code.
a61af66fc99e Initial load
duke
parents:
diff changeset
120 // If in the future we added an intrinsic which was virtually callable
a61af66fc99e Initial load
duke
parents:
diff changeset
121 // we'd have to worry about how to safepoint so that this code is used.
a61af66fc99e Initial load
duke
parents:
diff changeset
122
a61af66fc99e Initial load
duke
parents:
diff changeset
123 // mathematical functions inlined by compiler
a61af66fc99e Initial load
duke
parents:
diff changeset
124 // (interpreter must provide identical implementation
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // in order to avoid monotonicity bugs when switching
a61af66fc99e Initial load
duke
parents:
diff changeset
126 // from interpreter to compiler in the middle of some
a61af66fc99e Initial load
duke
parents:
diff changeset
127 // computation)
a61af66fc99e Initial load
duke
parents:
diff changeset
128 //
a61af66fc99e Initial load
duke
parents:
diff changeset
129 // stack: [ ret adr ] <-- rsp
a61af66fc99e Initial load
duke
parents:
diff changeset
130 // [ lo(arg) ]
a61af66fc99e Initial load
duke
parents:
diff changeset
131 // [ hi(arg) ]
a61af66fc99e Initial load
duke
parents:
diff changeset
132 //
a61af66fc99e Initial load
duke
parents:
diff changeset
133
a61af66fc99e Initial load
duke
parents:
diff changeset
134 // Note: For JDK 1.2 StrictMath doesn't exist and Math.sin/cos/sqrt are
a61af66fc99e Initial load
duke
parents:
diff changeset
135 // native methods. Interpreter::method_kind(...) does a check for
a61af66fc99e Initial load
duke
parents:
diff changeset
136 // native methods first before checking for intrinsic methods and
a61af66fc99e Initial load
duke
parents:
diff changeset
137 // thus will never select this entry point. Make sure it is not
a61af66fc99e Initial load
duke
parents:
diff changeset
138 // called accidentally since the SharedRuntime entry points will
a61af66fc99e Initial load
duke
parents:
diff changeset
139 // not work for JDK 1.2.
a61af66fc99e Initial load
duke
parents:
diff changeset
140 //
a61af66fc99e Initial load
duke
parents:
diff changeset
141 // We no longer need to check for JDK 1.2 since it's EOL'ed.
a61af66fc99e Initial load
duke
parents:
diff changeset
142 // The following check existed in pre 1.6 implementation,
a61af66fc99e Initial load
duke
parents:
diff changeset
143 // if (Universe::is_jdk12x_version()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
144 // __ should_not_reach_here();
a61af66fc99e Initial load
duke
parents:
diff changeset
145 // }
a61af66fc99e Initial load
duke
parents:
diff changeset
146 // Universe::is_jdk12x_version() always returns false since
a61af66fc99e Initial load
duke
parents:
diff changeset
147 // the JDK version is not yet determined when this method is called.
a61af66fc99e Initial load
duke
parents:
diff changeset
148 // This method is called during interpreter_init() whereas
a61af66fc99e Initial load
duke
parents:
diff changeset
149 // JDK version is only determined when universe2_init() is called.
a61af66fc99e Initial load
duke
parents:
diff changeset
150
a61af66fc99e Initial load
duke
parents:
diff changeset
151 // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are
a61af66fc99e Initial load
duke
parents:
diff changeset
152 // java methods. Interpreter::method_kind(...) will select
a61af66fc99e Initial load
duke
parents:
diff changeset
153 // this entry point for the corresponding methods in JDK 1.3.
a61af66fc99e Initial load
duke
parents:
diff changeset
154 // get argument
1506
2338d41fbd81 6943304: remove tagged stack interpreter
twisti
parents: 710
diff changeset
155 __ fld_d(Address(rsp, 1*wordSize));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
156 switch (kind) {
a61af66fc99e Initial load
duke
parents:
diff changeset
157 case Interpreter::java_lang_math_sin :
a61af66fc99e Initial load
duke
parents:
diff changeset
158 __ trigfunc('s');
a61af66fc99e Initial load
duke
parents:
diff changeset
159 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
160 case Interpreter::java_lang_math_cos :
a61af66fc99e Initial load
duke
parents:
diff changeset
161 __ trigfunc('c');
a61af66fc99e Initial load
duke
parents:
diff changeset
162 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
163 case Interpreter::java_lang_math_tan :
a61af66fc99e Initial load
duke
parents:
diff changeset
164 __ trigfunc('t');
a61af66fc99e Initial load
duke
parents:
diff changeset
165 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
166 case Interpreter::java_lang_math_sqrt:
a61af66fc99e Initial load
duke
parents:
diff changeset
167 __ fsqrt();
a61af66fc99e Initial load
duke
parents:
diff changeset
168 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
169 case Interpreter::java_lang_math_abs:
a61af66fc99e Initial load
duke
parents:
diff changeset
170 __ fabs();
a61af66fc99e Initial load
duke
parents:
diff changeset
171 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
172 case Interpreter::java_lang_math_log:
a61af66fc99e Initial load
duke
parents:
diff changeset
173 __ flog();
a61af66fc99e Initial load
duke
parents:
diff changeset
174 // Store to stack to convert 80bit precision back to 64bits
a61af66fc99e Initial load
duke
parents:
diff changeset
175 __ push_fTOS();
a61af66fc99e Initial load
duke
parents:
diff changeset
176 __ pop_fTOS();
a61af66fc99e Initial load
duke
parents:
diff changeset
177 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
178 case Interpreter::java_lang_math_log10:
a61af66fc99e Initial load
duke
parents:
diff changeset
179 __ flog10();
a61af66fc99e Initial load
duke
parents:
diff changeset
180 // Store to stack to convert 80bit precision back to 64bits
a61af66fc99e Initial load
duke
parents:
diff changeset
181 __ push_fTOS();
a61af66fc99e Initial load
duke
parents:
diff changeset
182 __ pop_fTOS();
a61af66fc99e Initial load
duke
parents:
diff changeset
183 break;
a61af66fc99e Initial load
duke
parents:
diff changeset
184 default :
a61af66fc99e Initial load
duke
parents:
diff changeset
185 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
186 }
a61af66fc99e Initial load
duke
parents:
diff changeset
187
a61af66fc99e Initial load
duke
parents:
diff changeset
188 // return double result in xmm0 for interpreter and compilers.
a61af66fc99e Initial load
duke
parents:
diff changeset
189 if (UseSSE >= 2) {
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
190 __ subptr(rsp, 2*wordSize);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
191 __ fstp_d(Address(rsp, 0));
a61af66fc99e Initial load
duke
parents:
diff changeset
192 __ movdbl(xmm0, Address(rsp, 0));
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
193 __ addptr(rsp, 2*wordSize);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
194 }
a61af66fc99e Initial load
duke
parents:
diff changeset
195
a61af66fc99e Initial load
duke
parents:
diff changeset
196 // done, result in FPU ST(0) or XMM0
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
197 __ pop(rdi); // get return address
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
198 __ mov(rsp, rsi); // set sp to sender sp
0
a61af66fc99e Initial load
duke
parents:
diff changeset
199 __ jmp(rdi);
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 return entry_point;
a61af66fc99e Initial load
duke
parents:
diff changeset
202 }
a61af66fc99e Initial load
duke
parents:
diff changeset
203
a61af66fc99e Initial load
duke
parents:
diff changeset
204
a61af66fc99e Initial load
duke
parents:
diff changeset
205 // Abstract method entry
a61af66fc99e Initial load
duke
parents:
diff changeset
206 // Attempt to execute abstract method. Throw exception
a61af66fc99e Initial load
duke
parents:
diff changeset
207 address InterpreterGenerator::generate_abstract_entry(void) {
a61af66fc99e Initial load
duke
parents:
diff changeset
208
a61af66fc99e Initial load
duke
parents:
diff changeset
209 // rbx,: methodOop
a61af66fc99e Initial load
duke
parents:
diff changeset
210 // rcx: receiver (unused)
a61af66fc99e Initial load
duke
parents:
diff changeset
211 // rsi: previous interpreter state (C++ interpreter) must preserve
a61af66fc99e Initial load
duke
parents:
diff changeset
212
a61af66fc99e Initial load
duke
parents:
diff changeset
213 // rsi: sender SP
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215 address entry_point = __ pc();
a61af66fc99e Initial load
duke
parents:
diff changeset
216
a61af66fc99e Initial load
duke
parents:
diff changeset
217 // abstract method entry
a61af66fc99e Initial load
duke
parents:
diff changeset
218
710
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
219 // pop return address, reset last_sp to NULL
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
220 __ empty_expression_stack();
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
221 __ restore_bcp(); // rsi must be correct for exception handler (was destroyed)
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
222 __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
223
0
a61af66fc99e Initial load
duke
parents:
diff changeset
224 // throw exception
a61af66fc99e Initial load
duke
parents:
diff changeset
225 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
a61af66fc99e Initial load
duke
parents:
diff changeset
226 // the call_VM checks for exception, so we should never return here.
a61af66fc99e Initial load
duke
parents:
diff changeset
227 __ should_not_reach_here();
a61af66fc99e Initial load
duke
parents:
diff changeset
228
a61af66fc99e Initial load
duke
parents:
diff changeset
229 return entry_point;
a61af66fc99e Initial load
duke
parents:
diff changeset
230 }
a61af66fc99e Initial load
duke
parents:
diff changeset
231
710
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
232
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
233 // Method handle invoker
2357
8033953d67ff 7012648: move JSR 292 to package java.lang.invoke and adjust names
jrose
parents: 2245
diff changeset
234 // Dispatch a method of the form java.lang.invoke.MethodHandles::invoke(...)
710
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
235 address InterpreterGenerator::generate_method_handle_entry(void) {
2416
38fea01eb669 6817525: turn on method handle functionality by default for JSR 292
twisti
parents: 2357
diff changeset
236 if (!EnableInvokeDynamic) {
710
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
237 return generate_abstract_entry();
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
238 }
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
239
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
240 address entry_point = MethodHandles::generate_method_handle_interpreter_entry(_masm);
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
241
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
242 return entry_point;
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
243 }
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
244
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
245
0
a61af66fc99e Initial load
duke
parents:
diff changeset
246 // This method tells the deoptimizer how big an interpreted frame must be:
a61af66fc99e Initial load
duke
parents:
diff changeset
247 int AbstractInterpreter::size_activation(methodOop method,
a61af66fc99e Initial load
duke
parents:
diff changeset
248 int tempcount,
a61af66fc99e Initial load
duke
parents:
diff changeset
249 int popframe_extra_args,
a61af66fc99e Initial load
duke
parents:
diff changeset
250 int moncount,
a61af66fc99e Initial load
duke
parents:
diff changeset
251 int callee_param_count,
a61af66fc99e Initial load
duke
parents:
diff changeset
252 int callee_locals,
a61af66fc99e Initial load
duke
parents:
diff changeset
253 bool is_top_frame) {
a61af66fc99e Initial load
duke
parents:
diff changeset
254 return layout_activation(method,
a61af66fc99e Initial load
duke
parents:
diff changeset
255 tempcount,
a61af66fc99e Initial load
duke
parents:
diff changeset
256 popframe_extra_args,
a61af66fc99e Initial load
duke
parents:
diff changeset
257 moncount,
a61af66fc99e Initial load
duke
parents:
diff changeset
258 callee_param_count,
a61af66fc99e Initial load
duke
parents:
diff changeset
259 callee_locals,
a61af66fc99e Initial load
duke
parents:
diff changeset
260 (frame*) NULL,
a61af66fc99e Initial load
duke
parents:
diff changeset
261 (frame*) NULL,
a61af66fc99e Initial load
duke
parents:
diff changeset
262 is_top_frame);
a61af66fc99e Initial load
duke
parents:
diff changeset
263 }
a61af66fc99e Initial load
duke
parents:
diff changeset
264
a61af66fc99e Initial load
duke
parents:
diff changeset
265 void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) {
a61af66fc99e Initial load
duke
parents:
diff changeset
266
a61af66fc99e Initial load
duke
parents:
diff changeset
267 // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in
a61af66fc99e Initial load
duke
parents:
diff changeset
268 // the days we had adapter frames. When we deoptimize a situation where a
a61af66fc99e Initial load
duke
parents:
diff changeset
269 // compiled caller calls a compiled caller will have registers it expects
a61af66fc99e Initial load
duke
parents:
diff changeset
270 // to survive the call to the callee. If we deoptimize the callee the only
a61af66fc99e Initial load
duke
parents:
diff changeset
271 // way we can restore these registers is to have the oldest interpreter
a61af66fc99e Initial load
duke
parents:
diff changeset
272 // frame that we create restore these values. That is what this routine
a61af66fc99e Initial load
duke
parents:
diff changeset
273 // will accomplish.
a61af66fc99e Initial load
duke
parents:
diff changeset
274
a61af66fc99e Initial load
duke
parents:
diff changeset
275 // At the moment we have modified c2 to not have any callee save registers
a61af66fc99e Initial load
duke
parents:
diff changeset
276 // so this problem does not exist and this routine is just a place holder.
a61af66fc99e Initial load
duke
parents:
diff changeset
277
a61af66fc99e Initial load
duke
parents:
diff changeset
278 assert(f->is_interpreted_frame(), "must be interpreted");
a61af66fc99e Initial load
duke
parents:
diff changeset
279 }