author | dlong |
Tue, 21 Nov 2017 09:04:42 -0800 | |
changeset 47916 | bdbef8638948 |
parent 47688 | 3d1e3786d66e |
child 55608 | 47af68c44e02 |
child 58678 | 9cf78a70fa4f |
permissions | -rw-r--r-- |
1 | 1 |
/* |
47916
bdbef8638948
8190817: deopt special-case for _return_register_finalizer is confusing and leads to bugs
dlong
parents:
47688
diff
changeset
|
2 |
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5402
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5402
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5402
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
26 |
#include "interpreter/interpreter.hpp" |
|
27 |
#include "interpreter/interpreterRuntime.hpp" |
|
25715
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
24424
diff
changeset
|
28 |
#include "interpreter/interp_masm.hpp" |
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
24424
diff
changeset
|
29 |
#include "interpreter/templateInterpreter.hpp" |
35214 | 30 |
#include "interpreter/templateInterpreterGenerator.hpp" |
7397 | 31 |
#include "interpreter/templateTable.hpp" |
35479
62c12ca7a45e
8146410: Interpreter functions are declared and defined in the wrong files
coleenp
parents:
35214
diff
changeset
|
32 |
#include "memory/resourceArea.hpp" |
37161
e881f320966e
8150015: Integrate TraceTime with Unified Logging more seamlessly
rehn
parents:
36178
diff
changeset
|
33 |
#include "runtime/timerTrace.hpp" |
1 | 34 |
|
35 |
#ifndef CC_INTERP |
|
36 |
||
37 |
# define __ _masm-> |
|
38 |
||
39 |
void TemplateInterpreter::initialize() { |
|
40 |
if (_code != NULL) return; |
|
41 |
// assertions |
|
42 |
assert((int)Bytecodes::number_of_codes <= (int)DispatchTable::length, |
|
43 |
"dispatch table too small"); |
|
44 |
||
45 |
AbstractInterpreter::initialize(); |
|
46 |
||
47 |
TemplateTable::initialize(); |
|
48 |
||
49 |
// generate interpreter |
|
50 |
{ ResourceMark rm; |
|
37161
e881f320966e
8150015: Integrate TraceTime with Unified Logging more seamlessly
rehn
parents:
36178
diff
changeset
|
51 |
TraceTime timer("Interpreter generation", TRACETIME_LOG(Info, startuptime)); |
1 | 52 |
int code_size = InterpreterCodeSize; |
53 |
NOT_PRODUCT(code_size *= 4;) // debug uses extra interpreter code space |
|
54 |
_code = new StubQueue(new InterpreterCodeletInterface, code_size, NULL, |
|
55 |
"Interpreter"); |
|
35214 | 56 |
TemplateInterpreterGenerator g(_code); |
47688 | 57 |
// Free the unused memory not occupied by the interpreter and the stubs |
58 |
_code->deallocate_unused_tail(); |
|
31620
53be635ad49c
8087333: Optionally Pre-Generate the HotSpot Template Interpreter
bdelsart
parents:
25950
diff
changeset
|
59 |
} |
53be635ad49c
8087333: Optionally Pre-Generate the HotSpot Template Interpreter
bdelsart
parents:
25950
diff
changeset
|
60 |
|
53be635ad49c
8087333: Optionally Pre-Generate the HotSpot Template Interpreter
bdelsart
parents:
25950
diff
changeset
|
61 |
if (PrintInterpreter) { |
53be635ad49c
8087333: Optionally Pre-Generate the HotSpot Template Interpreter
bdelsart
parents:
25950
diff
changeset
|
62 |
ResourceMark rm; |
53be635ad49c
8087333: Optionally Pre-Generate the HotSpot Template Interpreter
bdelsart
parents:
25950
diff
changeset
|
63 |
print(); |
1 | 64 |
} |
65 |
||
66 |
// initialize dispatch table |
|
67 |
_active_table = _normal_table; |
|
68 |
} |
|
69 |
||
70 |
//------------------------------------------------------------------------------------------------------------------------ |
|
71 |
// Implementation of EntryPoint |
|
72 |
||
73 |
EntryPoint::EntryPoint() { |
|
37480 | 74 |
assert(number_of_states == 10, "check the code below"); |
1 | 75 |
_entry[btos] = NULL; |
37480 | 76 |
_entry[ztos] = NULL; |
1 | 77 |
_entry[ctos] = NULL; |
78 |
_entry[stos] = NULL; |
|
79 |
_entry[atos] = NULL; |
|
80 |
_entry[itos] = NULL; |
|
81 |
_entry[ltos] = NULL; |
|
82 |
_entry[ftos] = NULL; |
|
83 |
_entry[dtos] = NULL; |
|
84 |
_entry[vtos] = NULL; |
|
85 |
} |
|
86 |
||
87 |
||
37480 | 88 |
EntryPoint::EntryPoint(address bentry, address zentry, address centry, address sentry, address aentry, address ientry, address lentry, address fentry, address dentry, address ventry) { |
89 |
assert(number_of_states == 10, "check the code below"); |
|
1 | 90 |
_entry[btos] = bentry; |
37480 | 91 |
_entry[ztos] = zentry; |
1 | 92 |
_entry[ctos] = centry; |
93 |
_entry[stos] = sentry; |
|
94 |
_entry[atos] = aentry; |
|
95 |
_entry[itos] = ientry; |
|
96 |
_entry[ltos] = lentry; |
|
97 |
_entry[ftos] = fentry; |
|
98 |
_entry[dtos] = dentry; |
|
99 |
_entry[vtos] = ventry; |
|
100 |
} |
|
101 |
||
102 |
||
103 |
void EntryPoint::set_entry(TosState state, address entry) { |
|
104 |
assert(0 <= state && state < number_of_states, "state out of bounds"); |
|
105 |
_entry[state] = entry; |
|
106 |
} |
|
107 |
||
108 |
||
109 |
address EntryPoint::entry(TosState state) const { |
|
110 |
assert(0 <= state && state < number_of_states, "state out of bounds"); |
|
111 |
return _entry[state]; |
|
112 |
} |
|
113 |
||
114 |
||
115 |
void EntryPoint::print() { |
|
116 |
tty->print("["); |
|
117 |
for (int i = 0; i < number_of_states; i++) { |
|
118 |
if (i > 0) tty->print(", "); |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
21198
diff
changeset
|
119 |
tty->print(INTPTR_FORMAT, p2i(_entry[i])); |
1 | 120 |
} |
121 |
tty->print("]"); |
|
122 |
} |
|
123 |
||
124 |
||
125 |
bool EntryPoint::operator == (const EntryPoint& y) { |
|
126 |
int i = number_of_states; |
|
127 |
while (i-- > 0) { |
|
128 |
if (_entry[i] != y._entry[i]) return false; |
|
129 |
} |
|
130 |
return true; |
|
131 |
} |
|
132 |
||
133 |
||
134 |
//------------------------------------------------------------------------------------------------------------------------ |
|
135 |
// Implementation of DispatchTable |
|
136 |
||
137 |
EntryPoint DispatchTable::entry(int i) const { |
|
138 |
assert(0 <= i && i < length, "index out of bounds"); |
|
139 |
return |
|
140 |
EntryPoint( |
|
141 |
_table[btos][i], |
|
37480 | 142 |
_table[ztos][i], |
1 | 143 |
_table[ctos][i], |
144 |
_table[stos][i], |
|
145 |
_table[atos][i], |
|
146 |
_table[itos][i], |
|
147 |
_table[ltos][i], |
|
148 |
_table[ftos][i], |
|
149 |
_table[dtos][i], |
|
150 |
_table[vtos][i] |
|
151 |
); |
|
152 |
} |
|
153 |
||
154 |
||
155 |
void DispatchTable::set_entry(int i, EntryPoint& entry) { |
|
156 |
assert(0 <= i && i < length, "index out of bounds"); |
|
37480 | 157 |
assert(number_of_states == 10, "check the code below"); |
1 | 158 |
_table[btos][i] = entry.entry(btos); |
37480 | 159 |
_table[ztos][i] = entry.entry(ztos); |
1 | 160 |
_table[ctos][i] = entry.entry(ctos); |
161 |
_table[stos][i] = entry.entry(stos); |
|
162 |
_table[atos][i] = entry.entry(atos); |
|
163 |
_table[itos][i] = entry.entry(itos); |
|
164 |
_table[ltos][i] = entry.entry(ltos); |
|
165 |
_table[ftos][i] = entry.entry(ftos); |
|
166 |
_table[dtos][i] = entry.entry(dtos); |
|
167 |
_table[vtos][i] = entry.entry(vtos); |
|
168 |
} |
|
169 |
||
170 |
||
171 |
bool DispatchTable::operator == (DispatchTable& y) { |
|
172 |
int i = length; |
|
173 |
while (i-- > 0) { |
|
174 |
EntryPoint t = y.entry(i); // for compiler compatibility (BugId 4150096) |
|
175 |
if (!(entry(i) == t)) return false; |
|
176 |
} |
|
177 |
return true; |
|
178 |
} |
|
179 |
||
180 |
address TemplateInterpreter::_remove_activation_entry = NULL; |
|
181 |
address TemplateInterpreter::_remove_activation_preserving_args_entry = NULL; |
|
182 |
||
183 |
||
184 |
address TemplateInterpreter::_throw_ArrayIndexOutOfBoundsException_entry = NULL; |
|
185 |
address TemplateInterpreter::_throw_ArrayStoreException_entry = NULL; |
|
186 |
address TemplateInterpreter::_throw_ArithmeticException_entry = NULL; |
|
187 |
address TemplateInterpreter::_throw_ClassCastException_entry = NULL; |
|
188 |
address TemplateInterpreter::_throw_NullPointerException_entry = NULL; |
|
189 |
address TemplateInterpreter::_throw_StackOverflowError_entry = NULL; |
|
190 |
address TemplateInterpreter::_throw_exception_entry = NULL; |
|
191 |
||
192 |
#ifndef PRODUCT |
|
193 |
EntryPoint TemplateInterpreter::_trace_code; |
|
194 |
#endif // !PRODUCT |
|
195 |
EntryPoint TemplateInterpreter::_return_entry[TemplateInterpreter::number_of_return_entries]; |
|
196 |
EntryPoint TemplateInterpreter::_earlyret_entry; |
|
197 |
EntryPoint TemplateInterpreter::_deopt_entry [TemplateInterpreter::number_of_deopt_entries ]; |
|
47916
bdbef8638948
8190817: deopt special-case for _return_register_finalizer is confusing and leads to bugs
dlong
parents:
47688
diff
changeset
|
198 |
address TemplateInterpreter::_deopt_reexecute_return_entry; |
1 | 199 |
EntryPoint TemplateInterpreter::_safept_entry; |
200 |
||
21198
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
201 |
address TemplateInterpreter::_invoke_return_entry[TemplateInterpreter::number_of_return_addrs]; |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
202 |
address TemplateInterpreter::_invokeinterface_return_entry[TemplateInterpreter::number_of_return_addrs]; |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
203 |
address TemplateInterpreter::_invokedynamic_return_entry[TemplateInterpreter::number_of_return_addrs]; |
1 | 204 |
|
205 |
DispatchTable TemplateInterpreter::_active_table; |
|
206 |
DispatchTable TemplateInterpreter::_normal_table; |
|
207 |
DispatchTable TemplateInterpreter::_safept_table; |
|
208 |
address TemplateInterpreter::_wentry_point[DispatchTable::length]; |
|
209 |
||
210 |
||
211 |
//------------------------------------------------------------------------------------------------------------------------ |
|
212 |
// Entry points |
|
213 |
||
21198
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
214 |
/** |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
215 |
* Returns the return entry table for the given invoke bytecode. |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
216 |
*/ |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
217 |
address* TemplateInterpreter::invoke_return_entry_table_for(Bytecodes::Code code) { |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
218 |
switch (code) { |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
219 |
case Bytecodes::_invokestatic: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
220 |
case Bytecodes::_invokespecial: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
221 |
case Bytecodes::_invokevirtual: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
222 |
case Bytecodes::_invokehandle: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
223 |
return Interpreter::invoke_return_entry_table(); |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
224 |
case Bytecodes::_invokeinterface: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
225 |
return Interpreter::invokeinterface_return_entry_table(); |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
226 |
case Bytecodes::_invokedynamic: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
227 |
return Interpreter::invokedynamic_return_entry_table(); |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
228 |
default: |
33105
294e48b4f704
8080775: Better argument formatting for assert() and friends
david
parents:
32391
diff
changeset
|
229 |
fatal("invalid bytecode: %s", Bytecodes::name(code)); |
21198
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
230 |
return NULL; |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
231 |
} |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
232 |
} |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
233 |
|
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
234 |
/** |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
235 |
* Returns the return entry address for the given top-of-stack state and bytecode. |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
236 |
*/ |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
237 |
address TemplateInterpreter::return_entry(TosState state, int length, Bytecodes::Code code) { |
1 | 238 |
guarantee(0 <= length && length < Interpreter::number_of_return_entries, "illegal length"); |
21198
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
239 |
const int index = TosState_as_index(state); |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
240 |
switch (code) { |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
241 |
case Bytecodes::_invokestatic: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
242 |
case Bytecodes::_invokespecial: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
243 |
case Bytecodes::_invokevirtual: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
244 |
case Bytecodes::_invokehandle: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
245 |
return _invoke_return_entry[index]; |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
246 |
case Bytecodes::_invokeinterface: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
247 |
return _invokeinterface_return_entry[index]; |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
248 |
case Bytecodes::_invokedynamic: |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
249 |
return _invokedynamic_return_entry[index]; |
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
250 |
default: |
33105
294e48b4f704
8080775: Better argument formatting for assert() and friends
david
parents:
32391
diff
changeset
|
251 |
assert(!Bytecodes::is_invoke(code), "invoke instructions should be handled separately: %s", Bytecodes::name(code)); |
47916
bdbef8638948
8190817: deopt special-case for _return_register_finalizer is confusing and leads to bugs
dlong
parents:
47688
diff
changeset
|
252 |
address entry = _return_entry[length].entry(state); |
bdbef8638948
8190817: deopt special-case for _return_register_finalizer is confusing and leads to bugs
dlong
parents:
47688
diff
changeset
|
253 |
vmassert(entry != NULL, "unsupported return entry requested, length=%d state=%d", length, index); |
bdbef8638948
8190817: deopt special-case for _return_register_finalizer is confusing and leads to bugs
dlong
parents:
47688
diff
changeset
|
254 |
return entry; |
21198
dd647e8d1d72
8026328: Setting a breakpoint on invokedynamic crashes the JVM
twisti
parents:
18507
diff
changeset
|
255 |
} |
1 | 256 |
} |
257 |
||
258 |
||
259 |
address TemplateInterpreter::deopt_entry(TosState state, int length) { |
|
260 |
guarantee(0 <= length && length < Interpreter::number_of_deopt_entries, "illegal length"); |
|
47916
bdbef8638948
8190817: deopt special-case for _return_register_finalizer is confusing and leads to bugs
dlong
parents:
47688
diff
changeset
|
261 |
address entry = _deopt_entry[length].entry(state); |
bdbef8638948
8190817: deopt special-case for _return_register_finalizer is confusing and leads to bugs
dlong
parents:
47688
diff
changeset
|
262 |
vmassert(entry != NULL, "unsupported deopt entry requested, length=%d state=%d", length, TosState_as_index(state)); |
bdbef8638948
8190817: deopt special-case for _return_register_finalizer is confusing and leads to bugs
dlong
parents:
47688
diff
changeset
|
263 |
return entry; |
1 | 264 |
} |
265 |
||
266 |
//------------------------------------------------------------------------------------------------------------------------ |
|
267 |
// Suport for invokes |
|
268 |
||
269 |
int TemplateInterpreter::TosState_as_index(TosState state) { |
|
270 |
assert( state < number_of_states , "Invalid state in TosState_as_index"); |
|
271 |
assert(0 <= (int)state && (int)state < TemplateInterpreter::number_of_return_addrs, "index out of bounds"); |
|
272 |
return (int)state; |
|
273 |
} |
|
274 |
||
275 |
||
276 |
//------------------------------------------------------------------------------------------------------------------------ |
|
277 |
// Safepoint suppport |
|
278 |
||
279 |
static inline void copy_table(address* from, address* to, int size) { |
|
280 |
// Copy non-overlapping tables. The copy has to occur word wise for MT safety. |
|
281 |
while (size-- > 0) *to++ = *from++; |
|
282 |
} |
|
283 |
||
284 |
void TemplateInterpreter::notice_safepoints() { |
|
285 |
if (!_notice_safepoints) { |
|
286 |
// switch to safepoint dispatch table |
|
287 |
_notice_safepoints = true; |
|
288 |
copy_table((address*)&_safept_table, (address*)&_active_table, sizeof(_active_table) / sizeof(address)); |
|
289 |
} |
|
290 |
} |
|
291 |
||
292 |
// switch from the dispatch table which notices safepoints back to the |
|
293 |
// normal dispatch table. So that we can notice single stepping points, |
|
294 |
// keep the safepoint dispatch table if we are single stepping in JVMTI. |
|
295 |
// Note that the should_post_single_step test is exactly as fast as the |
|
296 |
// JvmtiExport::_enabled test and covers both cases. |
|
297 |
void TemplateInterpreter::ignore_safepoints() { |
|
298 |
if (_notice_safepoints) { |
|
299 |
if (!JvmtiExport::should_post_single_step()) { |
|
300 |
// switch to normal dispatch table |
|
301 |
_notice_safepoints = false; |
|
302 |
copy_table((address*)&_normal_table, (address*)&_active_table, sizeof(_active_table) / sizeof(address)); |
|
303 |
} |
|
304 |
} |
|
305 |
} |
|
306 |
||
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
307 |
//------------------------------------------------------------------------------------------------------------------------ |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
308 |
// Deoptimization support |
1 | 309 |
|
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
310 |
// If deoptimization happens, this function returns the point of next bytecode to continue execution |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
311 |
address TemplateInterpreter::deopt_continue_after_entry(Method* method, address bcp, int callee_parameters, bool is_top_frame) { |
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
312 |
return AbstractInterpreter::deopt_continue_after_entry(method, bcp, callee_parameters, is_top_frame); |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
313 |
} |
1 | 314 |
|
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
315 |
// If deoptimization happens, this function returns the point where the interpreter reexecutes |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
316 |
// the bytecode. |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
317 |
// Note: Bytecodes::_athrow (C1 only) and Bytecodes::_return are the special cases |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
318 |
// that do not return "Interpreter::deopt_entry(vtos, 0)" |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
319 |
address TemplateInterpreter::deopt_reexecute_entry(Method* method, address bcp) { |
1 | 320 |
assert(method->contains(bcp), "just checkin'"); |
47916
bdbef8638948
8190817: deopt special-case for _return_register_finalizer is confusing and leads to bugs
dlong
parents:
47688
diff
changeset
|
321 |
Bytecodes::Code code = Bytecodes::code_at(method, bcp); |
bdbef8638948
8190817: deopt special-case for _return_register_finalizer is confusing and leads to bugs
dlong
parents:
47688
diff
changeset
|
322 |
if (code == Bytecodes::_return_register_finalizer) { |
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
323 |
// This is used for deopt during registration of finalizers |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
324 |
// during Object.<init>. We simply need to resume execution at |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
325 |
// the standard return vtos bytecode to pop the frame normally. |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
326 |
// reexecuting the real bytecode would cause double registration |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
327 |
// of the finalizable object. |
47916
bdbef8638948
8190817: deopt special-case for _return_register_finalizer is confusing and leads to bugs
dlong
parents:
47688
diff
changeset
|
328 |
return Interpreter::deopt_reexecute_return_entry(); |
1 | 329 |
} else { |
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
330 |
return AbstractInterpreter::deopt_reexecute_entry(method, bcp); |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
331 |
} |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
332 |
} |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
333 |
|
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
334 |
// If deoptimization happens, the interpreter should reexecute this bytecode. |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
335 |
// This function mainly helps the compilers to set up the reexecute bit. |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
336 |
bool TemplateInterpreter::bytecode_should_reexecute(Bytecodes::Code code) { |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
337 |
if (code == Bytecodes::_return) { |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
338 |
//Yes, we consider Bytecodes::_return as a special case of reexecution |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
339 |
return true; |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
340 |
} else { |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
2570
diff
changeset
|
341 |
return AbstractInterpreter::bytecode_should_reexecute(code); |
1 | 342 |
} |
343 |
} |
|
344 |
||
35214 | 345 |
InterpreterCodelet* TemplateInterpreter::codelet_containing(address pc) { |
346 |
return (InterpreterCodelet*)_code->stub_containing(pc); |
|
347 |
} |
|
348 |
||
1 | 349 |
#endif // !CC_INTERP |