author | rprotacio |
Mon, 23 Nov 2015 16:16:46 -0500 | |
changeset 34262 | 43560e879d6d |
parent 33198 | b37ad9fbf681 |
child 38133 | 78b95467b9f1 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
24018
diff
changeset
|
2 |
* Copyright (c) 1997, 2014, 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:
5419
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
5419
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:
5419
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
7397 | 25 |
#include "precompiled.hpp" |
26 |
#include "classfile/vmSymbols.hpp" |
|
25715
d5a8dbdc5150
8049325: Introduce and clean up umbrella headers for the files in the cpu subdirectories.
goetz
parents:
24424
diff
changeset
|
27 |
#include "code/vmreg.inline.hpp" |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
28 |
#include "interpreter/bytecode.hpp" |
7397 | 29 |
#include "interpreter/interpreter.hpp" |
30 |
#include "memory/allocation.inline.hpp" |
|
31 |
#include "memory/resourceArea.hpp" |
|
32 |
#include "memory/universe.inline.hpp" |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
33 |
#include "oops/methodData.hpp" |
7397 | 34 |
#include "oops/oop.inline.hpp" |
35 |
#include "prims/jvmtiThreadState.hpp" |
|
36 |
#include "runtime/handles.inline.hpp" |
|
37 |
#include "runtime/monitorChunk.hpp" |
|
38 |
#include "runtime/sharedRuntime.hpp" |
|
39 |
#include "runtime/vframe.hpp" |
|
40 |
#include "runtime/vframeArray.hpp" |
|
41 |
#include "runtime/vframe_hp.hpp" |
|
42 |
#include "utilities/events.hpp" |
|
43 |
#ifdef COMPILER2 |
|
44 |
#include "opto/runtime.hpp" |
|
45 |
#endif |
|
1 | 46 |
|
47 |
int vframeArrayElement:: bci(void) const { return (_bci == SynchronizationEntryBCI ? 0 : _bci); } |
|
48 |
||
49 |
void vframeArrayElement::free_monitors(JavaThread* jt) { |
|
50 |
if (_monitors != NULL) { |
|
51 |
MonitorChunk* chunk = _monitors; |
|
52 |
_monitors = NULL; |
|
53 |
jt->remove_monitor_chunk(chunk); |
|
54 |
delete chunk; |
|
55 |
} |
|
56 |
} |
|
57 |
||
28039
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
58 |
void vframeArrayElement::fill_in(compiledVFrame* vf, bool realloc_failures) { |
1 | 59 |
|
60 |
// Copy the information from the compiled vframe to the |
|
61 |
// interpreter frame we will be creating to replace vf |
|
62 |
||
63 |
_method = vf->method(); |
|
64 |
_bci = vf->raw_bci(); |
|
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
3171
diff
changeset
|
65 |
_reexecute = vf->should_reexecute(); |
28039
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
66 |
#ifdef ASSERT |
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
67 |
_removed_monitors = false; |
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
68 |
#endif |
1 | 69 |
|
70 |
int index; |
|
71 |
||
72 |
// Get the monitors off-stack |
|
73 |
||
74 |
GrowableArray<MonitorInfo*>* list = vf->monitors(); |
|
75 |
if (list->is_empty()) { |
|
76 |
_monitors = NULL; |
|
77 |
} else { |
|
78 |
||
79 |
// Allocate monitor chunk |
|
80 |
_monitors = new MonitorChunk(list->length()); |
|
81 |
vf->thread()->add_monitor_chunk(_monitors); |
|
82 |
||
83 |
// Migrate the BasicLocks from the stack to the monitor chunk |
|
84 |
for (index = 0; index < list->length(); index++) { |
|
85 |
MonitorInfo* monitor = list->at(index); |
|
28039
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
86 |
assert(!monitor->owner_is_scalar_replaced() || realloc_failures, "object should be reallocated already"); |
1 | 87 |
BasicObjectLock* dest = _monitors->at(index); |
28039
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
88 |
if (monitor->owner_is_scalar_replaced()) { |
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
89 |
dest->set_obj(NULL); |
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
90 |
} else { |
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
91 |
assert(monitor->owner() == NULL || (!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern()), "object must be null or locked, and unbiased"); |
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
92 |
dest->set_obj(monitor->owner()); |
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
93 |
monitor->lock()->move_to(monitor->owner(), dest->lock()); |
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
94 |
} |
1 | 95 |
} |
96 |
} |
|
97 |
||
98 |
// Convert the vframe locals and expressions to off stack |
|
99 |
// values. Because we will not gc all oops can be converted to |
|
100 |
// intptr_t (i.e. a stack slot) and we are fine. This is |
|
101 |
// good since we are inside a HandleMark and the oops in our |
|
102 |
// collection would go away between packing them here and |
|
103 |
// unpacking them in unpack_on_stack. |
|
104 |
||
105 |
// First the locals go off-stack |
|
106 |
||
107 |
// FIXME this seems silly it creates a StackValueCollection |
|
108 |
// in order to get the size to then copy them and |
|
109 |
// convert the types to intptr_t size slots. Seems like it |
|
110 |
// could do it in place... Still uses less memory than the |
|
111 |
// old way though |
|
112 |
||
113 |
StackValueCollection *locs = vf->locals(); |
|
114 |
_locals = new StackValueCollection(locs->size()); |
|
115 |
for(index = 0; index < locs->size(); index++) { |
|
116 |
StackValue* value = locs->at(index); |
|
117 |
switch(value->type()) { |
|
118 |
case T_OBJECT: |
|
28039
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
119 |
assert(!value->obj_is_scalar_replaced() || realloc_failures, "object should be reallocated already"); |
1 | 120 |
// preserve object type |
20282
7f9cbdf89af2
7195622: CheckUnhandledOops has limited usefulness now
hseigel
parents:
15943
diff
changeset
|
121 |
_locals->add( new StackValue(cast_from_oop<intptr_t>((value->get_obj()())), T_OBJECT )); |
1 | 122 |
break; |
123 |
case T_CONFLICT: |
|
124 |
// A dead local. Will be initialized to null/zero. |
|
125 |
_locals->add( new StackValue()); |
|
126 |
break; |
|
127 |
case T_INT: |
|
128 |
_locals->add( new StackValue(value->get_int())); |
|
129 |
break; |
|
130 |
default: |
|
131 |
ShouldNotReachHere(); |
|
132 |
} |
|
133 |
} |
|
134 |
||
135 |
// Now the expressions off-stack |
|
136 |
// Same silliness as above |
|
137 |
||
138 |
StackValueCollection *exprs = vf->expressions(); |
|
139 |
_expressions = new StackValueCollection(exprs->size()); |
|
140 |
for(index = 0; index < exprs->size(); index++) { |
|
141 |
StackValue* value = exprs->at(index); |
|
142 |
switch(value->type()) { |
|
143 |
case T_OBJECT: |
|
28039
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
144 |
assert(!value->obj_is_scalar_replaced() || realloc_failures, "object should be reallocated already"); |
1 | 145 |
// preserve object type |
20282
7f9cbdf89af2
7195622: CheckUnhandledOops has limited usefulness now
hseigel
parents:
15943
diff
changeset
|
146 |
_expressions->add( new StackValue(cast_from_oop<intptr_t>((value->get_obj()())), T_OBJECT )); |
1 | 147 |
break; |
148 |
case T_CONFLICT: |
|
149 |
// A dead stack element. Will be initialized to null/zero. |
|
150 |
// This can occur when the compiler emits a state in which stack |
|
151 |
// elements are known to be dead (because of an imminent exception). |
|
152 |
_expressions->add( new StackValue()); |
|
153 |
break; |
|
154 |
case T_INT: |
|
155 |
_expressions->add( new StackValue(value->get_int())); |
|
156 |
break; |
|
157 |
default: |
|
158 |
ShouldNotReachHere(); |
|
159 |
} |
|
160 |
} |
|
161 |
} |
|
162 |
||
163 |
int unpack_counter = 0; |
|
164 |
||
9636
363ca5579aff
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
7913
diff
changeset
|
165 |
void vframeArrayElement::unpack_on_stack(int caller_actual_parameters, |
363ca5579aff
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
7913
diff
changeset
|
166 |
int callee_parameters, |
1 | 167 |
int callee_locals, |
168 |
frame* caller, |
|
169 |
bool is_top_frame, |
|
15943
d830a939d985
8009761: Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
roland
parents:
15475
diff
changeset
|
170 |
bool is_bottom_frame, |
1 | 171 |
int exec_mode) { |
172 |
JavaThread* thread = (JavaThread*) Thread::current(); |
|
173 |
||
174 |
// Look at bci and decide on bcp and continuation pc |
|
175 |
address bcp; |
|
176 |
// C++ interpreter doesn't need a pc since it will figure out what to do when it |
|
177 |
// begins execution |
|
178 |
address pc; |
|
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
3171
diff
changeset
|
179 |
bool use_next_mdp = false; // true if we should use the mdp associated with the next bci |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
3171
diff
changeset
|
180 |
// rather than the one associated with bcp |
1 | 181 |
if (raw_bci() == SynchronizationEntryBCI) { |
182 |
// We are deoptimizing while hanging in prologue code for synchronized method |
|
183 |
bcp = method()->bcp_from(0); // first byte code |
|
184 |
pc = Interpreter::deopt_entry(vtos, 0); // step = 0 since we don't skip current bytecode |
|
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
3171
diff
changeset
|
185 |
} else if (should_reexecute()) { //reexecute this bytecode |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
3171
diff
changeset
|
186 |
assert(is_top_frame, "reexecute allowed only for the top frame"); |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
3171
diff
changeset
|
187 |
bcp = method()->bcp_from(bci()); |
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
3171
diff
changeset
|
188 |
pc = Interpreter::deopt_reexecute_entry(method(), bcp); |
1 | 189 |
} else { |
190 |
bcp = method()->bcp_from(bci()); |
|
3600
27aa4477d039
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
3171
diff
changeset
|
191 |
pc = Interpreter::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:
3171
diff
changeset
|
192 |
use_next_mdp = true; |
1 | 193 |
} |
194 |
assert(Bytecodes::is_defined(*bcp), "must be a valid bytecode"); |
|
195 |
||
196 |
// Monitorenter and pending exceptions: |
|
197 |
// |
|
198 |
// For Compiler2, there should be no pending exception when deoptimizing at monitorenter |
|
199 |
// because there is no safepoint at the null pointer check (it is either handled explicitly |
|
200 |
// or prior to the monitorenter) and asynchronous exceptions are not made "pending" by the |
|
201 |
// runtime interface for the slow case (see JRT_ENTRY_FOR_MONITORENTER). If an asynchronous |
|
202 |
// exception was processed, the bytecode pointer would have to be extended one bytecode beyond |
|
203 |
// the monitorenter to place it in the proper exception range. |
|
204 |
// |
|
205 |
// For Compiler1, deoptimization can occur while throwing a NullPointerException at monitorenter, |
|
206 |
// in which case bcp should point to the monitorenter since it is within the exception's range. |
|
207 |
||
208 |
assert(*bcp != Bytecodes::_monitorenter || is_top_frame, "a _monitorenter must be a top frame"); |
|
6740
2bc601284215
6986270: guarantee(*bcp != Bytecodes::_monitorenter || exec_mode != Deoptimization::Unpack_exception) fails
iveresov
parents:
5883
diff
changeset
|
209 |
assert(thread->deopt_nmethod() != NULL, "nmethod should be known"); |
2bc601284215
6986270: guarantee(*bcp != Bytecodes::_monitorenter || exec_mode != Deoptimization::Unpack_exception) fails
iveresov
parents:
5883
diff
changeset
|
210 |
guarantee(!(thread->deopt_nmethod()->is_compiled_by_c2() && |
2bc601284215
6986270: guarantee(*bcp != Bytecodes::_monitorenter || exec_mode != Deoptimization::Unpack_exception) fails
iveresov
parents:
5883
diff
changeset
|
211 |
*bcp == Bytecodes::_monitorenter && |
2bc601284215
6986270: guarantee(*bcp != Bytecodes::_monitorenter || exec_mode != Deoptimization::Unpack_exception) fails
iveresov
parents:
5883
diff
changeset
|
212 |
exec_mode == Deoptimization::Unpack_exception), |
2bc601284215
6986270: guarantee(*bcp != Bytecodes::_monitorenter || exec_mode != Deoptimization::Unpack_exception) fails
iveresov
parents:
5883
diff
changeset
|
213 |
"shouldn't get exception during monitorenter"); |
1 | 214 |
|
215 |
int popframe_preserved_args_size_in_bytes = 0; |
|
216 |
int popframe_preserved_args_size_in_words = 0; |
|
217 |
if (is_top_frame) { |
|
4896
88b4193b82b0
6925249: assert(last_sp < (intptr_t*) interpreter_frame_monitor_begin(),"bad tos")
kvn
parents:
3603
diff
changeset
|
218 |
JvmtiThreadState *state = thread->jvmti_thread_state(); |
1 | 219 |
if (JvmtiExport::can_pop_frame() && |
220 |
(thread->has_pending_popframe() || thread->popframe_forcing_deopt_reexecution())) { |
|
221 |
if (thread->has_pending_popframe()) { |
|
222 |
// Pop top frame after deoptimization |
|
223 |
#ifndef CC_INTERP |
|
224 |
pc = Interpreter::remove_activation_preserving_args_entry(); |
|
225 |
#else |
|
226 |
// Do an uncommon trap type entry. c++ interpreter will know |
|
227 |
// to pop frame and preserve the args |
|
228 |
pc = Interpreter::deopt_entry(vtos, 0); |
|
229 |
use_next_mdp = false; |
|
230 |
#endif |
|
231 |
} else { |
|
232 |
// Reexecute invoke in top frame |
|
233 |
pc = Interpreter::deopt_entry(vtos, 0); |
|
234 |
use_next_mdp = false; |
|
235 |
popframe_preserved_args_size_in_bytes = in_bytes(thread->popframe_preserved_args_size()); |
|
236 |
// Note: the PopFrame-related extension of the expression stack size is done in |
|
237 |
// Deoptimization::fetch_unroll_info_helper |
|
238 |
popframe_preserved_args_size_in_words = in_words(thread->popframe_preserved_args_size_in_words()); |
|
239 |
} |
|
240 |
} else if (JvmtiExport::can_force_early_return() && state != NULL && state->is_earlyret_pending()) { |
|
241 |
// Force early return from top frame after deoptimization |
|
242 |
#ifndef CC_INTERP |
|
243 |
pc = Interpreter::remove_activation_early_entry(state->earlyret_tos()); |
|
244 |
#endif |
|
245 |
} else { |
|
246 |
// Possibly override the previous pc computation of the top (youngest) frame |
|
247 |
switch (exec_mode) { |
|
248 |
case Deoptimization::Unpack_deopt: |
|
249 |
// use what we've got |
|
250 |
break; |
|
251 |
case Deoptimization::Unpack_exception: |
|
252 |
// exception is pending |
|
5046 | 253 |
pc = SharedRuntime::raw_exception_handler_for_return_address(thread, pc); |
1 | 254 |
// [phh] We're going to end up in some handler or other, so it doesn't |
255 |
// matter what mdp we point to. See exception_handler_for_exception() |
|
256 |
// in interpreterRuntime.cpp. |
|
257 |
break; |
|
258 |
case Deoptimization::Unpack_uncommon_trap: |
|
259 |
case Deoptimization::Unpack_reexecute: |
|
260 |
// redo last byte code |
|
261 |
pc = Interpreter::deopt_entry(vtos, 0); |
|
262 |
use_next_mdp = false; |
|
263 |
break; |
|
264 |
default: |
|
265 |
ShouldNotReachHere(); |
|
266 |
} |
|
267 |
} |
|
268 |
} |
|
269 |
||
270 |
// Setup the interpreter frame |
|
271 |
||
272 |
assert(method() != NULL, "method must exist"); |
|
273 |
int temps = expressions()->size(); |
|
274 |
||
275 |
int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors(); |
|
276 |
||
277 |
Interpreter::layout_activation(method(), |
|
278 |
temps + callee_parameters, |
|
279 |
popframe_preserved_args_size_in_words, |
|
280 |
locks, |
|
9636
363ca5579aff
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
7913
diff
changeset
|
281 |
caller_actual_parameters, |
1 | 282 |
callee_parameters, |
283 |
callee_locals, |
|
284 |
caller, |
|
285 |
iframe(), |
|
15943
d830a939d985
8009761: Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
roland
parents:
15475
diff
changeset
|
286 |
is_top_frame, |
d830a939d985
8009761: Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
roland
parents:
15475
diff
changeset
|
287 |
is_bottom_frame); |
1 | 288 |
|
289 |
// Update the pc in the frame object and overwrite the temporary pc |
|
290 |
// we placed in the skeletal frame now that we finally know the |
|
291 |
// exact interpreter address we should use. |
|
292 |
||
293 |
_frame.patch_pc(thread, pc); |
|
294 |
||
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
295 |
assert (!method()->is_synchronized() || locks > 0 || _removed_monitors || raw_bci() == SynchronizationEntryBCI, "synchronized methods must have monitors"); |
1 | 296 |
|
297 |
BasicObjectLock* top = iframe()->interpreter_frame_monitor_begin(); |
|
298 |
for (int index = 0; index < locks; index++) { |
|
299 |
top = iframe()->previous_monitor_in_interpreter_frame(top); |
|
300 |
BasicObjectLock* src = _monitors->at(index); |
|
301 |
top->set_obj(src->obj()); |
|
302 |
src->lock()->move_to(src->obj(), top->lock()); |
|
303 |
} |
|
304 |
if (ProfileInterpreter) { |
|
25714
87fa6860b5ae
8004128: NPG: remove stackwalking in Threads::gc_prologue and gc_epilogue code
coleenp
parents:
24424
diff
changeset
|
305 |
iframe()->interpreter_frame_set_mdp(0); // clear out the mdp. |
1 | 306 |
} |
25714
87fa6860b5ae
8004128: NPG: remove stackwalking in Threads::gc_prologue and gc_epilogue code
coleenp
parents:
24424
diff
changeset
|
307 |
iframe()->interpreter_frame_set_bcp(bcp); |
1 | 308 |
if (ProfileInterpreter) { |
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13391
diff
changeset
|
309 |
MethodData* mdo = method()->method_data(); |
1 | 310 |
if (mdo != NULL) { |
311 |
int bci = iframe()->interpreter_frame_bci(); |
|
312 |
if (use_next_mdp) ++bci; |
|
313 |
address mdp = mdo->bci_to_dp(bci); |
|
314 |
iframe()->interpreter_frame_set_mdp(mdp); |
|
315 |
} |
|
316 |
} |
|
317 |
||
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
318 |
if (PrintDeoptimizationDetails) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
319 |
tty->print_cr("Expressions size: %d", expressions()->size()); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
320 |
} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
321 |
|
1 | 322 |
// Unpack expression stack |
323 |
// If this is an intermediate frame (i.e. not top frame) then this |
|
324 |
// only unpacks the part of the expression stack not used by callee |
|
325 |
// as parameters. The callee parameters are unpacked as part of the |
|
326 |
// callee locals. |
|
327 |
int i; |
|
328 |
for(i = 0; i < expressions()->size(); i++) { |
|
329 |
StackValue *value = expressions()->at(i); |
|
330 |
intptr_t* addr = iframe()->interpreter_frame_expression_stack_at(i); |
|
331 |
switch(value->type()) { |
|
332 |
case T_INT: |
|
333 |
*addr = value->get_int(); |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
334 |
#ifndef PRODUCT |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
335 |
if (PrintDeoptimizationDetails) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
336 |
tty->print_cr("Reconstructed expression %d (INT): %d", i, (int)(*addr)); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
337 |
} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
338 |
#endif |
1 | 339 |
break; |
340 |
case T_OBJECT: |
|
341 |
*addr = value->get_int(T_OBJECT); |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
342 |
#ifndef PRODUCT |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
343 |
if (PrintDeoptimizationDetails) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
344 |
tty->print("Reconstructed expression %d (OBJECT): ", i); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
345 |
oop o = (oop)(address)(*addr); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
346 |
if (o == NULL) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
347 |
tty->print_cr("NULL"); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
348 |
} else { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
349 |
ResourceMark rm; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
350 |
tty->print_raw_cr(o->klass()->name()->as_C_string()); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
351 |
} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
352 |
} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
353 |
#endif |
1 | 354 |
break; |
355 |
case T_CONFLICT: |
|
356 |
// A dead stack slot. Initialize to null in case it is an oop. |
|
357 |
*addr = NULL_WORD; |
|
358 |
break; |
|
359 |
default: |
|
360 |
ShouldNotReachHere(); |
|
361 |
} |
|
362 |
} |
|
363 |
||
364 |
||
365 |
// Unpack the locals |
|
366 |
for(i = 0; i < locals()->size(); i++) { |
|
367 |
StackValue *value = locals()->at(i); |
|
368 |
intptr_t* addr = iframe()->interpreter_frame_local_at(i); |
|
369 |
switch(value->type()) { |
|
370 |
case T_INT: |
|
371 |
*addr = value->get_int(); |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
372 |
#ifndef PRODUCT |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
373 |
if (PrintDeoptimizationDetails) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
374 |
tty->print_cr("Reconstructed local %d (INT): %d", i, (int)(*addr)); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
375 |
} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
376 |
#endif |
1 | 377 |
break; |
378 |
case T_OBJECT: |
|
379 |
*addr = value->get_int(T_OBJECT); |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
380 |
#ifndef PRODUCT |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
381 |
if (PrintDeoptimizationDetails) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
382 |
tty->print("Reconstructed local %d (OBJECT): ", i); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
383 |
oop o = (oop)(address)(*addr); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
384 |
if (o == NULL) { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
385 |
tty->print_cr("NULL"); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
386 |
} else { |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
387 |
ResourceMark rm; |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
388 |
tty->print_raw_cr(o->klass()->name()->as_C_string()); |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
389 |
} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
390 |
} |
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
391 |
#endif |
1 | 392 |
break; |
393 |
case T_CONFLICT: |
|
394 |
// A dead location. If it is an oop then we need a NULL to prevent GC from following it |
|
395 |
*addr = NULL_WORD; |
|
396 |
break; |
|
397 |
default: |
|
398 |
ShouldNotReachHere(); |
|
399 |
} |
|
400 |
} |
|
401 |
||
402 |
if (is_top_frame && JvmtiExport::can_pop_frame() && thread->popframe_forcing_deopt_reexecution()) { |
|
403 |
// An interpreted frame was popped but it returns to a deoptimized |
|
404 |
// frame. The incoming arguments to the interpreted activation |
|
405 |
// were preserved in thread-local storage by the |
|
406 |
// remove_activation_preserving_args_entry in the interpreter; now |
|
407 |
// we put them back into the just-unpacked interpreter frame. |
|
408 |
// Note that this assumes that the locals arena grows toward lower |
|
409 |
// addresses. |
|
410 |
if (popframe_preserved_args_size_in_words != 0) { |
|
411 |
void* saved_args = thread->popframe_preserved_args(); |
|
412 |
assert(saved_args != NULL, "must have been saved by interpreter"); |
|
413 |
#ifdef ASSERT |
|
414 |
assert(popframe_preserved_args_size_in_words <= |
|
5419 | 415 |
iframe()->interpreter_frame_expression_stack_size()*Interpreter::stackElementWords, |
1 | 416 |
"expression stack size should have been extended"); |
417 |
#endif // ASSERT |
|
418 |
int top_element = iframe()->interpreter_frame_expression_stack_size()-1; |
|
419 |
intptr_t* base; |
|
420 |
if (frame::interpreter_frame_expression_stack_direction() < 0) { |
|
421 |
base = iframe()->interpreter_frame_expression_stack_at(top_element); |
|
422 |
} else { |
|
423 |
base = iframe()->interpreter_frame_expression_stack(); |
|
424 |
} |
|
5883
8dc4bdc132d5
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
5547
diff
changeset
|
425 |
Copy::conjoint_jbytes(saved_args, |
8dc4bdc132d5
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
5547
diff
changeset
|
426 |
base, |
8dc4bdc132d5
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
5547
diff
changeset
|
427 |
popframe_preserved_args_size_in_bytes); |
1 | 428 |
thread->popframe_free_preserved_args(); |
429 |
} |
|
430 |
} |
|
431 |
||
432 |
#ifndef PRODUCT |
|
33160
c59f1676d27e
8136421: JEP 243: Java-Level JVM Compiler Interface
twisti
parents:
28039
diff
changeset
|
433 |
if (PrintDeoptimizationDetails) { |
1 | 434 |
ttyLocker ttyl; |
435 |
tty->print_cr("[%d Interpreted Frame]", ++unpack_counter); |
|
436 |
iframe()->print_on(tty); |
|
437 |
RegisterMap map(thread); |
|
438 |
vframe* f = vframe::new_vframe(iframe(), &map, thread); |
|
439 |
f->print(); |
|
440 |
||
441 |
tty->print_cr("locals size %d", locals()->size()); |
|
442 |
tty->print_cr("expression size %d", expressions()->size()); |
|
443 |
||
444 |
method()->print_value(); |
|
445 |
tty->cr(); |
|
446 |
// method()->print_codes(); |
|
447 |
} else if (TraceDeoptimization) { |
|
448 |
tty->print(" "); |
|
449 |
method()->print_value(); |
|
7913 | 450 |
Bytecodes::Code code = Bytecodes::java_code_at(method(), bcp); |
1 | 451 |
int bci = method()->bci_from(bcp); |
452 |
tty->print(" - %s", Bytecodes::name(code)); |
|
453 |
tty->print(" @ bci %d ", bci); |
|
33148
68fa8b6c4340
8042893: compiler: PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC needs to be removed from source files
david
parents:
28039
diff
changeset
|
454 |
tty->print_cr("sp = " PTR_FORMAT, p2i(iframe()->sp())); |
1 | 455 |
} |
456 |
#endif // PRODUCT |
|
457 |
||
458 |
// The expression stack and locals are in the resource area don't leave |
|
459 |
// a dangling pointer in the vframeArray we leave around for debug |
|
460 |
// purposes |
|
461 |
||
462 |
_locals = _expressions = NULL; |
|
463 |
||
464 |
} |
|
465 |
||
24018
77b156916bab
8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents:
20282
diff
changeset
|
466 |
int vframeArrayElement::on_stack_size(int callee_parameters, |
1 | 467 |
int callee_locals, |
468 |
bool is_top_frame, |
|
469 |
int popframe_extra_stack_expression_els) const { |
|
470 |
assert(method()->max_locals() == locals()->size(), "just checking"); |
|
471 |
int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors(); |
|
472 |
int temps = expressions()->size(); |
|
24018
77b156916bab
8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents:
20282
diff
changeset
|
473 |
return Interpreter::size_activation(method()->max_stack(), |
1 | 474 |
temps + callee_parameters, |
475 |
popframe_extra_stack_expression_els, |
|
476 |
locks, |
|
477 |
callee_parameters, |
|
478 |
callee_locals, |
|
24018
77b156916bab
8032410: compiler/uncommontrap/TestStackBangRbp.java times out on Solaris-Sparc V9
roland
parents:
20282
diff
changeset
|
479 |
is_top_frame); |
1 | 480 |
} |
481 |
||
482 |
||
483 |
||
484 |
vframeArray* vframeArray::allocate(JavaThread* thread, int frame_size, GrowableArray<compiledVFrame*>* chunk, |
|
28039
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
485 |
RegisterMap *reg_map, frame sender, frame caller, frame self, |
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
486 |
bool realloc_failures) { |
1 | 487 |
|
488 |
// Allocate the vframeArray |
|
489 |
vframeArray * result = (vframeArray*) AllocateHeap(sizeof(vframeArray) + // fixed part |
|
490 |
sizeof(vframeArrayElement) * (chunk->length() - 1), // variable part |
|
13195 | 491 |
mtCompiler); |
1 | 492 |
result->_frames = chunk->length(); |
493 |
result->_owner_thread = thread; |
|
494 |
result->_sender = sender; |
|
495 |
result->_caller = caller; |
|
496 |
result->_original = self; |
|
497 |
result->set_unroll_block(NULL); // initialize it |
|
28039
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
498 |
result->fill_in(thread, frame_size, chunk, reg_map, realloc_failures); |
1 | 499 |
return result; |
500 |
} |
|
501 |
||
502 |
void vframeArray::fill_in(JavaThread* thread, |
|
503 |
int frame_size, |
|
504 |
GrowableArray<compiledVFrame*>* chunk, |
|
28039
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
505 |
const RegisterMap *reg_map, |
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
506 |
bool realloc_failures) { |
1 | 507 |
// Set owner first, it is used when adding monitor chunks |
508 |
||
509 |
_frame_size = frame_size; |
|
510 |
for(int i = 0; i < chunk->length(); i++) { |
|
28039
bf5a8340bf8a
6898462: The escape analysis with G1 cause crash assertion src/share/vm/runtime/vframeArray.cpp:94
roland
parents:
25717
diff
changeset
|
511 |
element(i)->fill_in(chunk->at(i), realloc_failures); |
1 | 512 |
} |
513 |
||
514 |
// Copy registers for callee-saved registers |
|
515 |
if (reg_map != NULL) { |
|
516 |
for(int i = 0; i < RegisterMap::reg_count; i++) { |
|
517 |
#ifdef AMD64 |
|
518 |
// The register map has one entry for every int (32-bit value), so |
|
519 |
// 64-bit physical registers have two entries in the map, one for |
|
520 |
// each half. Ignore the high halves of 64-bit registers, just like |
|
521 |
// frame::oopmapreg_to_location does. |
|
522 |
// |
|
523 |
// [phh] FIXME: this is a temporary hack! This code *should* work |
|
524 |
// correctly w/o this hack, possibly by changing RegisterMap::pd_location |
|
525 |
// in frame_amd64.cpp and the values of the phantom high half registers |
|
526 |
// in amd64.ad. |
|
527 |
// if (VMReg::Name(i) < SharedInfo::stack0 && is_even(i)) { |
|
528 |
intptr_t* src = (intptr_t*) reg_map->location(VMRegImpl::as_VMReg(i)); |
|
529 |
_callee_registers[i] = src != NULL ? *src : NULL_WORD; |
|
530 |
// } else { |
|
531 |
// jint* src = (jint*) reg_map->location(VMReg::Name(i)); |
|
532 |
// _callee_registers[i] = src != NULL ? *src : NULL_WORD; |
|
533 |
// } |
|
534 |
#else |
|
535 |
jint* src = (jint*) reg_map->location(VMRegImpl::as_VMReg(i)); |
|
536 |
_callee_registers[i] = src != NULL ? *src : NULL_WORD; |
|
537 |
#endif |
|
538 |
if (src == NULL) { |
|
539 |
set_location_valid(i, false); |
|
540 |
} else { |
|
541 |
set_location_valid(i, true); |
|
542 |
jint* dst = (jint*) register_location(i); |
|
543 |
*dst = *src; |
|
544 |
} |
|
545 |
} |
|
546 |
} |
|
547 |
} |
|
548 |
||
9636
363ca5579aff
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
7913
diff
changeset
|
549 |
void vframeArray::unpack_to_stack(frame &unpack_frame, int exec_mode, int caller_actual_parameters) { |
1 | 550 |
// stack picture |
551 |
// unpack_frame |
|
552 |
// [new interpreter frames ] (frames are skeletal but walkable) |
|
553 |
// caller_frame |
|
554 |
// |
|
555 |
// This routine fills in the missing data for the skeletal interpreter frames |
|
556 |
// in the above picture. |
|
557 |
||
558 |
// Find the skeletal interpreter frames to unpack into |
|
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
559 |
JavaThread* THREAD = JavaThread::current(); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
560 |
RegisterMap map(THREAD, false); |
1 | 561 |
// Get the youngest frame we will unpack (last to be unpacked) |
562 |
frame me = unpack_frame.sender(&map); |
|
563 |
int index; |
|
564 |
for (index = 0; index < frames(); index++ ) { |
|
565 |
*element(index)->iframe() = me; |
|
566 |
// Get the caller frame (possibly skeletal) |
|
567 |
me = me.sender(&map); |
|
568 |
} |
|
569 |
||
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
570 |
// Do the unpacking of interpreter frames; the frame at index 0 represents the top activation, so it has no callee |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
571 |
// Unpack the frames from the oldest (frames() -1) to the youngest (0) |
15943
d830a939d985
8009761: Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
roland
parents:
15475
diff
changeset
|
572 |
frame* caller_frame = &me; |
1 | 573 |
for (index = frames() - 1; index >= 0 ; index--) { |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
574 |
vframeArrayElement* elem = element(index); // caller |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
575 |
int callee_parameters, callee_locals; |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
576 |
if (index == 0) { |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
577 |
callee_parameters = callee_locals = 0; |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
578 |
} else { |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
579 |
methodHandle caller = elem->method(); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
580 |
methodHandle callee = element(index - 1)->method(); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
581 |
Bytecode_invoke inv(caller, elem->bci()); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
582 |
// invokedynamic instructions don't have a class but obviously don't have a MemberName appendix. |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
583 |
// NOTE: Use machinery here that avoids resolving of any kind. |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
584 |
const bool has_member_arg = |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
585 |
!inv.is_invokedynamic() && MethodHandles::has_member_arg(inv.klass(), inv.name()); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
586 |
callee_parameters = callee->size_of_parameters() + (has_member_arg ? 1 : 0); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
587 |
callee_locals = callee->max_locals(); |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
588 |
} |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
589 |
elem->unpack_on_stack(caller_actual_parameters, |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
590 |
callee_parameters, |
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
591 |
callee_locals, |
15943
d830a939d985
8009761: Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
roland
parents:
15475
diff
changeset
|
592 |
caller_frame, |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
593 |
index == 0, |
15943
d830a939d985
8009761: Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
roland
parents:
15475
diff
changeset
|
594 |
index == frames() - 1, |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
595 |
exec_mode); |
1 | 596 |
if (index == frames() - 1) { |
13391
30245956af37
7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents:
13195
diff
changeset
|
597 |
Deoptimization::unwind_callee_save_values(elem->iframe(), this); |
1 | 598 |
} |
15943
d830a939d985
8009761: Deoptimization on sparc doesn't set Llast_SP correctly in the interpreter frames it creates
roland
parents:
15475
diff
changeset
|
599 |
caller_frame = elem->iframe(); |
9636
363ca5579aff
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
7913
diff
changeset
|
600 |
caller_actual_parameters = callee_parameters; |
1 | 601 |
} |
602 |
deallocate_monitor_chunks(); |
|
603 |
} |
|
604 |
||
605 |
void vframeArray::deallocate_monitor_chunks() { |
|
606 |
JavaThread* jt = JavaThread::current(); |
|
607 |
for (int index = 0; index < frames(); index++ ) { |
|
608 |
element(index)->free_monitors(jt); |
|
609 |
} |
|
610 |
} |
|
611 |
||
612 |
#ifndef PRODUCT |
|
613 |
||
614 |
bool vframeArray::structural_compare(JavaThread* thread, GrowableArray<compiledVFrame*>* chunk) { |
|
615 |
if (owner_thread() != thread) return false; |
|
616 |
int index = 0; |
|
617 |
#if 0 // FIXME can't do this comparison |
|
618 |
||
619 |
// Compare only within vframe array. |
|
620 |
for (deoptimizedVFrame* vf = deoptimizedVFrame::cast(vframe_at(first_index())); vf; vf = vf->deoptimized_sender_or_null()) { |
|
621 |
if (index >= chunk->length() || !vf->structural_compare(chunk->at(index))) return false; |
|
622 |
index++; |
|
623 |
} |
|
624 |
if (index != chunk->length()) return false; |
|
625 |
#endif |
|
626 |
||
627 |
return true; |
|
628 |
} |
|
629 |
||
630 |
#endif |
|
631 |
||
632 |
address vframeArray::register_location(int i) const { |
|
633 |
assert(0 <= i && i < RegisterMap::reg_count, "index out of bounds"); |
|
634 |
return (address) & _callee_registers[i]; |
|
635 |
} |
|
636 |
||
637 |
||
638 |
#ifndef PRODUCT |
|
639 |
||
640 |
// Printing |
|
641 |
||
642 |
// Note: we cannot have print_on as const, as we allocate inside the method |
|
643 |
void vframeArray::print_on_2(outputStream* st) { |
|
33148
68fa8b6c4340
8042893: compiler: PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC needs to be removed from source files
david
parents:
28039
diff
changeset
|
644 |
st->print_cr(" - sp: " INTPTR_FORMAT, p2i(sp())); |
1 | 645 |
st->print(" - thread: "); |
646 |
Thread::current()->print(); |
|
647 |
st->print_cr(" - frame size: %d", frame_size()); |
|
648 |
for (int index = 0; index < frames() ; index++ ) { |
|
649 |
element(index)->print(st); |
|
650 |
} |
|
651 |
} |
|
652 |
||
653 |
void vframeArrayElement::print(outputStream* st) { |
|
33148
68fa8b6c4340
8042893: compiler: PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC needs to be removed from source files
david
parents:
28039
diff
changeset
|
654 |
st->print_cr(" - interpreter_frame -> sp: " INTPTR_FORMAT, p2i(iframe()->sp())); |
1 | 655 |
} |
656 |
||
657 |
void vframeArray::print_value_on(outputStream* st) const { |
|
658 |
st->print_cr("vframeArray [%d] ", frames()); |
|
659 |
} |
|
660 |
||
661 |
||
662 |
#endif |