Mercurial > hg > truffle
annotate src/share/vm/runtime/vframeArray.cpp @ 4237:30b6720604d2
Undid expected failure for EscapeAnalysisTest.testMonitor2().
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 06 Jan 2012 15:35:52 +0100 |
parents | be4ca325525a |
children | 3dbcd1013cc8 |
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 | |
3369
3d2ab563047a
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
2142
diff
changeset
|
167 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
|
168 int callee_parameters, |
0 | 169 int callee_locals, |
170 frame* caller, | |
171 bool is_top_frame, | |
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 #else | |
246 // TBD: Need to implement ForceEarlyReturn for CC_INTERP (ia64) | |
247 #endif | |
248 } else { | |
249 // Possibly override the previous pc computation of the top (youngest) frame | |
250 switch (exec_mode) { | |
251 case Deoptimization::Unpack_deopt: | |
252 // use what we've got | |
253 break; | |
254 case Deoptimization::Unpack_exception: | |
255 // exception is pending | |
1295 | 256 pc = SharedRuntime::raw_exception_handler_for_return_address(thread, pc); |
0 | 257 // [phh] We're going to end up in some handler or other, so it doesn't |
258 // matter what mdp we point to. See exception_handler_for_exception() | |
259 // in interpreterRuntime.cpp. | |
260 break; | |
261 case Deoptimization::Unpack_uncommon_trap: | |
262 case Deoptimization::Unpack_reexecute: | |
263 // redo last byte code | |
264 pc = Interpreter::deopt_entry(vtos, 0); | |
265 use_next_mdp = false; | |
266 break; | |
267 default: | |
268 ShouldNotReachHere(); | |
269 } | |
270 } | |
271 } | |
272 | |
273 // Setup the interpreter frame | |
274 | |
275 assert(method() != NULL, "method must exist"); | |
276 int temps = expressions()->size(); | |
277 | |
278 int locks = monitors() == NULL ? 0 : monitors()->number_of_monitors(); | |
279 | |
280 Interpreter::layout_activation(method(), | |
281 temps + callee_parameters, | |
282 popframe_preserved_args_size_in_words, | |
283 locks, | |
3369
3d2ab563047a
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
2142
diff
changeset
|
284 caller_actual_parameters, |
0 | 285 callee_parameters, |
286 callee_locals, | |
287 caller, | |
288 iframe(), | |
289 is_top_frame); | |
290 | |
291 // Update the pc in the frame object and overwrite the temporary pc | |
292 // we placed in the skeletal frame now that we finally know the | |
293 // exact interpreter address we should use. | |
294 | |
295 _frame.patch_pc(thread, pc); | |
296 | |
297 assert (!method()->is_synchronized() || locks > 0, "synchronized methods must have monitors"); | |
298 | |
299 BasicObjectLock* top = iframe()->interpreter_frame_monitor_begin(); | |
300 for (int index = 0; index < locks; index++) { | |
301 top = iframe()->previous_monitor_in_interpreter_frame(top); | |
302 BasicObjectLock* src = _monitors->at(index); | |
303 top->set_obj(src->obj()); | |
304 src->lock()->move_to(src->obj(), top->lock()); | |
305 } | |
306 if (ProfileInterpreter) { | |
307 iframe()->interpreter_frame_set_mdx(0); // clear out the mdp. | |
308 } | |
309 iframe()->interpreter_frame_set_bcx((intptr_t)bcp); // cannot use bcp because frame is not initialized yet | |
310 if (ProfileInterpreter) { | |
311 methodDataOop mdo = method()->method_data(); | |
312 if (mdo != NULL) { | |
313 int bci = iframe()->interpreter_frame_bci(); | |
314 if (use_next_mdp) ++bci; | |
315 address mdp = mdo->bci_to_dp(bci); | |
316 iframe()->interpreter_frame_set_mdp(mdp); | |
317 } | |
318 } | |
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
|
319 |
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 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
|
321 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
|
322 } |
0 | 323 |
324 // Unpack expression stack | |
325 // If this is an intermediate frame (i.e. not top frame) then this | |
326 // only unpacks the part of the expression stack not used by callee | |
327 // as parameters. The callee parameters are unpacked as part of the | |
328 // 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
|
329 for(int i = 0; i < expressions()->size(); i++) { |
0 | 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(); | |
1936
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
335 #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
|
336 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
|
337 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
|
338 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
339 #endif |
0 | 340 break; |
341 case T_OBJECT: | |
342 *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
|
343 #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
|
344 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
|
345 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
|
346 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
|
347 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
|
348 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
|
349 } else { |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
350 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
|
351 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
352 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
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 | |
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
|
366 for(int i = 0; i < locals()->size(); i++) { |
0 | 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(); | |
1936
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
372 #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
|
373 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
|
374 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
|
375 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
376 #endif |
0 | 377 break; |
378 case T_OBJECT: | |
379 *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
|
380 #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
|
381 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
|
382 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
|
383 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
|
384 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
|
385 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
|
386 } else { |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
387 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
|
388 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
diff
changeset
|
389 } |
8d88c9ac9247
Correct deopt handler entry. New flag -XX:+TraceSignals. More detailed deopt printing.
Thomas Wuerthinger <wuerthinger@ssw.jku.at>
parents:
1814
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 | |
432 if (TraceDeoptimization && Verbose) { | |
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 | |
3369
3d2ab563047a
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
2142
diff
changeset
|
465 int vframeArrayElement::on_stack_size(int caller_actual_parameters, |
3d2ab563047a
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
2142
diff
changeset
|
466 int callee_parameters, |
0 | 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(); | |
473 return Interpreter::size_activation(method(), | |
474 temps + callee_parameters, | |
475 popframe_extra_stack_expression_els, | |
476 locks, | |
3369
3d2ab563047a
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
2142
diff
changeset
|
477 caller_actual_parameters, |
0 | 478 callee_parameters, |
479 callee_locals, | |
480 is_top_frame); | |
481 } | |
482 | |
483 | |
484 | |
485 vframeArray* vframeArray::allocate(JavaThread* thread, int frame_size, GrowableArray<compiledVFrame*>* chunk, | |
486 RegisterMap *reg_map, frame sender, frame caller, frame self) { | |
487 | |
488 // Allocate the vframeArray | |
489 vframeArray * result = (vframeArray*) AllocateHeap(sizeof(vframeArray) + // fixed part | |
490 sizeof(vframeArrayElement) * (chunk->length() - 1), // variable part | |
491 "vframeArray::allocate"); | |
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 | |
498 result->fill_in(thread, frame_size, chunk, reg_map); | |
499 return result; | |
500 } | |
501 | |
502 void vframeArray::fill_in(JavaThread* thread, | |
503 int frame_size, | |
504 GrowableArray<compiledVFrame*>* chunk, | |
505 const RegisterMap *reg_map) { | |
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++) { | |
510 element(i)->fill_in(chunk->at(i)); | |
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 | |
558 RegisterMap map(JavaThread::current(), false); | |
559 // Get the youngest frame we will unpack (last to be unpacked) | |
560 frame me = unpack_frame.sender(&map); | |
561 int index; | |
562 for (index = 0; index < frames(); index++ ) { | |
563 *element(index)->iframe() = me; | |
564 // Get the caller frame (possibly skeletal) | |
565 me = me.sender(&map); | |
566 } | |
567 | |
568 frame caller_frame = me; | |
569 | |
570 // Do the unpacking of interpreter frames; the frame at index 0 represents the top activation, so it has no callee | |
571 | |
572 // Unpack the frames from the oldest (frames() -1) to the youngest (0) | |
573 | |
574 for (index = frames() - 1; index >= 0 ; index--) { | |
575 int callee_parameters = index == 0 ? 0 : element(index-1)->method()->size_of_parameters(); | |
576 int callee_locals = index == 0 ? 0 : element(index-1)->method()->max_locals(); | |
3369
3d2ab563047a
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
2142
diff
changeset
|
577 element(index)->unpack_on_stack(caller_actual_parameters, |
3d2ab563047a
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
2142
diff
changeset
|
578 callee_parameters, |
0 | 579 callee_locals, |
580 &caller_frame, | |
581 index == 0, | |
582 exec_mode); | |
583 if (index == frames() - 1) { | |
584 Deoptimization::unwind_callee_save_values(element(index)->iframe(), this); | |
585 } | |
586 caller_frame = *element(index)->iframe(); | |
3369
3d2ab563047a
7043461: VM crashes in void LinkResolver::runtime_resolve_virtual_method
never
parents:
2142
diff
changeset
|
587 caller_actual_parameters = callee_parameters; |
0 | 588 } |
589 | |
590 | |
591 deallocate_monitor_chunks(); | |
592 } | |
593 | |
594 void vframeArray::deallocate_monitor_chunks() { | |
595 JavaThread* jt = JavaThread::current(); | |
596 for (int index = 0; index < frames(); index++ ) { | |
597 element(index)->free_monitors(jt); | |
598 } | |
599 } | |
600 | |
601 #ifndef PRODUCT | |
602 | |
603 bool vframeArray::structural_compare(JavaThread* thread, GrowableArray<compiledVFrame*>* chunk) { | |
604 if (owner_thread() != thread) return false; | |
605 int index = 0; | |
606 #if 0 // FIXME can't do this comparison | |
607 | |
608 // Compare only within vframe array. | |
609 for (deoptimizedVFrame* vf = deoptimizedVFrame::cast(vframe_at(first_index())); vf; vf = vf->deoptimized_sender_or_null()) { | |
610 if (index >= chunk->length() || !vf->structural_compare(chunk->at(index))) return false; | |
611 index++; | |
612 } | |
613 if (index != chunk->length()) return false; | |
614 #endif | |
615 | |
616 return true; | |
617 } | |
618 | |
619 #endif | |
620 | |
621 address vframeArray::register_location(int i) const { | |
622 assert(0 <= i && i < RegisterMap::reg_count, "index out of bounds"); | |
623 return (address) & _callee_registers[i]; | |
624 } | |
625 | |
626 | |
627 #ifndef PRODUCT | |
628 | |
629 // Printing | |
630 | |
631 // Note: we cannot have print_on as const, as we allocate inside the method | |
632 void vframeArray::print_on_2(outputStream* st) { | |
633 st->print_cr(" - sp: " INTPTR_FORMAT, sp()); | |
634 st->print(" - thread: "); | |
635 Thread::current()->print(); | |
636 st->print_cr(" - frame size: %d", frame_size()); | |
637 for (int index = 0; index < frames() ; index++ ) { | |
638 element(index)->print(st); | |
639 } | |
640 } | |
641 | |
642 void vframeArrayElement::print(outputStream* st) { | |
1255
e3a4305c6bc3
6925249: assert(last_sp < (intptr_t*) interpreter_frame_monitor_begin(),"bad tos")
kvn
parents:
903
diff
changeset
|
643 st->print_cr(" - interpreter_frame -> sp: " INTPTR_FORMAT, iframe()->sp()); |
0 | 644 } |
645 | |
646 void vframeArray::print_value_on(outputStream* st) const { | |
647 st->print_cr("vframeArray [%d] ", frames()); | |
648 } | |
649 | |
650 | |
651 #endif |