annotate src/share/vm/code/scopeDesc.cpp @ 21559:be896a1983c0

recast all Graal native code as JVMCI code (JBS:GRAAL-53)
author Doug Simon <doug.simon@oracle.com>
date Thu, 28 May 2015 15:36:48 +0200
parents c1f116cd4b67
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
17937
78bbf4d43a14 8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents: 6725
diff changeset
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1253
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1253
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: 1253
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
26 #include "code/debugInfoRec.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
27 #include "code/pcDesc.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
28 #include "code/scopeDesc.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
29 #include "memory/resourceArea.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
30 #include "oops/oop.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1748
diff changeset
31 #include "runtime/handles.inline.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32
17937
78bbf4d43a14 8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents: 6725
diff changeset
33 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC
0
a61af66fc99e Initial load
duke
parents:
diff changeset
34
3018
5857923e563c Fixed an issue with frame states in exception dispatch chains (now we are correctly rethrowing the exception immediately at entering the interpreter).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 1972
diff changeset
35 ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, int obj_decode_offset, bool reexecute, bool rethrow_exception, bool return_oop) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
36 _code = code;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 _decode_offset = decode_offset;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 _objects = decode_object_values(obj_decode_offset);
931
72088be4b386 6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents: 900
diff changeset
39 _reexecute = reexecute;
1253
f70b0d9ab095 6910618: C2: Error: assert(d->is_oop(),"JVM_ArrayCopy: dst not an oop")
kvn
parents: 931
diff changeset
40 _return_oop = return_oop;
3018
5857923e563c Fixed an issue with frame states in exception dispatch chains (now we are correctly rethrowing the exception immediately at entering the interpreter).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 1972
diff changeset
41 _rethrow_exception = rethrow_exception;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
42 decode_body();
a61af66fc99e Initial load
duke
parents:
diff changeset
43 }
a61af66fc99e Initial load
duke
parents:
diff changeset
44
3018
5857923e563c Fixed an issue with frame states in exception dispatch chains (now we are correctly rethrowing the exception immediately at entering the interpreter).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 1972
diff changeset
45 ScopeDesc::ScopeDesc(const nmethod* code, int decode_offset, bool reexecute, bool rethrow_exception, bool return_oop) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
46 _code = code;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 _decode_offset = decode_offset;
a61af66fc99e Initial load
duke
parents:
diff changeset
48 _objects = decode_object_values(DebugInformationRecorder::serialized_null);
931
72088be4b386 6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents: 900
diff changeset
49 _reexecute = reexecute;
1253
f70b0d9ab095 6910618: C2: Error: assert(d->is_oop(),"JVM_ArrayCopy: dst not an oop")
kvn
parents: 931
diff changeset
50 _return_oop = return_oop;
3018
5857923e563c Fixed an issue with frame states in exception dispatch chains (now we are correctly rethrowing the exception immediately at entering the interpreter).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 1972
diff changeset
51 _rethrow_exception = rethrow_exception;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
52 decode_body();
a61af66fc99e Initial load
duke
parents:
diff changeset
53 }
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55
a61af66fc99e Initial load
duke
parents:
diff changeset
56 ScopeDesc::ScopeDesc(const ScopeDesc* parent) {
a61af66fc99e Initial load
duke
parents:
diff changeset
57 _code = parent->_code;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 _decode_offset = parent->_sender_decode_offset;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 _objects = parent->_objects;
931
72088be4b386 6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents: 900
diff changeset
60 _reexecute = false; //reexecute only applies to the first scope
3018
5857923e563c Fixed an issue with frame states in exception dispatch chains (now we are correctly rethrowing the exception immediately at entering the interpreter).
Thomas Wuerthinger <thomas@wuerthinger.net>
parents: 1972
diff changeset
61 _rethrow_exception = false;
1253
f70b0d9ab095 6910618: C2: Error: assert(d->is_oop(),"JVM_ArrayCopy: dst not an oop")
kvn
parents: 931
diff changeset
62 _return_oop = false;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
63 decode_body();
a61af66fc99e Initial load
duke
parents:
diff changeset
64 }
a61af66fc99e Initial load
duke
parents:
diff changeset
65
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 void ScopeDesc::decode_body() {
a61af66fc99e Initial load
duke
parents:
diff changeset
68 if (decode_offset() == DebugInformationRecorder::serialized_null) {
a61af66fc99e Initial load
duke
parents:
diff changeset
69 // This is a sentinel record, which is only relevant to
a61af66fc99e Initial load
duke
parents:
diff changeset
70 // approximate queries. Decode a reasonable frame.
a61af66fc99e Initial load
duke
parents:
diff changeset
71 _sender_decode_offset = DebugInformationRecorder::serialized_null;
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
72 _method = _code->method();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
73 _bci = InvocationEntryBci;
a61af66fc99e Initial load
duke
parents:
diff changeset
74 _locals_decode_offset = DebugInformationRecorder::serialized_null;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 _expressions_decode_offset = DebugInformationRecorder::serialized_null;
a61af66fc99e Initial load
duke
parents:
diff changeset
76 _monitors_decode_offset = DebugInformationRecorder::serialized_null;
a61af66fc99e Initial load
duke
parents:
diff changeset
77 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
78 // decode header
a61af66fc99e Initial load
duke
parents:
diff changeset
79 DebugInfoReadStream* stream = stream_at(decode_offset());
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81 _sender_decode_offset = stream->read_int();
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
82 _method = stream->read_method();
931
72088be4b386 6873116: Modify reexecute implementation to use pcDesc to record the reexecute bit
cfang
parents: 900
diff changeset
83 _bci = stream->read_bci();
900
9987d9d5eb0e 6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents: 196
diff changeset
84
0
a61af66fc99e Initial load
duke
parents:
diff changeset
85 // decode offsets for body and sender
a61af66fc99e Initial load
duke
parents:
diff changeset
86 _locals_decode_offset = stream->read_int();
a61af66fc99e Initial load
duke
parents:
diff changeset
87 _expressions_decode_offset = stream->read_int();
a61af66fc99e Initial load
duke
parents:
diff changeset
88 _monitors_decode_offset = stream->read_int();
a61af66fc99e Initial load
duke
parents:
diff changeset
89 }
a61af66fc99e Initial load
duke
parents:
diff changeset
90 }
a61af66fc99e Initial load
duke
parents:
diff changeset
91
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 GrowableArray<ScopeValue*>* ScopeDesc::decode_scope_values(int decode_offset) {
a61af66fc99e Initial load
duke
parents:
diff changeset
94 if (decode_offset == DebugInformationRecorder::serialized_null) return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
95 DebugInfoReadStream* stream = stream_at(decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
96 int length = stream->read_int();
a61af66fc99e Initial load
duke
parents:
diff changeset
97 GrowableArray<ScopeValue*>* result = new GrowableArray<ScopeValue*> (length);
a61af66fc99e Initial load
duke
parents:
diff changeset
98 for (int index = 0; index < length; index++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
99 result->push(ScopeValue::read_from(stream));
a61af66fc99e Initial load
duke
parents:
diff changeset
100 }
a61af66fc99e Initial load
duke
parents:
diff changeset
101 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
102 }
a61af66fc99e Initial load
duke
parents:
diff changeset
103
a61af66fc99e Initial load
duke
parents:
diff changeset
104 GrowableArray<ScopeValue*>* ScopeDesc::decode_object_values(int decode_offset) {
a61af66fc99e Initial load
duke
parents:
diff changeset
105 if (decode_offset == DebugInformationRecorder::serialized_null) return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
106 GrowableArray<ScopeValue*>* result = new GrowableArray<ScopeValue*>();
a61af66fc99e Initial load
duke
parents:
diff changeset
107 DebugInfoReadStream* stream = new DebugInfoReadStream(_code, decode_offset, result);
a61af66fc99e Initial load
duke
parents:
diff changeset
108 int length = stream->read_int();
a61af66fc99e Initial load
duke
parents:
diff changeset
109 for (int index = 0; index < length; index++) {
44
52fed2ec0afb 6667620: (Escape Analysis) fix deoptimization for scalar replaced objects
kvn
parents: 0
diff changeset
110 // Objects values are pushed to 'result' array during read so that
52fed2ec0afb 6667620: (Escape Analysis) fix deoptimization for scalar replaced objects
kvn
parents: 0
diff changeset
111 // object's fields could reference it (OBJECT_ID_CODE).
52fed2ec0afb 6667620: (Escape Analysis) fix deoptimization for scalar replaced objects
kvn
parents: 0
diff changeset
112 (void)ScopeValue::read_from(stream);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
113 }
a61af66fc99e Initial load
duke
parents:
diff changeset
114 assert(result->length() == length, "inconsistent debug information");
a61af66fc99e Initial load
duke
parents:
diff changeset
115 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 }
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118
a61af66fc99e Initial load
duke
parents:
diff changeset
119 GrowableArray<MonitorValue*>* ScopeDesc::decode_monitor_values(int decode_offset) {
a61af66fc99e Initial load
duke
parents:
diff changeset
120 if (decode_offset == DebugInformationRecorder::serialized_null) return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
121 DebugInfoReadStream* stream = stream_at(decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
122 int length = stream->read_int();
a61af66fc99e Initial load
duke
parents:
diff changeset
123 GrowableArray<MonitorValue*>* result = new GrowableArray<MonitorValue*> (length);
a61af66fc99e Initial load
duke
parents:
diff changeset
124 for (int index = 0; index < length; index++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
125 result->push(new MonitorValue(stream));
a61af66fc99e Initial load
duke
parents:
diff changeset
126 }
a61af66fc99e Initial load
duke
parents:
diff changeset
127 return result;
a61af66fc99e Initial load
duke
parents:
diff changeset
128 }
a61af66fc99e Initial load
duke
parents:
diff changeset
129
a61af66fc99e Initial load
duke
parents:
diff changeset
130 DebugInfoReadStream* ScopeDesc::stream_at(int decode_offset) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
131 return new DebugInfoReadStream(_code, decode_offset, _objects);
a61af66fc99e Initial load
duke
parents:
diff changeset
132 }
a61af66fc99e Initial load
duke
parents:
diff changeset
133
a61af66fc99e Initial load
duke
parents:
diff changeset
134 GrowableArray<ScopeValue*>* ScopeDesc::locals() {
a61af66fc99e Initial load
duke
parents:
diff changeset
135 return decode_scope_values(_locals_decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
136 }
a61af66fc99e Initial load
duke
parents:
diff changeset
137
a61af66fc99e Initial load
duke
parents:
diff changeset
138 GrowableArray<ScopeValue*>* ScopeDesc::expressions() {
a61af66fc99e Initial load
duke
parents:
diff changeset
139 return decode_scope_values(_expressions_decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
140 }
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 GrowableArray<MonitorValue*>* ScopeDesc::monitors() {
a61af66fc99e Initial load
duke
parents:
diff changeset
143 return decode_monitor_values(_monitors_decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
144 }
a61af66fc99e Initial load
duke
parents:
diff changeset
145
a61af66fc99e Initial load
duke
parents:
diff changeset
146 GrowableArray<ScopeValue*>* ScopeDesc::objects() {
a61af66fc99e Initial load
duke
parents:
diff changeset
147 return _objects;
a61af66fc99e Initial load
duke
parents:
diff changeset
148 }
a61af66fc99e Initial load
duke
parents:
diff changeset
149
a61af66fc99e Initial load
duke
parents:
diff changeset
150 bool ScopeDesc::is_top() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
151 return _sender_decode_offset == DebugInformationRecorder::serialized_null;
a61af66fc99e Initial load
duke
parents:
diff changeset
152 }
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 ScopeDesc* ScopeDesc::sender() const {
a61af66fc99e Initial load
duke
parents:
diff changeset
155 if (is_top()) return NULL;
a61af66fc99e Initial load
duke
parents:
diff changeset
156 return new ScopeDesc(this);
a61af66fc99e Initial load
duke
parents:
diff changeset
157 }
a61af66fc99e Initial load
duke
parents:
diff changeset
158
a61af66fc99e Initial load
duke
parents:
diff changeset
159
a61af66fc99e Initial load
duke
parents:
diff changeset
160 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162 void ScopeDesc::print_value_on(outputStream* st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
163 tty->print(" ");
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 1972
diff changeset
164 method()->print_short_name(st);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
165 int lineno = method()->line_number_from_bci(bci());
a61af66fc99e Initial load
duke
parents:
diff changeset
166 if (lineno != -1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
167 st->print_cr("@%d (line %d)", bci(), lineno);
a61af66fc99e Initial load
duke
parents:
diff changeset
168 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
169 st->print_cr("@%d", bci());
a61af66fc99e Initial load
duke
parents:
diff changeset
170 }
a61af66fc99e Initial load
duke
parents:
diff changeset
171 }
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 void ScopeDesc::print_on(outputStream* st) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
174 print_on(st, NULL);
a61af66fc99e Initial load
duke
parents:
diff changeset
175 }
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 void ScopeDesc::print_on(outputStream* st, PcDesc* pd) const {
a61af66fc99e Initial load
duke
parents:
diff changeset
178 // header
a61af66fc99e Initial load
duke
parents:
diff changeset
179 if (pd != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
180 tty->print_cr("ScopeDesc(pc=" PTR_FORMAT " offset=%x):", pd->real_pc(_code), pd->pc_offset());
a61af66fc99e Initial load
duke
parents:
diff changeset
181 }
a61af66fc99e Initial load
duke
parents:
diff changeset
182
a61af66fc99e Initial load
duke
parents:
diff changeset
183 print_value_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
184 // decode offsets
a61af66fc99e Initial load
duke
parents:
diff changeset
185 if (WizardMode) {
1748
3e8fbc61cee8 6978355: renaming for 6961697
twisti
parents: 1552
diff changeset
186 st->print("ScopeDesc[%d]@" PTR_FORMAT " ", _decode_offset, _code->content_begin());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
187 st->print_cr(" offset: %d", _decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
188 st->print_cr(" bci: %d", bci());
900
9987d9d5eb0e 6833129: specjvm98 fails with NullPointerException in the compiler with -XX:DeoptimizeALot
cfang
parents: 196
diff changeset
189 st->print_cr(" reexecute: %s", should_reexecute() ? "true" : "false");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
190 st->print_cr(" locals: %d", _locals_decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
191 st->print_cr(" stack: %d", _expressions_decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
192 st->print_cr(" monitor: %d", _monitors_decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
193 st->print_cr(" sender: %d", _sender_decode_offset);
a61af66fc99e Initial load
duke
parents:
diff changeset
194 }
a61af66fc99e Initial load
duke
parents:
diff changeset
195 // locals
a61af66fc99e Initial load
duke
parents:
diff changeset
196 { GrowableArray<ScopeValue*>* l = ((ScopeDesc*) this)->locals();
a61af66fc99e Initial load
duke
parents:
diff changeset
197 if (l != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
198 tty->print_cr(" Locals");
a61af66fc99e Initial load
duke
parents:
diff changeset
199 for (int index = 0; index < l->length(); index++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
200 st->print(" - l%d: ", index);
a61af66fc99e Initial load
duke
parents:
diff changeset
201 l->at(index)->print_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
202 st->cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
203 }
a61af66fc99e Initial load
duke
parents:
diff changeset
204 }
a61af66fc99e Initial load
duke
parents:
diff changeset
205 }
a61af66fc99e Initial load
duke
parents:
diff changeset
206 // expressions
a61af66fc99e Initial load
duke
parents:
diff changeset
207 { GrowableArray<ScopeValue*>* l = ((ScopeDesc*) this)->expressions();
a61af66fc99e Initial load
duke
parents:
diff changeset
208 if (l != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
209 st->print_cr(" Expression stack");
a61af66fc99e Initial load
duke
parents:
diff changeset
210 for (int index = 0; index < l->length(); index++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
211 st->print(" - @%d: ", index);
a61af66fc99e Initial load
duke
parents:
diff changeset
212 l->at(index)->print_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
213 st->cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
214 }
a61af66fc99e Initial load
duke
parents:
diff changeset
215 }
a61af66fc99e Initial load
duke
parents:
diff changeset
216 }
a61af66fc99e Initial load
duke
parents:
diff changeset
217 // monitors
a61af66fc99e Initial load
duke
parents:
diff changeset
218 { GrowableArray<MonitorValue*>* l = ((ScopeDesc*) this)->monitors();
a61af66fc99e Initial load
duke
parents:
diff changeset
219 if (l != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
220 st->print_cr(" Monitor stack");
a61af66fc99e Initial load
duke
parents:
diff changeset
221 for (int index = 0; index < l->length(); index++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
222 st->print(" - @%d: ", index);
a61af66fc99e Initial load
duke
parents:
diff changeset
223 l->at(index)->print_on(st);
a61af66fc99e Initial load
duke
parents:
diff changeset
224 st->cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
225 }
a61af66fc99e Initial load
duke
parents:
diff changeset
226 }
a61af66fc99e Initial load
duke
parents:
diff changeset
227 }
a61af66fc99e Initial load
duke
parents:
diff changeset
228
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20044
diff changeset
229 #if defined(COMPILER2) || defined(JVMCI)
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20044
diff changeset
230 if (NOT_JVMCI(DoEscapeAnalysis &&) is_top() && _objects != NULL) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
231 tty->print_cr("Objects");
a61af66fc99e Initial load
duke
parents:
diff changeset
232 for (int i = 0; i < _objects->length(); i++) {
19598
15ef24874df7 Add assertion to ObjectValue conversion
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 18041
diff changeset
233 ObjectValue* sv = _objects->at(i)->as_ObjectValue();
0
a61af66fc99e Initial load
duke
parents:
diff changeset
234 tty->print(" - %d: ", sv->id());
20044
c1f116cd4b67 Speed up debug info generation for virtual objects
Tom Rodriguez <tom.rodriguez@oracle.com>
parents: 19598
diff changeset
235 tty->print("%s ", java_lang_Class::as_Klass(sv->klass()->as_ConstantOopReadValue()->value()())->external_name());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
236 sv->print_fields_on(tty);
a61af66fc99e Initial load
duke
parents:
diff changeset
237 tty->cr();
a61af66fc99e Initial load
duke
parents:
diff changeset
238 }
a61af66fc99e Initial load
duke
parents:
diff changeset
239 }
21559
be896a1983c0 recast all Graal native code as JVMCI code (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents: 20044
diff changeset
240 #endif // COMPILER2 || JVMCI
0
a61af66fc99e Initial load
duke
parents:
diff changeset
241 }
a61af66fc99e Initial load
duke
parents:
diff changeset
242
a61af66fc99e Initial load
duke
parents:
diff changeset
243 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
244
a61af66fc99e Initial load
duke
parents:
diff changeset
245 void ScopeDesc::verify() {
a61af66fc99e Initial load
duke
parents:
diff changeset
246 ResourceMark rm;
a61af66fc99e Initial load
duke
parents:
diff changeset
247 guarantee(method()->is_method(), "type check");
a61af66fc99e Initial load
duke
parents:
diff changeset
248
a61af66fc99e Initial load
duke
parents:
diff changeset
249 // check if we have any illegal elements on the expression stack
a61af66fc99e Initial load
duke
parents:
diff changeset
250 { GrowableArray<ScopeValue*>* l = expressions();
a61af66fc99e Initial load
duke
parents:
diff changeset
251 if (l != NULL) {
a61af66fc99e Initial load
duke
parents:
diff changeset
252 for (int index = 0; index < l->length(); index++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
253 //guarantee(!l->at(index)->is_illegal(), "expression element cannot be illegal");
a61af66fc99e Initial load
duke
parents:
diff changeset
254 }
a61af66fc99e Initial load
duke
parents:
diff changeset
255 }
a61af66fc99e Initial load
duke
parents:
diff changeset
256 }
a61af66fc99e Initial load
duke
parents:
diff changeset
257 }