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