author | vromero |
Mon, 08 Oct 2018 06:52:41 -0700 | |
changeset 52038 | 957de5be48bc |
parent 49658 | 8237a91c1cca |
child 53205 | 8f79bae1a535 |
permissions | -rw-r--r-- |
34253 | 1 |
/* |
49480
d7df2dd501ce
8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents:
47818
diff
changeset
|
2 |
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. |
34253 | 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 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
#include "precompiled.hpp" |
|
26 |
#include "classfile/javaClasses.hpp" |
|
27 |
#include "classfile/javaClasses.inline.hpp" |
|
28 |
#include "classfile/vmSymbols.hpp" |
|
41664
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
29 |
#include "logging/log.hpp" |
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
30 |
#include "logging/logStream.hpp" |
34253 | 31 |
#include "memory/oopFactory.hpp" |
32 |
#include "oops/oop.inline.hpp" |
|
33 |
#include "oops/objArrayOop.inline.hpp" |
|
34 |
#include "prims/stackwalk.hpp" |
|
35 |
#include "runtime/globals.hpp" |
|
36 |
#include "runtime/handles.inline.hpp" |
|
37 |
#include "runtime/javaCalls.hpp" |
|
49480
d7df2dd501ce
8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents:
47818
diff
changeset
|
38 |
#include "runtime/vframe.inline.hpp" |
34253 | 39 |
#include "utilities/globalDefinitions.hpp" |
40 |
||
41 |
// setup and cleanup actions |
|
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
42 |
void BaseFrameStream::setup_magic_on_entry(objArrayHandle frames_array) { |
37438 | 43 |
frames_array->obj_at_put(magic_pos, _thread->threadObj()); |
34253 | 44 |
_anchor = address_value(); |
37438 | 45 |
assert(check_magic(frames_array), "invalid magic"); |
34253 | 46 |
} |
47 |
||
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
48 |
bool BaseFrameStream::check_magic(objArrayHandle frames_array) { |
37438 | 49 |
oop m1 = frames_array->obj_at(magic_pos); |
34253 | 50 |
jlong m2 = _anchor; |
49658 | 51 |
if (oopDesc::equals(m1, _thread->threadObj()) && m2 == address_value()) return true; |
34253 | 52 |
return false; |
53 |
} |
|
54 |
||
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
55 |
bool BaseFrameStream::cleanup_magic_on_exit(objArrayHandle frames_array) { |
37438 | 56 |
bool ok = check_magic(frames_array); |
57 |
frames_array->obj_at_put(magic_pos, NULL); |
|
34253 | 58 |
_anchor = 0L; |
59 |
return ok; |
|
60 |
} |
|
61 |
||
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
62 |
JavaFrameStream::JavaFrameStream(JavaThread* thread, int mode) |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
63 |
: BaseFrameStream(thread), _vfst(thread) { |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
64 |
_need_method_info = StackWalk::need_method_info(mode); |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
65 |
} |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
66 |
|
49480
d7df2dd501ce
8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents:
47818
diff
changeset
|
67 |
void JavaFrameStream::next() { _vfst.next();} |
d7df2dd501ce
8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents:
47818
diff
changeset
|
68 |
|
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
69 |
// Returns the BaseFrameStream for the current stack being traversed. |
34253 | 70 |
// |
71 |
// Parameters: |
|
72 |
// thread Current Java thread. |
|
73 |
// magic Magic value used for each stack walking |
|
37438 | 74 |
// frames_array User-supplied buffers. The 0th element is reserved |
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
75 |
// for this BaseFrameStream to use |
34253 | 76 |
// |
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
77 |
BaseFrameStream* BaseFrameStream::from_current(JavaThread* thread, jlong magic, |
37438 | 78 |
objArrayHandle frames_array) |
34253 | 79 |
{ |
80 |
assert(thread != NULL && thread->is_Java_thread(), ""); |
|
37438 | 81 |
oop m1 = frames_array->obj_at(magic_pos); |
49658 | 82 |
if (!oopDesc::equals(m1, thread->threadObj())) return NULL; |
34253 | 83 |
if (magic == 0L) return NULL; |
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
84 |
BaseFrameStream* stream = (BaseFrameStream*) (intptr_t) magic; |
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
85 |
if (!stream->is_valid_in(thread, frames_array)) return NULL; |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
86 |
return stream; |
34253 | 87 |
} |
88 |
||
89 |
// Unpacks one or more frames into user-supplied buffers. |
|
90 |
// Updates the end index, and returns the number of unpacked frames. |
|
91 |
// Always start with the existing vfst.method and bci. |
|
92 |
// Do not call vfst.next to advance over the last returned value. |
|
93 |
// In other words, do not leave any stale data in the vfst. |
|
94 |
// |
|
95 |
// Parameters: |
|
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
96 |
// mode Restrict which frames to be decoded. |
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
97 |
// BaseFrameStream stream of frames |
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
98 |
// max_nframes Maximum number of frames to be filled. |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
99 |
// start_index Start index to the user-supplied buffers. |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
100 |
// frames_array Buffer to store Class or StackFrame in, starting at start_index. |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
101 |
// frames array is a Class<?>[] array when only getting caller |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
102 |
// reference, and a StackFrameInfo[] array (or derivative) |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
103 |
// otherwise. It should never be null. |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
104 |
// end_index End index to the user-supplied buffers with unpacked frames. |
34253 | 105 |
// |
106 |
// Returns the number of frames whose information was transferred into the buffers. |
|
107 |
// |
|
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
108 |
int StackWalk::fill_in_frames(jlong mode, BaseFrameStream& stream, |
34253 | 109 |
int max_nframes, int start_index, |
110 |
objArrayHandle frames_array, |
|
111 |
int& end_index, TRAPS) { |
|
41664
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
112 |
log_debug(stackwalk)("fill_in_frames limit=%d start=%d frames length=%d", |
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
113 |
max_nframes, start_index, frames_array->length()); |
34253 | 114 |
assert(max_nframes > 0, "invalid max_nframes"); |
37438 | 115 |
assert(start_index + max_nframes <= frames_array->length(), "oob"); |
34253 | 116 |
|
117 |
int frames_decoded = 0; |
|
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
118 |
for (; !stream.at_end(); stream.next()) { |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
119 |
Method* method = stream.method(); |
34253 | 120 |
|
121 |
if (method == NULL) continue; |
|
41095
97cca074c2be
8157464: Disallow StackWalker.getCallerClass() be called by caller-sensitive method
mchung
parents:
40001
diff
changeset
|
122 |
|
97cca074c2be
8157464: Disallow StackWalker.getCallerClass() be called by caller-sensitive method
mchung
parents:
40001
diff
changeset
|
123 |
// skip hidden frames for default StackWalker option (i.e. SHOW_HIDDEN_FRAMES |
97cca074c2be
8157464: Disallow StackWalker.getCallerClass() be called by caller-sensitive method
mchung
parents:
40001
diff
changeset
|
124 |
// not set) and when StackWalker::getCallerClass is called |
97cca074c2be
8157464: Disallow StackWalker.getCallerClass() be called by caller-sensitive method
mchung
parents:
40001
diff
changeset
|
125 |
if (!ShowHiddenFrames && (skip_hidden_frames(mode) || get_caller_class(mode))) { |
34253 | 126 |
if (method->is_hidden()) { |
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
127 |
LogTarget(Debug, stackwalk) lt; |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
128 |
if (lt.is_enabled()) { |
41664
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
129 |
ResourceMark rm(THREAD); |
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
130 |
LogStream ls(lt); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
131 |
ls.print(" hidden method: "); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
132 |
method->print_short_name(&ls); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
133 |
ls.cr(); |
34253 | 134 |
} |
135 |
continue; |
|
136 |
} |
|
137 |
} |
|
138 |
||
139 |
int index = end_index++; |
|
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
140 |
LogTarget(Debug, stackwalk) lt; |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
141 |
if (lt.is_enabled()) { |
41664
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
142 |
ResourceMark rm(THREAD); |
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
143 |
LogStream ls(lt); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
144 |
ls.print(" %d: frame method: ", index); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
145 |
method->print_short_name(&ls); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
146 |
ls.print_cr(" bci=%d", stream.bci()); |
34253 | 147 |
} |
148 |
||
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
149 |
if (!need_method_info(mode) && get_caller_class(mode) && |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
150 |
index == start_index && method->caller_sensitive()) { |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
151 |
ResourceMark rm(THREAD); |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
152 |
THROW_MSG_0(vmSymbols::java_lang_UnsupportedOperationException(), |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
153 |
err_msg("StackWalker::getCallerClass called from @CallerSensitive %s method", |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
154 |
method->name_and_sig_as_C_string())); |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
155 |
} |
34253 | 156 |
// fill in StackFrameInfo and initialize MemberName |
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
157 |
stream.fill_frame(index, frames_array, method, CHECK_0); |
34253 | 158 |
if (++frames_decoded >= max_nframes) break; |
159 |
} |
|
160 |
return frames_decoded; |
|
161 |
} |
|
162 |
||
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
163 |
// Fill in the LiveStackFrameInfo at the given index in frames_array |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
164 |
void LiveFrameStream::fill_frame(int index, objArrayHandle frames_array, |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
165 |
const methodHandle& method, TRAPS) { |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
166 |
Handle stackFrame(THREAD, frames_array->obj_at(index)); |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
167 |
fill_live_stackframe(stackFrame, method, CHECK); |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
168 |
} |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
169 |
|
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
170 |
// Fill in the StackFrameInfo at the given index in frames_array |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
171 |
void JavaFrameStream::fill_frame(int index, objArrayHandle frames_array, |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
172 |
const methodHandle& method, TRAPS) { |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
173 |
if (_need_method_info) { |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
174 |
Handle stackFrame(THREAD, frames_array->obj_at(index)); |
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46329
diff
changeset
|
175 |
fill_stackframe(stackFrame, method, CHECK); |
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
176 |
} else { |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
177 |
frames_array->obj_at_put(index, method->method_holder()->java_mirror()); |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
178 |
} |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
179 |
} |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
180 |
|
43677
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
181 |
// Create and return a LiveStackFrame.PrimitiveSlot (if needed) for the |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
182 |
// StackValue at the given index. 'type' is expected to be T_INT, T_LONG, |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
183 |
// T_OBJECT, or T_CONFLICT. |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
184 |
oop LiveFrameStream::create_primitive_slot_instance(StackValueCollection* values, |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
185 |
int i, BasicType type, TRAPS) { |
34253 | 186 |
Klass* k = SystemDictionary::resolve_or_null(vmSymbols::java_lang_LiveStackFrameInfo(), CHECK_NULL); |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
46289
diff
changeset
|
187 |
InstanceKlass* ik = InstanceKlass::cast(k); |
34253 | 188 |
|
189 |
JavaValue result(T_OBJECT); |
|
190 |
JavaCallArguments args; |
|
191 |
Symbol* signature = NULL; |
|
192 |
||
193 |
// ## TODO: type is only available in LocalVariable table, if present. |
|
43677
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
194 |
// ## StackValue type is T_INT or T_OBJECT (or converted to T_LONG on 64-bit) |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
195 |
switch (type) { |
34253 | 196 |
case T_INT: |
197 |
args.push_int(values->int_at(i)); |
|
198 |
signature = vmSymbols::asPrimitive_int_signature(); |
|
199 |
break; |
|
200 |
||
201 |
case T_LONG: |
|
202 |
args.push_long(values->long_at(i)); |
|
203 |
signature = vmSymbols::asPrimitive_long_signature(); |
|
204 |
break; |
|
205 |
||
206 |
case T_FLOAT: |
|
207 |
case T_DOUBLE: |
|
208 |
case T_BYTE: |
|
209 |
case T_SHORT: |
|
210 |
case T_CHAR: |
|
211 |
case T_BOOLEAN: |
|
43677
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
212 |
THROW_MSG_(vmSymbols::java_lang_InternalError(), "Unexpected StackValue type", NULL); |
34253 | 213 |
|
214 |
case T_OBJECT: |
|
215 |
return values->obj_at(i)(); |
|
216 |
||
217 |
case T_CONFLICT: |
|
218 |
// put a non-null slot |
|
43677
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
219 |
#ifdef _LP64 |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
220 |
args.push_long(0); |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
221 |
signature = vmSymbols::asPrimitive_long_signature(); |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
222 |
#else |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
223 |
args.push_int(0); |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
224 |
signature = vmSymbols::asPrimitive_int_signature(); |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
225 |
#endif |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
226 |
|
34253 | 227 |
break; |
228 |
||
229 |
default: ShouldNotReachHere(); |
|
230 |
} |
|
231 |
JavaCalls::call_static(&result, |
|
232 |
ik, |
|
233 |
vmSymbols::asPrimitive_name(), |
|
234 |
signature, |
|
235 |
&args, |
|
236 |
CHECK_NULL); |
|
237 |
return (instanceOop) result.get_jobject(); |
|
238 |
} |
|
239 |
||
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
240 |
objArrayHandle LiveFrameStream::values_to_object_array(StackValueCollection* values, TRAPS) { |
34253 | 241 |
objArrayHandle empty; |
242 |
int length = values->size(); |
|
243 |
objArrayOop array_oop = oopFactory::new_objArray(SystemDictionary::Object_klass(), |
|
244 |
length, CHECK_(empty)); |
|
245 |
objArrayHandle array_h(THREAD, array_oop); |
|
246 |
for (int i = 0; i < values->size(); i++) { |
|
247 |
StackValue* st = values->at(i); |
|
43677
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
248 |
BasicType type = st->type(); |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
249 |
int index = i; |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
250 |
#ifdef _LP64 |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
251 |
if (type != T_OBJECT && type != T_CONFLICT) { |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
252 |
intptr_t ret = st->get_int(); // read full 64-bit slot |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
253 |
type = T_LONG; // treat as long |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
254 |
index--; // undo +1 in StackValueCollection::long_at |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
255 |
} |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
256 |
#endif |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
257 |
oop obj = create_primitive_slot_instance(values, index, type, CHECK_(empty)); |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
258 |
if (obj != NULL) { |
34253 | 259 |
array_h->obj_at_put(i, obj); |
43677
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
260 |
} |
34253 | 261 |
} |
262 |
return array_h; |
|
263 |
} |
|
264 |
||
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
265 |
objArrayHandle LiveFrameStream::monitors_to_object_array(GrowableArray<MonitorInfo*>* monitors, TRAPS) { |
34253 | 266 |
int length = monitors->length(); |
267 |
objArrayOop array_oop = oopFactory::new_objArray(SystemDictionary::Object_klass(), |
|
268 |
length, CHECK_(objArrayHandle())); |
|
269 |
objArrayHandle array_h(THREAD, array_oop); |
|
270 |
for (int i = 0; i < length; i++) { |
|
271 |
MonitorInfo* monitor = monitors->at(i); |
|
272 |
array_h->obj_at_put(i, monitor->owner()); |
|
273 |
} |
|
274 |
return array_h; |
|
275 |
} |
|
276 |
||
47818
2f6ab27efb60
8185925: StackFrameInfo::walker field can be replaced with bitmap to save footprint
bchristi
parents:
47216
diff
changeset
|
277 |
// Fill StackFrameInfo with bci and initialize memberName |
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46329
diff
changeset
|
278 |
void BaseFrameStream::fill_stackframe(Handle stackFrame, const methodHandle& method, TRAPS) { |
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46329
diff
changeset
|
279 |
java_lang_StackFrameInfo::set_method_and_bci(stackFrame, method, bci(), THREAD); |
34253 | 280 |
} |
281 |
||
282 |
// Fill LiveStackFrameInfo with locals, monitors, and expressions |
|
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
283 |
void LiveFrameStream::fill_live_stackframe(Handle stackFrame, |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
284 |
const methodHandle& method, TRAPS) { |
46505
fd4bc78630b1
8174749: Use hash table/oops for MemberName table
coleenp
parents:
46329
diff
changeset
|
285 |
fill_stackframe(stackFrame, method, CHECK); |
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
286 |
if (_jvf != NULL) { |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
287 |
StackValueCollection* locals = _jvf->locals(); |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
288 |
StackValueCollection* expressions = _jvf->expressions(); |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
289 |
GrowableArray<MonitorInfo*>* monitors = _jvf->monitors(); |
34253 | 290 |
|
43677
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
291 |
int mode = 0; |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
292 |
if (_jvf->is_interpreted_frame()) { |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
293 |
mode = MODE_INTERPRETED; |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
294 |
} else if (_jvf->is_compiled_frame()) { |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
295 |
mode = MODE_COMPILED; |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
296 |
} |
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
297 |
|
34253 | 298 |
if (!locals->is_empty()) { |
299 |
objArrayHandle locals_h = values_to_object_array(locals, CHECK); |
|
300 |
java_lang_LiveStackFrameInfo::set_locals(stackFrame(), locals_h()); |
|
301 |
} |
|
302 |
if (!expressions->is_empty()) { |
|
303 |
objArrayHandle expressions_h = values_to_object_array(expressions, CHECK); |
|
304 |
java_lang_LiveStackFrameInfo::set_operands(stackFrame(), expressions_h()); |
|
305 |
} |
|
306 |
if (monitors->length() > 0) { |
|
307 |
objArrayHandle monitors_h = monitors_to_object_array(monitors, CHECK); |
|
308 |
java_lang_LiveStackFrameInfo::set_monitors(stackFrame(), monitors_h()); |
|
309 |
} |
|
43677
5228814c1da2
8156073: 2-slot LiveStackFrame locals (long and double) are incorrect
bchristi
parents:
41664
diff
changeset
|
310 |
java_lang_LiveStackFrameInfo::set_mode(stackFrame(), mode); |
34253 | 311 |
} |
312 |
} |
|
313 |
||
314 |
// Begins stack walking. |
|
315 |
// |
|
316 |
// Parameters: |
|
317 |
// stackStream StackStream object |
|
318 |
// mode Stack walking mode. |
|
319 |
// skip_frames Number of frames to be skipped. |
|
320 |
// frame_count Number of frames to be traversed. |
|
321 |
// start_index Start index to the user-supplied buffers. |
|
322 |
// frames_array Buffer to store StackFrame in, starting at start_index. |
|
37438 | 323 |
// frames array is a Class<?>[] array when only getting caller |
324 |
// reference, and a StackFrameInfo[] array (or derivative) |
|
325 |
// otherwise. It should never be null. |
|
34253 | 326 |
// |
327 |
// Returns Object returned from AbstractStackWalker::doStackWalk call. |
|
328 |
// |
|
329 |
oop StackWalk::walk(Handle stackStream, jlong mode, |
|
330 |
int skip_frames, int frame_count, int start_index, |
|
331 |
objArrayHandle frames_array, |
|
332 |
TRAPS) { |
|
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
333 |
ResourceMark rm(THREAD); |
34253 | 334 |
JavaThread* jt = (JavaThread*)THREAD; |
41664
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
335 |
log_debug(stackwalk)("Start walking: mode " JLONG_FORMAT " skip %d frames batch size %d", |
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
336 |
mode, skip_frames, frame_count); |
34253 | 337 |
|
37438 | 338 |
if (frames_array.is_null()) { |
339 |
THROW_MSG_(vmSymbols::java_lang_NullPointerException(), "frames_array is NULL", NULL); |
|
34253 | 340 |
} |
341 |
||
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
342 |
// Setup traversal onto my stack. |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
343 |
if (live_frame_info(mode)) { |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
344 |
assert (use_frames_array(mode), "Bad mode for get live frame"); |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
345 |
RegisterMap regMap(jt, true); |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
346 |
LiveFrameStream stream(jt, ®Map); |
41307
a89905798992
8166501: compilation error in stackwalk.cpp on some gccs
bchristi
parents:
41280
diff
changeset
|
347 |
return fetchFirstBatch(stream, stackStream, mode, skip_frames, frame_count, |
a89905798992
8166501: compilation error in stackwalk.cpp on some gccs
bchristi
parents:
41280
diff
changeset
|
348 |
start_index, frames_array, THREAD); |
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
349 |
} else { |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
350 |
JavaFrameStream stream(jt, mode); |
41307
a89905798992
8166501: compilation error in stackwalk.cpp on some gccs
bchristi
parents:
41280
diff
changeset
|
351 |
return fetchFirstBatch(stream, stackStream, mode, skip_frames, frame_count, |
a89905798992
8166501: compilation error in stackwalk.cpp on some gccs
bchristi
parents:
41280
diff
changeset
|
352 |
start_index, frames_array, THREAD); |
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
353 |
} |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
354 |
} |
34253 | 355 |
|
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
356 |
oop StackWalk::fetchFirstBatch(BaseFrameStream& stream, Handle stackStream, |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
357 |
jlong mode, int skip_frames, int frame_count, |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
358 |
int start_index, objArrayHandle frames_array, TRAPS) { |
34253 | 359 |
methodHandle m_doStackWalk(THREAD, Universe::do_stack_walk_method()); |
360 |
||
361 |
{ |
|
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
362 |
Klass* stackWalker_klass = SystemDictionary::StackWalker_klass(); |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
363 |
Klass* abstractStackWalker_klass = SystemDictionary::AbstractStackWalker_klass(); |
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
364 |
while (!stream.at_end()) { |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
365 |
InstanceKlass* ik = stream.method()->method_holder(); |
37438 | 366 |
if (ik != stackWalker_klass && |
367 |
ik != abstractStackWalker_klass && ik->super() != abstractStackWalker_klass) { |
|
368 |
break; |
|
34253 | 369 |
} |
370 |
||
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
371 |
LogTarget(Debug, stackwalk) lt; |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
372 |
if (lt.is_enabled()) { |
41664
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
373 |
ResourceMark rm(THREAD); |
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
374 |
LogStream ls(lt); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
375 |
ls.print(" skip "); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
376 |
stream.method()->print_short_name(&ls); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
377 |
ls.cr(); |
34253 | 378 |
} |
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
379 |
stream.next(); |
34253 | 380 |
} |
381 |
||
382 |
// stack frame has been traversed individually and resume stack walk |
|
383 |
// from the stack frame at depth == skip_frames. |
|
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
384 |
for (int n=0; n < skip_frames && !stream.at_end(); stream.next(), n++) { |
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
385 |
LogTarget(Debug, stackwalk) lt; |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
386 |
if (lt.is_enabled()) { |
41664
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
387 |
ResourceMark rm(THREAD); |
46701
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
388 |
LogStream ls(lt); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
389 |
ls.print(" skip "); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
390 |
stream.method()->print_short_name(&ls); |
f559541c0daa
8181917: Refactor UL LogStreams to avoid using resource area
stuefe
parents:
46505
diff
changeset
|
391 |
ls.cr(); |
34253 | 392 |
} |
393 |
} |
|
394 |
} |
|
395 |
||
396 |
int end_index = start_index; |
|
397 |
int numFrames = 0; |
|
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
398 |
if (!stream.at_end()) { |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
399 |
numFrames = fill_in_frames(mode, stream, frame_count, start_index, |
34253 | 400 |
frames_array, end_index, CHECK_NULL); |
401 |
if (numFrames < 1) { |
|
402 |
THROW_MSG_(vmSymbols::java_lang_InternalError(), "stack walk: decode failed", NULL); |
|
403 |
} |
|
404 |
} |
|
405 |
||
406 |
// JVM_CallStackWalk walks the stack and fills in stack frames, then calls to |
|
407 |
// Java method java.lang.StackStreamFactory.AbstractStackWalker::doStackWalk |
|
408 |
// which calls the implementation to consume the stack frames. |
|
409 |
// When JVM_CallStackWalk returns, it invalidates the stack stream. |
|
410 |
JavaValue result(T_OBJECT); |
|
411 |
JavaCallArguments args(stackStream); |
|
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
412 |
args.push_long(stream.address_value()); |
34253 | 413 |
args.push_int(skip_frames); |
414 |
args.push_int(frame_count); |
|
415 |
args.push_int(start_index); |
|
416 |
args.push_int(end_index); |
|
417 |
||
418 |
// Link the thread and vframe stream into the callee-visible object |
|
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
419 |
stream.setup_magic_on_entry(frames_array); |
34253 | 420 |
|
421 |
JavaCalls::call(&result, m_doStackWalk, &args, THREAD); |
|
422 |
||
423 |
// Do this before anything else happens, to disable any lingering stream objects |
|
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
424 |
bool ok = stream.cleanup_magic_on_exit(frames_array); |
34253 | 425 |
|
426 |
// Throw pending exception if we must |
|
427 |
(void) (CHECK_NULL); |
|
428 |
||
429 |
if (!ok) { |
|
430 |
THROW_MSG_(vmSymbols::java_lang_InternalError(), "doStackWalk: corrupted buffers on exit", NULL); |
|
431 |
} |
|
432 |
||
433 |
// Return normally |
|
434 |
return (oop)result.get_jobject(); |
|
435 |
} |
|
436 |
||
437 |
// Walk the next batch of stack frames |
|
438 |
// |
|
439 |
// Parameters: |
|
440 |
// stackStream StackStream object |
|
441 |
// mode Stack walking mode. |
|
442 |
// magic Must be valid value to continue the stack walk |
|
443 |
// frame_count Number of frames to be decoded. |
|
444 |
// start_index Start index to the user-supplied buffers. |
|
445 |
// frames_array Buffer to store StackFrame in, starting at start_index. |
|
446 |
// |
|
447 |
// Returns the end index of frame filled in the buffer. |
|
448 |
// |
|
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
449 |
jint StackWalk::fetchNextBatch(Handle stackStream, jlong mode, jlong magic, |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
450 |
int frame_count, int start_index, |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
451 |
objArrayHandle frames_array, |
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
452 |
TRAPS) |
34253 | 453 |
{ |
454 |
JavaThread* jt = (JavaThread*)THREAD; |
|
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
455 |
BaseFrameStream* existing_stream = BaseFrameStream::from_current(jt, magic, frames_array); |
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
456 |
if (existing_stream == NULL) { |
34253 | 457 |
THROW_MSG_(vmSymbols::java_lang_InternalError(), "doStackWalk: corrupted buffers", 0L); |
458 |
} |
|
459 |
||
37438 | 460 |
if (frames_array.is_null()) { |
34253 | 461 |
THROW_MSG_(vmSymbols::java_lang_NullPointerException(), "frames_array is NULL", 0L); |
462 |
} |
|
463 |
||
41664
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
464 |
log_debug(stackwalk)("StackWalk::fetchNextBatch frame_count %d existing_stream " |
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
465 |
PTR_FORMAT " start %d frames %d", |
07e88a4b405f
8160064: StackWalker implementation added logging option without using UL
rprotacio
parents:
41307
diff
changeset
|
466 |
frame_count, p2i(existing_stream), start_index, frames_array->length()); |
34253 | 467 |
int end_index = start_index; |
468 |
if (frame_count <= 0) { |
|
469 |
return end_index; // No operation. |
|
470 |
} |
|
471 |
||
472 |
int count = frame_count + start_index; |
|
37438 | 473 |
assert (frames_array->length() >= count, "not enough space in buffers"); |
34253 | 474 |
|
41280
74b314ad1e9a
8165372: StackWalker performance regression following JDK-8147039
bchristi
parents:
41095
diff
changeset
|
475 |
BaseFrameStream& stream = (*existing_stream); |
38213
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
476 |
if (!stream.at_end()) { |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
477 |
stream.next(); // advance past the last frame decoded in previous batch |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
478 |
if (!stream.at_end()) { |
2f32787e31b1
8147039: Incorrect locals and operands in compiled frames
bchristi
parents:
37438
diff
changeset
|
479 |
int n = fill_in_frames(mode, stream, frame_count, start_index, |
34253 | 480 |
frames_array, end_index, CHECK_0); |
481 |
if (n < 1) { |
|
482 |
THROW_MSG_(vmSymbols::java_lang_InternalError(), "doStackWalk: later decode failed", 0L); |
|
483 |
} |
|
484 |
return end_index; |
|
485 |
} |
|
486 |
} |
|
487 |
return end_index; |
|
488 |
} |