Mercurial > hg > truffle
annotate src/share/vm/runtime/vframeArray.cpp @ 3238:0478ad72d214
Fixed a () type bug in the negate canonicalizer.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 27 Jul 2011 14:17:00 -0700 |
parents | 5ca1332171c8 |
children | be4ca325525a |
rev | line source |
---|---|
0 | 1 /* |
2142 | 2 * Copyright (c) 1997, 2011, 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" | |
3153
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
27 #include "code/scopeDesc.hpp" |
1972 | 28 #include "interpreter/interpreter.hpp" |
29 #include "memory/allocation.inline.hpp" | |
30 #include "memory/resourceArea.hpp" | |
31 #include "memory/universe.inline.hpp" | |
32 #include "oops/methodDataOop.hpp" | |
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 |
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 | |
58 void vframeArrayElement::fill_in(compiledVFrame* vf) { | |
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(); | |
900
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
818
diff
changeset
|
65 _reexecute = vf->should_reexecute(); |
3153
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
66 |
0 | 67 int index; |
68 | |
69 // Get the monitors off-stack | |
70 | |
71 GrowableArray<MonitorInfo*>* list = vf->monitors(); | |
72 if (list->is_empty()) { | |
73 _monitors = NULL; | |
74 } else { | |
75 | |
76 // Allocate monitor chunk | |
77 _monitors = new MonitorChunk(list->length()); | |
78 vf->thread()->add_monitor_chunk(_monitors); | |
79 | |
80 // Migrate the BasicLocks from the stack to the monitor chunk | |
81 for (index = 0; index < list->length(); index++) { | |
82 MonitorInfo* monitor = list->at(index); | |
818
b109e761e927
6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents:
0
diff
changeset
|
83 assert(!monitor->owner_is_scalar_replaced(), "object should be reallocated already"); |
0 | 84 assert(monitor->owner() == NULL || (!monitor->owner()->is_unlocked() && !monitor->owner()->has_bias_pattern()), "object must be null or locked, and unbiased"); |
85 BasicObjectLock* dest = _monitors->at(index); | |
86 dest->set_obj(monitor->owner()); | |
87 monitor->lock()->move_to(monitor->owner(), dest->lock()); | |
88 } | |
89 } | |
90 | |
91 // Convert the vframe locals and expressions to off stack | |
92 // values. Because we will not gc all oops can be converted to | |
93 // intptr_t (i.e. a stack slot) and we are fine. This is | |
94 // good since we are inside a HandleMark and the oops in our | |
95 // collection would go away between packing them here and | |
96 // unpacking them in unpack_on_stack. | |
97 | |
98 // First the locals go off-stack | |
99 | |
100 // FIXME this seems silly it creates a StackValueCollection | |
101 // in order to get the size to then copy them and | |
102 // convert the types to intptr_t size slots. Seems like it | |
103 // could do it in place... Still uses less memory than the | |
104 // old way though | |
105 | |
106 StackValueCollection *locs = vf->locals(); | |
107 _locals = new StackValueCollection(locs->size()); | |
108 for(index = 0; index < locs->size(); index++) { | |
109 StackValue* value = locs->at(index); | |
110 switch(value->type()) { | |
111 case T_OBJECT: | |
818
b109e761e927
6837472: com/sun/jdi/MonitorFrameInfo.java fails with AggressiveOpts in 6u14
kvn
parents:
0
diff
changeset
|
112 assert(!value->obj_is_scalar_replaced(), "object should be reallocated already"); |
0 | 113 // preserve object type |
114 _locals->add( new StackValue((intptr_t) (value->get_obj()()), T_OBJECT )); | |
115 break; | |
116 case T_CONFLICT: | |
117 // A dead local. Will be initialized to null/zero. | |
118 _locals->add( new StackValue()); | |
119 break; | |
120 case T_INT: | |
121 _locals->add( new StackValue(value->get_int())); | |
122 break; | |
123 default: | |
124 ShouldNotReachHere(); | |
125 } | |
126 } | |
127 | |
128 // Now the expressions off-stack | |
129 // Same silliness as above | |
3153
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
130 bool rethrow_exception = vf->scope()->rethrow_exception(); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
131 if (rethrow_exception) { |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
132 // (tw) Make sure there are only null pointers on the stack, because the stack values do not correspond to the GC map at the bytecode at which the exception is rethrown. |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
133 _expressions = new StackValueCollection(vf->method()->max_stack()); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
134 assert(Thread::current()->has_pending_exception(), "just checking"); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
135 for (int i=0; i<vf->method()->max_stack(); ++i) { |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
136 _expressions->add( new StackValue()); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
137 } |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
138 } else { |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
139 StackValueCollection *exprs = vf->expressions(); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
140 _expressions = new StackValueCollection(exprs->size()); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
141 for(index = 0; index < exprs->size(); index++) { |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
142 StackValue* value = exprs->at(index); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
143 switch(value->type()) { |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
144 case T_OBJECT: |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
145 assert(!value->obj_is_scalar_replaced(), "object should be reallocated already"); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
146 // preserve object type |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
147 _expressions->add( new StackValue((intptr_t) (value->get_obj()()), T_OBJECT )); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
148 break; |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
149 case T_CONFLICT: |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
150 // A dead stack element. Will be initialized to null/zero. |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
151 // This can occur when the compiler emits a state in which stack |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
152 // elements are known to be dead (because of an imminent exception). |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
153 _expressions->add( new StackValue()); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
154 break; |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
155 case T_INT: |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
156 _expressions->add( new StackValue(value->get_int())); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
157 break; |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
158 default: |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
159 ShouldNotReachHere(); |
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
160 } |
0 | 161 } |
162 } | |
163 } | |
164 | |
165 int unpack_counter = 0; | |
166 | |
167 void vframeArrayElement::unpack_on_stack(int callee_parameters, | |
168 int callee_locals, | |
169 frame* caller, | |
170 bool is_top_frame, | |
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; | |
900
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
818
diff
changeset
|
179 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
|
180 // rather than the one associated with bcp |
0 | 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 | |
900
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
818
diff
changeset
|
185 } else if (should_reexecute()) { //reexecute this bytecode |
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
818
diff
changeset
|
186 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
|
187 bcp = method()->bcp_from(bci()); |
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
818
diff
changeset
|
188 pc = Interpreter::deopt_reexecute_entry(method(), bcp); |
0 | 189 } else { |
190 bcp = method()->bcp_from(bci()); | |
900
9987d9d5eb0e
6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents:
818
diff
changeset
|
191 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
|
192 use_next_mdp = true; |
0 | 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"); | |
1814
fd5d4527cdf5
6986270: guarantee(*bcp != Bytecodes::_monitorenter || exec_mode != Deoptimization::Unpack_exception) fails
iveresov
parents:
1603
diff
changeset
|
209 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
|
210 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
|
211 *bcp == Bytecodes::_monitorenter && |
fd5d4527cdf5
6986270: guarantee(*bcp != Bytecodes::_monitorenter || exec_mode != Deoptimization::Unpack_exception) fails
iveresov
parents:
1603
diff
changeset
|
212 exec_mode == Deoptimization::Unpack_exception), |
fd5d4527cdf5
6986270: guarantee(*bcp != Bytecodes::_monitorenter || exec_mode != Deoptimization::Unpack_exception) fails
iveresov
parents:
1603
diff
changeset
|
213 "shouldn't get exception during monitorenter"); |
0 | 214 |
215 int popframe_preserved_args_size_in_bytes = 0; | |
216 int popframe_preserved_args_size_in_words = 0; | |
217 if (is_top_frame) { | |
1255
e3a4305c6bc3
6925249: assert(last_sp < (intptr_t*) interpreter_frame_monitor_begin(),"bad tos")
kvn
parents:
903
diff
changeset
|
218 JvmtiThreadState *state = thread->jvmti_thread_state(); |
0 | 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 #else | |
245 // TBD: Need to implement ForceEarlyReturn for CC_INTERP (ia64) | |
246 #endif | |
247 } else { | |
248 // Possibly override the previous pc computation of the top (youngest) frame | |
249 switch (exec_mode) { | |
250 case Deoptimization::Unpack_deopt: | |
251 // use what we've got | |
252 break; | |
253 case Deoptimization::Unpack_exception: | |
254 // exception is pending | |
1295 | 255 pc = SharedRuntime::raw_exception_handler_for_return_address(thread, pc); |
0 | 256 // [phh] We're going to end up in some handler or other, so it doesn't |
257 // matter what mdp we point to. See exception_handler_for_exception() | |
258 // in interpreterRuntime.cpp. | |
259 break; | |
260 case Deoptimization::Unpack_uncommon_trap: | |
261 case Deoptimization::Unpack_reexecute: | |
262 // redo last byte code | |
263 pc = Interpreter::deopt_entry(vtos, 0); | |
264 use_next_mdp = false; | |
265 break; | |
266 default: | |
267 ShouldNotReachHere(); | |
268 } | |
269 } | |
270 } | |
271 | |
272 // Setup the interpreter frame | |
273 | |
274 assert(method() != NULL, "method must exist"); | |
275 int temps = expressions()->size(); | |
276 | |
277 int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors(); | |
278 | |
279 Interpreter::layout_activation(method(), | |
280 temps + callee_parameters, | |
281 popframe_preserved_args_size_in_words, | |
282 locks, | |
283 callee_parameters, | |
284 callee_locals, | |
285 caller, | |
286 iframe(), | |
287 is_top_frame); | |
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 | |
295 assert (!method()->is_synchronized() || locks > 0, "synchronized methods must have monitors"); | |
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) { | |
305 iframe()->interpreter_frame_set_mdx(0); // clear out the mdp. | |
306 } | |
307 iframe()->interpreter_frame_set_bcx((intptr_t)bcp); // cannot use bcp because frame is not initialized yet | |
308 if (ProfileInterpreter) { | |
309 methodDataOop mdo = method()->method_data(); | |
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 } | |
2607
008adfd6d850
Fixed the stateBefore of invokes and monitorenter instructions to include the arguments of the instruction.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2181
diff
changeset
|
317 |
008adfd6d850
Fixed the stateBefore of invokes and monitorenter instructions to include the arguments of the instruction.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2181
diff
changeset
|
318 if (TraceDeoptimization) { |
008adfd6d850
Fixed the stateBefore of invokes and monitorenter instructions to include the arguments of the instruction.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2181
diff
changeset
|
319 tty->print_cr("Expressions size: %d", expressions()->size()); |
008adfd6d850
Fixed the stateBefore of invokes and monitorenter instructions to include the arguments of the instruction.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2181
diff
changeset
|
320 } |
0 | 321 |
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. | |
3153
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
327 for(int i = 0; i < expressions()->size(); i++) { |
0 | 328 StackValue *value = expressions()->at(i); |
329 intptr_t* addr = iframe()->interpreter_frame_expression_stack_at(i); | |
330 switch(value->type()) { | |
331 case T_INT: | |
332 *addr = value->get_int(); | |
1936
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
333 #ifndef PRODUCT |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
334 if (TraceDeoptimization) { |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
335 tty->print_cr("Reconstructed expression %d (INT): %d", i, (int)(*addr)); |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
336 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
337 #endif |
0 | 338 break; |
339 case T_OBJECT: | |
340 *addr = value->get_int(T_OBJECT); | |
1936
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
341 #ifndef PRODUCT |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
342 if (TraceDeoptimization) { |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
343 tty->print("Reconstructed expression %d (OBJECT): ", i); |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
344 oop o = (oop)(*addr); |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
345 if (o == NULL) { |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
346 tty->print_cr("NULL"); |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
347 } else { |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
348 tty->print_cr(err_msg("%s", o->blueprint()->name()->as_C_string())); |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
349 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
350 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
351 #endif |
0 | 352 break; |
353 case T_CONFLICT: | |
354 // A dead stack slot. Initialize to null in case it is an oop. | |
355 *addr = NULL_WORD; | |
356 break; | |
357 default: | |
358 ShouldNotReachHere(); | |
359 } | |
360 } | |
361 | |
362 | |
363 // Unpack the locals | |
3153
5ca1332171c8
Fixed an issue in the HotSpot code for rethrowing an exception at deopt (wrong values on the expression stack caused a crash when GC and deopt happened at the same time).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2607
diff
changeset
|
364 for(int i = 0; i < locals()->size(); i++) { |
0 | 365 StackValue *value = locals()->at(i); |
366 intptr_t* addr = iframe()->interpreter_frame_local_at(i); | |
367 switch(value->type()) { | |
368 case T_INT: | |
369 *addr = value->get_int(); | |
1936
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
370 #ifndef PRODUCT |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
371 if (TraceDeoptimization) { |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
372 tty->print_cr("Reconstructed local %d (INT): %d", i, (int)(*addr)); |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
373 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
374 #endif |
0 | 375 break; |
376 case T_OBJECT: | |
377 *addr = value->get_int(T_OBJECT); | |
1936
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
378 #ifndef PRODUCT |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
379 if (TraceDeoptimization) { |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
380 tty->print("Reconstructed local %d (OBJECT): ", i); |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
381 oop o = (oop)(*addr); |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
382 if (o == NULL) { |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
383 tty->print_cr("NULL"); |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
384 } else { |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
385 tty->print_cr(err_msg("%s", o->blueprint()->name()->as_C_string())); |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
386 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
387 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
388 #endif |
0 | 389 break; |
390 case T_CONFLICT: | |
391 // A dead location. If it is an oop then we need a NULL to prevent GC from following it | |
392 *addr = NULL_WORD; | |
393 break; | |
394 default: | |
395 ShouldNotReachHere(); | |
396 } | |
397 } | |
398 | |
399 if (is_top_frame && JvmtiExport::can_pop_frame() && thread->popframe_forcing_deopt_reexecution()) { | |
400 // An interpreted frame was popped but it returns to a deoptimized | |
401 // frame. The incoming arguments to the interpreted activation | |
402 // were preserved in thread-local storage by the | |
403 // remove_activation_preserving_args_entry in the interpreter; now | |
404 // we put them back into the just-unpacked interpreter frame. | |
405 // Note that this assumes that the locals arena grows toward lower | |
406 // addresses. | |
407 if (popframe_preserved_args_size_in_words != 0) { | |
408 void* saved_args = thread->popframe_preserved_args(); | |
409 assert(saved_args != NULL, "must have been saved by interpreter"); | |
410 #ifdef ASSERT | |
411 assert(popframe_preserved_args_size_in_words <= | |
1506 | 412 iframe()->interpreter_frame_expression_stack_size()*Interpreter::stackElementWords, |
0 | 413 "expression stack size should have been extended"); |
414 #endif // ASSERT | |
415 int top_element = iframe()->interpreter_frame_expression_stack_size()-1; | |
416 intptr_t* base; | |
417 if (frame::interpreter_frame_expression_stack_direction() < 0) { | |
418 base = iframe()->interpreter_frame_expression_stack_at(top_element); | |
419 } else { | |
420 base = iframe()->interpreter_frame_expression_stack(); | |
421 } | |
1603
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
422 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
|
423 base, |
d93949c5bdcc
6730276: JDI_REGRESSION tests fail with "Error: count must be non-zero" error on x86
kvn
parents:
1552
diff
changeset
|
424 popframe_preserved_args_size_in_bytes); |
0 | 425 thread->popframe_free_preserved_args(); |
426 } | |
427 } | |
428 | |
429 #ifndef PRODUCT | |
430 if (TraceDeoptimization && Verbose) { | |
431 ttyLocker ttyl; | |
432 tty->print_cr("[%d Interpreted Frame]", ++unpack_counter); | |
433 iframe()->print_on(tty); | |
434 RegisterMap map(thread); | |
435 vframe* f = vframe::new_vframe(iframe(), &map, thread); | |
436 f->print(); | |
437 | |
438 tty->print_cr("locals size %d", locals()->size()); | |
439 tty->print_cr("expression size %d", expressions()->size()); | |
440 | |
441 method()->print_value(); | |
442 tty->cr(); | |
443 // method()->print_codes(); | |
444 } else if (TraceDeoptimization) { | |
445 tty->print(" "); | |
446 method()->print_value(); | |
2142 | 447 Bytecodes::Code code = Bytecodes::java_code_at(method(), bcp); |
0 | 448 int bci = method()->bci_from(bcp); |
449 tty->print(" - %s", Bytecodes::name(code)); | |
450 tty->print(" @ bci %d ", bci); | |
451 tty->print_cr("sp = " PTR_FORMAT, iframe()->sp()); | |
452 } | |
453 #endif // PRODUCT | |
454 | |
455 // The expression stack and locals are in the resource area don't leave | |
456 // a dangling pointer in the vframeArray we leave around for debug | |
457 // purposes | |
458 | |
459 _locals = _expressions = NULL; | |
460 | |
461 } | |
462 | |
463 int vframeArrayElement::on_stack_size(int callee_parameters, | |
464 int callee_locals, | |
465 bool is_top_frame, | |
466 int popframe_extra_stack_expression_els) const { | |
467 assert(method()->max_locals() == locals()->size(), "just checking"); | |
468 int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors(); | |
469 int temps = expressions()->size(); | |
470 return Interpreter::size_activation(method(), | |
471 temps + callee_parameters, | |
472 popframe_extra_stack_expression_els, | |
473 locks, | |
474 callee_parameters, | |
475 callee_locals, | |
476 is_top_frame); | |
477 } | |
478 | |
479 | |
480 | |
481 vframeArray* vframeArray::allocate(JavaThread* thread, int frame_size, GrowableArray<compiledVFrame*>* chunk, | |
482 RegisterMap *reg_map, frame sender, frame caller, frame self) { | |
483 | |
484 // Allocate the vframeArray | |
485 vframeArray * result = (vframeArray*) AllocateHeap(sizeof(vframeArray) + // fixed part | |
486 sizeof(vframeArrayElement) * (chunk->length() - 1), // variable part | |
487 "vframeArray::allocate"); | |
488 result->_frames = chunk->length(); | |
489 result->_owner_thread = thread; | |
490 result->_sender = sender; | |
491 result->_caller = caller; | |
492 result->_original = self; | |
493 result->set_unroll_block(NULL); // initialize it | |
494 result->fill_in(thread, frame_size, chunk, reg_map); | |
495 return result; | |
496 } | |
497 | |
498 void vframeArray::fill_in(JavaThread* thread, | |
499 int frame_size, | |
500 GrowableArray<compiledVFrame*>* chunk, | |
501 const RegisterMap *reg_map) { | |
502 // Set owner first, it is used when adding monitor chunks | |
503 | |
504 _frame_size = frame_size; | |
505 for(int i = 0; i < chunk->length(); i++) { | |
506 element(i)->fill_in(chunk->at(i)); | |
507 } | |
508 | |
509 // Copy registers for callee-saved registers | |
510 if (reg_map != NULL) { | |
511 for(int i = 0; i < RegisterMap::reg_count; i++) { | |
512 #ifdef AMD64 | |
513 // The register map has one entry for every int (32-bit value), so | |
514 // 64-bit physical registers have two entries in the map, one for | |
515 // each half. Ignore the high halves of 64-bit registers, just like | |
516 // frame::oopmapreg_to_location does. | |
517 // | |
518 // [phh] FIXME: this is a temporary hack! This code *should* work | |
519 // correctly w/o this hack, possibly by changing RegisterMap::pd_location | |
520 // in frame_amd64.cpp and the values of the phantom high half registers | |
521 // in amd64.ad. | |
522 // if (VMReg::Name(i) < SharedInfo::stack0 && is_even(i)) { | |
523 intptr_t* src = (intptr_t*) reg_map->location(VMRegImpl::as_VMReg(i)); | |
524 _callee_registers[i] = src != NULL ? *src : NULL_WORD; | |
525 // } else { | |
526 // jint* src = (jint*) reg_map->location(VMReg::Name(i)); | |
527 // _callee_registers[i] = src != NULL ? *src : NULL_WORD; | |
528 // } | |
529 #else | |
530 jint* src = (jint*) reg_map->location(VMRegImpl::as_VMReg(i)); | |
531 _callee_registers[i] = src != NULL ? *src : NULL_WORD; | |
532 #endif | |
533 if (src == NULL) { | |
534 set_location_valid(i, false); | |
535 } else { | |
536 set_location_valid(i, true); | |
537 jint* dst = (jint*) register_location(i); | |
538 *dst = *src; | |
539 } | |
540 } | |
541 } | |
542 } | |
543 | |
544 void vframeArray::unpack_to_stack(frame &unpack_frame, int exec_mode) { | |
545 // stack picture | |
546 // unpack_frame | |
547 // [new interpreter frames ] (frames are skeletal but walkable) | |
548 // caller_frame | |
549 // | |
550 // This routine fills in the missing data for the skeletal interpreter frames | |
551 // in the above picture. | |
552 | |
553 // Find the skeletal interpreter frames to unpack into | |
554 RegisterMap map(JavaThread::current(), false); | |
555 // Get the youngest frame we will unpack (last to be unpacked) | |
556 frame me = unpack_frame.sender(&map); | |
557 int index; | |
558 for (index = 0; index < frames(); index++ ) { | |
559 *element(index)->iframe() = me; | |
560 // Get the caller frame (possibly skeletal) | |
561 me = me.sender(&map); | |
562 } | |
563 | |
564 frame caller_frame = me; | |
565 | |
566 // Do the unpacking of interpreter frames; the frame at index 0 represents the top activation, so it has no callee | |
567 | |
568 // Unpack the frames from the oldest (frames() -1) to the youngest (0) | |
569 | |
570 for (index = frames() - 1; index >= 0 ; index--) { | |
571 int callee_parameters = index == 0 ? 0 : element(index-1)->method()->size_of_parameters(); | |
572 int callee_locals = index == 0 ? 0 : element(index-1)->method()->max_locals(); | |
573 element(index)->unpack_on_stack(callee_parameters, | |
574 callee_locals, | |
575 &caller_frame, | |
576 index == 0, | |
577 exec_mode); | |
578 if (index == frames() - 1) { | |
579 Deoptimization::unwind_callee_save_values(element(index)->iframe(), this); | |
580 } | |
581 caller_frame = *element(index)->iframe(); | |
582 } | |
583 | |
584 | |
585 deallocate_monitor_chunks(); | |
586 } | |
587 | |
588 void vframeArray::deallocate_monitor_chunks() { | |
589 JavaThread* jt = JavaThread::current(); | |
590 for (int index = 0; index < frames(); index++ ) { | |
591 element(index)->free_monitors(jt); | |
592 } | |
593 } | |
594 | |
595 #ifndef PRODUCT | |
596 | |
597 bool vframeArray::structural_compare(JavaThread* thread, GrowableArray<compiledVFrame*>* chunk) { | |
598 if (owner_thread() != thread) return false; | |
599 int index = 0; | |
600 #if 0 // FIXME can't do this comparison | |
601 | |
602 // Compare only within vframe array. | |
603 for (deoptimizedVFrame* vf = deoptimizedVFrame::cast(vframe_at(first_index())); vf; vf = vf->deoptimized_sender_or_null()) { | |
604 if (index >= chunk->length() || !vf->structural_compare(chunk->at(index))) return false; | |
605 index++; | |
606 } | |
607 if (index != chunk->length()) return false; | |
608 #endif | |
609 | |
610 return true; | |
611 } | |
612 | |
613 #endif | |
614 | |
615 address vframeArray::register_location(int i) const { | |
616 assert(0 <= i && i < RegisterMap::reg_count, "index out of bounds"); | |
617 return (address) & _callee_registers[i]; | |
618 } | |
619 | |
620 | |
621 #ifndef PRODUCT | |
622 | |
623 // Printing | |
624 | |
625 // Note: we cannot have print_on as const, as we allocate inside the method | |
626 void vframeArray::print_on_2(outputStream* st) { | |
627 st->print_cr(" - sp: " INTPTR_FORMAT, sp()); | |
628 st->print(" - thread: "); | |
629 Thread::current()->print(); | |
630 st->print_cr(" - frame size: %d", frame_size()); | |
631 for (int index = 0; index < frames() ; index++ ) { | |
632 element(index)->print(st); | |
633 } | |
634 } | |
635 | |
636 void vframeArrayElement::print(outputStream* st) { | |
1255
e3a4305c6bc3
6925249: assert(last_sp < (intptr_t*) interpreter_frame_monitor_begin(),"bad tos")
kvn
parents:
903
diff
changeset
|
637 st->print_cr(" - interpreter_frame -> sp: " INTPTR_FORMAT, iframe()->sp()); |
0 | 638 } |
639 | |
640 void vframeArray::print_value_on(outputStream* st) const { | |
641 st->print_cr("vframeArray [%d] ", frames()); | |
642 } | |
643 | |
644 | |
645 #endif |