annotate src/share/vm/classfile/stackMapFrame.cpp @ 20527:8cb56c8cb30d

Merge
author jiangli
date Mon, 15 Sep 2014 16:39:00 -0400
parents b2daaf70fab2 c77d5db18942
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
18052
2373a1f4987c 8036533: Method for correct defaults
hseigel
parents: 6605
diff changeset
2 * Copyright (c) 2003, 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: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
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: 0
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: 1552
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
26 #include "classfile/stackMapFrame.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
27 #include "classfile/verifier.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
28 #include "memory/resourceArea.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
29 #include "oops/oop.inline.hpp"
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
30 #include "oops/symbol.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
31 #include "runtime/handles.inline.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1552
diff changeset
32 #include "utilities/globalDefinitions.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 StackMapFrame::StackMapFrame(u2 max_locals, u2 max_stack, ClassVerifier* v) :
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
35 _offset(0), _locals_size(0), _stack_size(0),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
36 _stack_mark(0), _flags(0), _max_locals(max_locals),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
37 _max_stack(max_stack), _verifier(v) {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
38 Thread* thr = v->thread();
a61af66fc99e Initial load
duke
parents:
diff changeset
39 _locals = NEW_RESOURCE_ARRAY_IN_THREAD(thr, VerificationType, max_locals);
a61af66fc99e Initial load
duke
parents:
diff changeset
40 _stack = NEW_RESOURCE_ARRAY_IN_THREAD(thr, VerificationType, max_stack);
a61af66fc99e Initial load
duke
parents:
diff changeset
41 int32_t i;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 for(i = 0; i < max_locals; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
43 _locals[i] = VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
44 }
a61af66fc99e Initial load
duke
parents:
diff changeset
45 for(i = 0; i < max_stack; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
46 _stack[i] = VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
47 }
a61af66fc99e Initial load
duke
parents:
diff changeset
48 }
a61af66fc99e Initial load
duke
parents:
diff changeset
49
a61af66fc99e Initial load
duke
parents:
diff changeset
50 StackMapFrame* StackMapFrame::frame_in_exception_handler(u1 flags) {
a61af66fc99e Initial load
duke
parents:
diff changeset
51 Thread* thr = _verifier->thread();
a61af66fc99e Initial load
duke
parents:
diff changeset
52 VerificationType* stack = NEW_RESOURCE_ARRAY_IN_THREAD(thr, VerificationType, 1);
a61af66fc99e Initial load
duke
parents:
diff changeset
53 StackMapFrame* frame = new StackMapFrame(_offset, flags, _locals_size, 0, _max_locals, _max_stack, _locals, stack, _verifier);
a61af66fc99e Initial load
duke
parents:
diff changeset
54 return frame;
a61af66fc99e Initial load
duke
parents:
diff changeset
55 }
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57 void StackMapFrame::initialize_object(
a61af66fc99e Initial load
duke
parents:
diff changeset
58 VerificationType old_object, VerificationType new_object) {
a61af66fc99e Initial load
duke
parents:
diff changeset
59 int32_t i;
a61af66fc99e Initial load
duke
parents:
diff changeset
60 for (i = 0; i < _max_locals; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
61 if (_locals[i].equals(old_object)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
62 _locals[i] = new_object;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 }
a61af66fc99e Initial load
duke
parents:
diff changeset
64 }
a61af66fc99e Initial load
duke
parents:
diff changeset
65 for (i = 0; i < _stack_size; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
66 if (_stack[i].equals(old_object)) {
a61af66fc99e Initial load
duke
parents:
diff changeset
67 _stack[i] = new_object;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 }
a61af66fc99e Initial load
duke
parents:
diff changeset
69 }
a61af66fc99e Initial load
duke
parents:
diff changeset
70 if (old_object == VerificationType::uninitialized_this_type()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
71 // "this" has been initialized - reset flags
a61af66fc99e Initial load
duke
parents:
diff changeset
72 _flags = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 }
a61af66fc99e Initial load
duke
parents:
diff changeset
74 }
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 VerificationType StackMapFrame::set_locals_from_arg(
a61af66fc99e Initial load
duke
parents:
diff changeset
77 const methodHandle m, VerificationType thisKlass, TRAPS) {
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
78 SignatureStream ss(m->signature());
0
a61af66fc99e Initial load
duke
parents:
diff changeset
79 int init_local_num = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
80 if (!m->is_static()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
81 init_local_num++;
a61af66fc99e Initial load
duke
parents:
diff changeset
82 // add one extra argument for instance method
a61af66fc99e Initial load
duke
parents:
diff changeset
83 if (m->name() == vmSymbols::object_initializer_name() &&
a61af66fc99e Initial load
duke
parents:
diff changeset
84 thisKlass.name() != vmSymbols::java_lang_Object()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
85 _locals[0] = VerificationType::uninitialized_this_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
86 _flags |= FLAG_THIS_UNINIT;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 } else {
a61af66fc99e Initial load
duke
parents:
diff changeset
88 _locals[0] = thisKlass;
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 // local num may be greater than size of parameters because long/double occupies two slots
a61af66fc99e Initial load
duke
parents:
diff changeset
93 while(!ss.at_return_type()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
94 init_local_num += _verifier->change_sig_to_verificationType(
a61af66fc99e Initial load
duke
parents:
diff changeset
95 &ss, &_locals[init_local_num],
a61af66fc99e Initial load
duke
parents:
diff changeset
96 CHECK_VERIFY_(verifier(), VerificationType::bogus_type()));
a61af66fc99e Initial load
duke
parents:
diff changeset
97 ss.next();
a61af66fc99e Initial load
duke
parents:
diff changeset
98 }
a61af66fc99e Initial load
duke
parents:
diff changeset
99 _locals_size = init_local_num;
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 switch (ss.type()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
102 case T_OBJECT:
a61af66fc99e Initial load
duke
parents:
diff changeset
103 case T_ARRAY:
a61af66fc99e Initial load
duke
parents:
diff changeset
104 {
2177
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
105 Symbol* sig = ss.as_symbol(CHECK_(VerificationType::bogus_type()));
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
106 // Create another symbol to save as signature stream unreferences
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
107 // this symbol.
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
108 Symbol* sig_copy =
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
109 verifier()->create_temporary_symbol(sig, 0, sig->utf8_length(),
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
110 CHECK_(VerificationType::bogus_type()));
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
111 assert(sig_copy == sig, "symbols don't match");
3582bf76420e 6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents: 1972
diff changeset
112 return VerificationType::reference_type(sig_copy);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
113 }
a61af66fc99e Initial load
duke
parents:
diff changeset
114 case T_INT: return VerificationType::integer_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
115 case T_BYTE: return VerificationType::byte_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
116 case T_CHAR: return VerificationType::char_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
117 case T_SHORT: return VerificationType::short_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
118 case T_BOOLEAN: return VerificationType::boolean_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
119 case T_FLOAT: return VerificationType::float_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
120 case T_DOUBLE: return VerificationType::double_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
121 case T_LONG: return VerificationType::long_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
122 case T_VOID: return VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
123 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
124 ShouldNotReachHere();
a61af66fc99e Initial load
duke
parents:
diff changeset
125 }
a61af66fc99e Initial load
duke
parents:
diff changeset
126 return VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
127 }
a61af66fc99e Initial load
duke
parents:
diff changeset
128
a61af66fc99e Initial load
duke
parents:
diff changeset
129 void StackMapFrame::copy_locals(const StackMapFrame* src) {
a61af66fc99e Initial load
duke
parents:
diff changeset
130 int32_t len = src->locals_size() < _locals_size ?
a61af66fc99e Initial load
duke
parents:
diff changeset
131 src->locals_size() : _locals_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
132 for (int32_t i = 0; i < len; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
133 _locals[i] = src->locals()[i];
a61af66fc99e Initial load
duke
parents:
diff changeset
134 }
a61af66fc99e Initial load
duke
parents:
diff changeset
135 }
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 void StackMapFrame::copy_stack(const StackMapFrame* src) {
a61af66fc99e Initial load
duke
parents:
diff changeset
138 int32_t len = src->stack_size() < _stack_size ?
a61af66fc99e Initial load
duke
parents:
diff changeset
139 src->stack_size() : _stack_size;
a61af66fc99e Initial load
duke
parents:
diff changeset
140 for (int32_t i = 0; i < len; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
141 _stack[i] = src->stack()[i];
a61af66fc99e Initial load
duke
parents:
diff changeset
142 }
a61af66fc99e Initial load
duke
parents:
diff changeset
143 }
a61af66fc99e Initial load
duke
parents:
diff changeset
144
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
145 // Returns the location of the first mismatch, or 'len' if there are no
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
146 // mismatches
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
147 int StackMapFrame::is_assignable_to(
0
a61af66fc99e Initial load
duke
parents:
diff changeset
148 VerificationType* from, VerificationType* to, int32_t len, TRAPS) const {
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
149 int32_t i = 0;
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
150 for (i = 0; i < len; i++) {
18052
2373a1f4987c 8036533: Method for correct defaults
hseigel
parents: 6605
diff changeset
151 if (!to[i].is_assignable_from(from[i], verifier(), false, THREAD)) {
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
152 break;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
153 }
a61af66fc99e Initial load
duke
parents:
diff changeset
154 }
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
155 return i;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
156 }
a61af66fc99e Initial load
duke
parents:
diff changeset
157
2303
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
158 bool StackMapFrame::has_flag_match_exception(
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
159 const StackMapFrame* target) const {
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
160 // We allow flags of {UninitThis} to assign to {} if-and-only-if the
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
161 // target frame does not depend upon the current type.
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
162 // This is slightly too strict, as we need only enforce that the
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
163 // slots that were initialized by the <init> (the things that were
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
164 // UninitializedThis before initialize_object() converted them) are unused.
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
165 // However we didn't save that information so we'll enforce this upon
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
166 // anything that might have been initialized. This is a rare situation
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
167 // and javac never generates code that would end up here, but some profilers
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
168 // (such as NetBeans) might, when adding exception handlers in <init>
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
169 // methods to cover the invokespecial instruction. See 7020118.
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
170
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
171 assert(max_locals() == target->max_locals() &&
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
172 stack_size() == target->stack_size(), "StackMap sizes must match");
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
173
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
174 VerificationType top = VerificationType::top_type();
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
175 VerificationType this_type = verifier()->current_type();
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
176
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
177 if (!flag_this_uninit() || target->flags() != 0) {
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
178 return false;
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
179 }
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
180
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
181 for (int i = 0; i < target->locals_size(); ++i) {
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
182 if (locals()[i] == this_type && target->locals()[i] != top) {
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
183 return false;
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
184 }
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
185 }
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
186
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
187 for (int i = 0; i < target->stack_size(); ++i) {
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
188 if (stack()[i] == this_type && target->stack()[i] != top) {
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
189 return false;
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
190 }
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
191 }
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
192
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
193 return true;
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
194 }
c1a6154012c8 7020118: Alter frame assignability to allow for exception handler coverage of invokespecial <init>
kamg
parents: 2177
diff changeset
195
2472
7144a1d6e0a9 7030388: JCK test failed to reject invalid class check01304m10n.
kamg
parents: 2303
diff changeset
196 bool StackMapFrame::is_assignable_to(
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
197 const StackMapFrame* target, bool is_exception_handler,
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
198 ErrorContext* ctx, TRAPS) const {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
199 if (_max_locals != target->max_locals()) {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
200 *ctx = ErrorContext::locals_size_mismatch(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
201 _offset, (StackMapFrame*)this, (StackMapFrame*)target);
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
202 return false;
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
203 }
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
204 if (_stack_size != target->stack_size()) {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
205 *ctx = ErrorContext::stack_size_mismatch(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
206 _offset, (StackMapFrame*)this, (StackMapFrame*)target);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
207 return false;
a61af66fc99e Initial load
duke
parents:
diff changeset
208 }
a61af66fc99e Initial load
duke
parents:
diff changeset
209 // Only need to compare type elements up to target->locals() or target->stack().
a61af66fc99e Initial load
duke
parents:
diff changeset
210 // The remaining type elements in this state can be ignored because they are
a61af66fc99e Initial load
duke
parents:
diff changeset
211 // assignable to bogus type.
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
212 int mismatch_loc;
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
213 mismatch_loc = is_assignable_to(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
214 _locals, target->locals(), target->locals_size(), THREAD);
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
215 if (mismatch_loc != target->locals_size()) {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
216 *ctx = ErrorContext::bad_type(target->offset(),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
217 TypeOrigin::local(mismatch_loc, (StackMapFrame*)this),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
218 TypeOrigin::sm_local(mismatch_loc, (StackMapFrame*)target));
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
219 return false;
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
220 }
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
221 mismatch_loc = is_assignable_to(_stack, target->stack(), _stack_size, THREAD);
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
222 if (mismatch_loc != _stack_size) {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
223 *ctx = ErrorContext::bad_type(target->offset(),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
224 TypeOrigin::stack(mismatch_loc, (StackMapFrame*)this),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
225 TypeOrigin::sm_stack(mismatch_loc, (StackMapFrame*)target));
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
226 return false;
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
227 }
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
228
0
a61af66fc99e Initial load
duke
parents:
diff changeset
229 bool match_flags = (_flags | target->flags()) == target->flags();
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
230 if (match_flags || is_exception_handler && has_flag_match_exception(target)) {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
231 return true;
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
232 } else {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
233 *ctx = ErrorContext::bad_flags(target->offset(),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
234 (StackMapFrame*)this, (StackMapFrame*)target);
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
235 return false;
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
236 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
237 }
a61af66fc99e Initial load
duke
parents:
diff changeset
238
a61af66fc99e Initial load
duke
parents:
diff changeset
239 VerificationType StackMapFrame::pop_stack_ex(VerificationType type, TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
240 if (_stack_size <= 0) {
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
241 verifier()->verify_error(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
242 ErrorContext::stack_underflow(_offset, this),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
243 "Operand stack underflow");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
244 return VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
245 }
a61af66fc99e Initial load
duke
parents:
diff changeset
246 VerificationType top = _stack[--_stack_size];
a61af66fc99e Initial load
duke
parents:
diff changeset
247 bool subtype = type.is_assignable_from(
18052
2373a1f4987c 8036533: Method for correct defaults
hseigel
parents: 6605
diff changeset
248 top, verifier(), false, CHECK_(VerificationType::bogus_type()));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
249 if (!subtype) {
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
250 verifier()->verify_error(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
251 ErrorContext::bad_type(_offset, stack_top_ctx(),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
252 TypeOrigin::implicit(type)),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
253 "Bad type on operand stack");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
254 return VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
255 }
a61af66fc99e Initial load
duke
parents:
diff changeset
256 return top;
a61af66fc99e Initial load
duke
parents:
diff changeset
257 }
a61af66fc99e Initial load
duke
parents:
diff changeset
258
a61af66fc99e Initial load
duke
parents:
diff changeset
259 VerificationType StackMapFrame::get_local(
a61af66fc99e Initial load
duke
parents:
diff changeset
260 int32_t index, VerificationType type, TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
261 if (index >= _max_locals) {
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
262 verifier()->verify_error(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
263 ErrorContext::bad_local_index(_offset, index),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
264 "Local variable table overflow");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
265 return VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
266 }
a61af66fc99e Initial load
duke
parents:
diff changeset
267 bool subtype = type.is_assignable_from(_locals[index],
18052
2373a1f4987c 8036533: Method for correct defaults
hseigel
parents: 6605
diff changeset
268 verifier(), false, CHECK_(VerificationType::bogus_type()));
0
a61af66fc99e Initial load
duke
parents:
diff changeset
269 if (!subtype) {
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
270 verifier()->verify_error(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
271 ErrorContext::bad_type(_offset,
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
272 TypeOrigin::local(index, this),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
273 TypeOrigin::implicit(type)),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
274 "Bad local variable type");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
275 return VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
276 }
a61af66fc99e Initial load
duke
parents:
diff changeset
277 if(index >= _locals_size) { _locals_size = index + 1; }
a61af66fc99e Initial load
duke
parents:
diff changeset
278 return _locals[index];
a61af66fc99e Initial load
duke
parents:
diff changeset
279 }
a61af66fc99e Initial load
duke
parents:
diff changeset
280
a61af66fc99e Initial load
duke
parents:
diff changeset
281 void StackMapFrame::get_local_2(
a61af66fc99e Initial load
duke
parents:
diff changeset
282 int32_t index, VerificationType type1, VerificationType type2, TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
283 assert(type1.is_long() || type1.is_double(), "must be long/double");
a61af66fc99e Initial load
duke
parents:
diff changeset
284 assert(type2.is_long2() || type2.is_double2(), "must be long/double_2");
a61af66fc99e Initial load
duke
parents:
diff changeset
285 if (index >= _locals_size - 1) {
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
286 verifier()->verify_error(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
287 ErrorContext::bad_local_index(_offset, index),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
288 "get long/double overflows locals");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
289 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
290 }
18052
2373a1f4987c 8036533: Method for correct defaults
hseigel
parents: 6605
diff changeset
291 bool subtype = type1.is_assignable_from(_locals[index], verifier(), false, CHECK);
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
292 if (!subtype) {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
293 verifier()->verify_error(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
294 ErrorContext::bad_type(_offset,
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
295 TypeOrigin::local(index, this), TypeOrigin::implicit(type1)),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
296 "Bad local variable type");
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
297 } else {
18052
2373a1f4987c 8036533: Method for correct defaults
hseigel
parents: 6605
diff changeset
298 subtype = type2.is_assignable_from(_locals[index + 1], verifier(), false, CHECK);
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
299 if (!subtype) {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
300 /* Unreachable? All local store routines convert a split long or double
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
301 * into a TOP during the store. So we should never end up seeing an
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
302 * orphaned half. */
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
303 verifier()->verify_error(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
304 ErrorContext::bad_type(_offset,
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
305 TypeOrigin::local(index + 1, this), TypeOrigin::implicit(type2)),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
306 "Bad local variable type");
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
307 }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
308 }
a61af66fc99e Initial load
duke
parents:
diff changeset
309 }
a61af66fc99e Initial load
duke
parents:
diff changeset
310
a61af66fc99e Initial load
duke
parents:
diff changeset
311 void StackMapFrame::set_local(int32_t index, VerificationType type, TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
312 assert(!type.is_check(), "Must be a real type");
a61af66fc99e Initial load
duke
parents:
diff changeset
313 if (index >= _max_locals) {
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
314 verifier()->verify_error(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
315 ErrorContext::bad_local_index(_offset, index),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
316 "Local variable table overflow");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
317 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
318 }
a61af66fc99e Initial load
duke
parents:
diff changeset
319 // If type at index is double or long, set the next location to be unusable
a61af66fc99e Initial load
duke
parents:
diff changeset
320 if (_locals[index].is_double() || _locals[index].is_long()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
321 assert((index + 1) < _locals_size, "Local variable table overflow");
a61af66fc99e Initial load
duke
parents:
diff changeset
322 _locals[index + 1] = VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
323 }
a61af66fc99e Initial load
duke
parents:
diff changeset
324 // If type at index is double_2 or long_2, set the previous location to be unusable
a61af66fc99e Initial load
duke
parents:
diff changeset
325 if (_locals[index].is_double2() || _locals[index].is_long2()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
326 assert(index >= 1, "Local variable table underflow");
a61af66fc99e Initial load
duke
parents:
diff changeset
327 _locals[index - 1] = VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
328 }
a61af66fc99e Initial load
duke
parents:
diff changeset
329 _locals[index] = type;
a61af66fc99e Initial load
duke
parents:
diff changeset
330 if (index >= _locals_size) {
a61af66fc99e Initial load
duke
parents:
diff changeset
331 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
332 for (int i=_locals_size; i<index; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
333 assert(_locals[i] == VerificationType::bogus_type(),
a61af66fc99e Initial load
duke
parents:
diff changeset
334 "holes must be bogus type");
a61af66fc99e Initial load
duke
parents:
diff changeset
335 }
a61af66fc99e Initial load
duke
parents:
diff changeset
336 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
337 _locals_size = index + 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
338 }
a61af66fc99e Initial load
duke
parents:
diff changeset
339 }
a61af66fc99e Initial load
duke
parents:
diff changeset
340
a61af66fc99e Initial load
duke
parents:
diff changeset
341 void StackMapFrame::set_local_2(
a61af66fc99e Initial load
duke
parents:
diff changeset
342 int32_t index, VerificationType type1, VerificationType type2, TRAPS) {
a61af66fc99e Initial load
duke
parents:
diff changeset
343 assert(type1.is_long() || type1.is_double(), "must be long/double");
a61af66fc99e Initial load
duke
parents:
diff changeset
344 assert(type2.is_long2() || type2.is_double2(), "must be long/double_2");
a61af66fc99e Initial load
duke
parents:
diff changeset
345 if (index >= _max_locals - 1) {
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
346 verifier()->verify_error(
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
347 ErrorContext::bad_local_index(_offset, index),
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
348 "Local variable table overflow");
0
a61af66fc99e Initial load
duke
parents:
diff changeset
349 return;
a61af66fc99e Initial load
duke
parents:
diff changeset
350 }
a61af66fc99e Initial load
duke
parents:
diff changeset
351 // If type at index+1 is double or long, set the next location to be unusable
a61af66fc99e Initial load
duke
parents:
diff changeset
352 if (_locals[index+1].is_double() || _locals[index+1].is_long()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
353 assert((index + 2) < _locals_size, "Local variable table overflow");
a61af66fc99e Initial load
duke
parents:
diff changeset
354 _locals[index + 2] = VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
355 }
a61af66fc99e Initial load
duke
parents:
diff changeset
356 // If type at index is double_2 or long_2, set the previous location to be unusable
a61af66fc99e Initial load
duke
parents:
diff changeset
357 if (_locals[index].is_double2() || _locals[index].is_long2()) {
a61af66fc99e Initial load
duke
parents:
diff changeset
358 assert(index >= 1, "Local variable table underflow");
a61af66fc99e Initial load
duke
parents:
diff changeset
359 _locals[index - 1] = VerificationType::bogus_type();
a61af66fc99e Initial load
duke
parents:
diff changeset
360 }
a61af66fc99e Initial load
duke
parents:
diff changeset
361 _locals[index] = type1;
a61af66fc99e Initial load
duke
parents:
diff changeset
362 _locals[index+1] = type2;
a61af66fc99e Initial load
duke
parents:
diff changeset
363 if (index >= _locals_size - 1) {
a61af66fc99e Initial load
duke
parents:
diff changeset
364 #ifdef ASSERT
a61af66fc99e Initial load
duke
parents:
diff changeset
365 for (int i=_locals_size; i<index; i++) {
a61af66fc99e Initial load
duke
parents:
diff changeset
366 assert(_locals[i] == VerificationType::bogus_type(),
a61af66fc99e Initial load
duke
parents:
diff changeset
367 "holes must be bogus type");
a61af66fc99e Initial load
duke
parents:
diff changeset
368 }
a61af66fc99e Initial load
duke
parents:
diff changeset
369 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
370 _locals_size = index + 2;
a61af66fc99e Initial load
duke
parents:
diff changeset
371 }
a61af66fc99e Initial load
duke
parents:
diff changeset
372 }
a61af66fc99e Initial load
duke
parents:
diff changeset
373
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
374 TypeOrigin StackMapFrame::stack_top_ctx() {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
375 return TypeOrigin::stack(_stack_size, this);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
376 }
a61af66fc99e Initial load
duke
parents:
diff changeset
377
6605
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
378 void StackMapFrame::print_on(outputStream* str) const {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
379 str->indent().print_cr("bci: @%d", _offset);
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
380 str->indent().print_cr("flags: {%s }",
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
381 flag_this_uninit() ? " flagThisUninit" : "");
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
382 str->indent().print("locals: {");
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
383 for (int32_t i = 0; i < _locals_size; ++i) {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
384 str->print(" ");
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
385 _locals[i].print_on(str);
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
386 if (i != _locals_size - 1) {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
387 str->print(",");
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
388 }
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
389 }
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
390 str->print_cr(" }");
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
391 str->indent().print("stack: {");
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
392 for (int32_t j = 0; j < _stack_size; ++j) {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
393 str->print(" ");
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
394 _stack[j].print_on(str);
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
395 if (j != _stack_size - 1) {
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
396 str->print(",");
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
397 }
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
398 }
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
399 str->print_cr(" }");
4ee06e614636 7116786: RFE: Detailed information on VerifyErrors
kamg
parents: 2477
diff changeset
400 }