annotate src/cpu/x86/vm/interpreter_x86_32.cpp @ 7212:291ffc492eb6

Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/
author Doug Simon <doug.simon@oracle.com>
date Fri, 14 Dec 2012 14:35:13 +0100
parents cd3d6a6b95d9
children d3f14809b051
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
2 * Copyright (c) 1997, 2012, 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"
7199
cd3d6a6b95d9 8003240: x86: move MacroAssembler into separate file
twisti
parents: 6725
diff changeset
26 #include "asm/macroAssembler.hpp"
1972
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"
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
33 #include "oops/methodData.hpp"
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
34 #include "oops/method.hpp"
1972
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
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
79 // rbx,: Method*
0
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
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
110 // rbx,: Method*
0
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;
6084
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
184 case Interpreter::java_lang_math_pow:
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
185 __ fld_d(Address(rsp, 3*wordSize)); // second argument
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
186 __ pow_with_fallback(0);
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
187 // Store to stack to convert 80bit precision back to 64bits
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
188 __ push_fTOS();
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
189 __ pop_fTOS();
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
190 break;
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
191 case Interpreter::java_lang_math_exp:
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
192 __ exp_with_fallback(0);
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
193 // Store to stack to convert 80bit precision back to 64bits
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
194 __ push_fTOS();
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
195 __ pop_fTOS();
6759698e3140 7133857: exp() and pow() should use the x87 ISA on x86
roland
parents: 3369
diff changeset
196 break;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
197 default :
a61af66fc99e Initial load
duke
parents:
diff changeset
198 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
199 }
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201 // return double result in xmm0 for interpreter and compilers.
a61af66fc99e Initial load
duke
parents:
diff changeset
202 if (UseSSE >= 2) {
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
203 __ subptr(rsp, 2*wordSize);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
204 __ fstp_d(Address(rsp, 0));
a61af66fc99e Initial load
duke
parents:
diff changeset
205 __ movdbl(xmm0, Address(rsp, 0));
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
206 __ addptr(rsp, 2*wordSize);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
207 }
a61af66fc99e Initial load
duke
parents:
diff changeset
208
a61af66fc99e Initial load
duke
parents:
diff changeset
209 // done, result in FPU ST(0) or XMM0
304
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
210 __ pop(rdi); // get return address
dc7f315e41f7 5108146: Merge i486 and amd64 cpu directories
never
parents: 0
diff changeset
211 __ mov(rsp, rsi); // set sp to sender sp
0
a61af66fc99e Initial load
duke
parents:
diff changeset
212 __ jmp(rdi);
a61af66fc99e Initial load
duke
parents:
diff changeset
213
a61af66fc99e Initial load
duke
parents:
diff changeset
214 return entry_point;
a61af66fc99e Initial load
duke
parents:
diff changeset
215 }
a61af66fc99e Initial load
duke
parents:
diff changeset
216
a61af66fc99e Initial load
duke
parents:
diff changeset
217
a61af66fc99e Initial load
duke
parents:
diff changeset
218 // Abstract method entry
a61af66fc99e Initial load
duke
parents:
diff changeset
219 // Attempt to execute abstract method. Throw exception
a61af66fc99e Initial load
duke
parents:
diff changeset
220 address InterpreterGenerator::generate_abstract_entry(void) {
a61af66fc99e Initial load
duke
parents:
diff changeset
221
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
222 // rbx,: Method*
0
a61af66fc99e Initial load
duke
parents:
diff changeset
223 // rcx: receiver (unused)
a61af66fc99e Initial load
duke
parents:
diff changeset
224 // rsi: previous interpreter state (C++ interpreter) must preserve
a61af66fc99e Initial load
duke
parents:
diff changeset
225
a61af66fc99e Initial load
duke
parents:
diff changeset
226 // rsi: sender SP
a61af66fc99e Initial load
duke
parents:
diff changeset
227
a61af66fc99e Initial load
duke
parents:
diff changeset
228 address entry_point = __ pc();
a61af66fc99e Initial load
duke
parents:
diff changeset
229
a61af66fc99e Initial load
duke
parents:
diff changeset
230 // abstract method entry
a61af66fc99e Initial load
duke
parents:
diff changeset
231
710
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
232 // pop return address, reset last_sp to NULL
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
233 __ empty_expression_stack();
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
234 __ restore_bcp(); // rsi must be correct for exception handler (was destroyed)
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
235 __ restore_locals(); // make sure locals pointer is correct as well (was destroyed)
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
236
0
a61af66fc99e Initial load
duke
parents:
diff changeset
237 // throw exception
a61af66fc99e Initial load
duke
parents:
diff changeset
238 __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError));
a61af66fc99e Initial load
duke
parents:
diff changeset
239 // the call_VM checks for exception, so we should never return here.
a61af66fc99e Initial load
duke
parents:
diff changeset
240 __ should_not_reach_here();
a61af66fc99e Initial load
duke
parents:
diff changeset
241
a61af66fc99e Initial load
duke
parents:
diff changeset
242 return entry_point;
a61af66fc99e Initial load
duke
parents:
diff changeset
243 }
a61af66fc99e Initial load
duke
parents:
diff changeset
244
710
e5b0439ef4ae 6655638: dynamic languages need method handles
jrose
parents: 337
diff changeset
245
0
a61af66fc99e Initial load
duke
parents:
diff changeset
246 void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) {
a61af66fc99e Initial load
duke
parents:
diff changeset
247
a61af66fc99e Initial load
duke
parents:
diff changeset
248 // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in
a61af66fc99e Initial load
duke
parents:
diff changeset
249 // the days we had adapter frames. When we deoptimize a situation where a
a61af66fc99e Initial load
duke
parents:
diff changeset
250 // compiled caller calls a compiled caller will have registers it expects
a61af66fc99e Initial load
duke
parents:
diff changeset
251 // to survive the call to the callee. If we deoptimize the callee the only
a61af66fc99e Initial load
duke
parents:
diff changeset
252 // way we can restore these registers is to have the oldest interpreter
a61af66fc99e Initial load
duke
parents:
diff changeset
253 // frame that we create restore these values. That is what this routine
a61af66fc99e Initial load
duke
parents:
diff changeset
254 // will accomplish.
a61af66fc99e Initial load
duke
parents:
diff changeset
255
a61af66fc99e Initial load
duke
parents:
diff changeset
256 // At the moment we have modified c2 to not have any callee save registers
a61af66fc99e Initial load
duke
parents:
diff changeset
257 // so this problem does not exist and this routine is just a place holder.
a61af66fc99e Initial load
duke
parents:
diff changeset
258
a61af66fc99e Initial load
duke
parents:
diff changeset
259 assert(f->is_interpreted_frame(), "must be interpreted");
a61af66fc99e Initial load
duke
parents:
diff changeset
260 }