1 /*
2 * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
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 *
115 } else if (from->is_uninitialized()) {
116 set_bci(from->bci());
117 }
118 }
119
120 size_t size() const {
121 return calculate_size(tag());
122 }
123
124 verification_type_info* next() {
125 return (verification_type_info*)((address)this + size());
126 }
127
128 // This method is used when reading unverified data in order to ensure
129 // that we don't read past a particular memory limit. It returns false
130 // if any part of the data structure is outside the specified memory bounds.
131 bool verify(address start, address end) {
132 return ((address)this >= start &&
133 (address)this < end &&
134 (bci_addr() + sizeof(u2) <= end ||
135 !is_object() && !is_uninitialized()));
136 }
137
138 void print_on(outputStream* st) {
139 switch (tag()) {
140 case ITEM_Top: st->print("Top"); break;
141 case ITEM_Integer: st->print("Integer"); break;
142 case ITEM_Float: st->print("Float"); break;
143 case ITEM_Double: st->print("Double"); break;
144 case ITEM_Long: st->print("Long"); break;
145 case ITEM_Null: st->print("Null"); break;
146 case ITEM_UninitializedThis:
147 st->print("UninitializedThis"); break;
148 case ITEM_Uninitialized:
149 st->print("Uninitialized[#%d]", bci()); break;
150 case ITEM_Object:
151 st->print("Object[#%d]", cpool_index()); break;
152 default:
153 assert(false, "Bad verification_type_info");
154 }
155 }
|
1 /*
2 * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
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 *
115 } else if (from->is_uninitialized()) {
116 set_bci(from->bci());
117 }
118 }
119
120 size_t size() const {
121 return calculate_size(tag());
122 }
123
124 verification_type_info* next() {
125 return (verification_type_info*)((address)this + size());
126 }
127
128 // This method is used when reading unverified data in order to ensure
129 // that we don't read past a particular memory limit. It returns false
130 // if any part of the data structure is outside the specified memory bounds.
131 bool verify(address start, address end) {
132 return ((address)this >= start &&
133 (address)this < end &&
134 (bci_addr() + sizeof(u2) <= end ||
135 (!is_object() && !is_uninitialized())));
136 }
137
138 void print_on(outputStream* st) {
139 switch (tag()) {
140 case ITEM_Top: st->print("Top"); break;
141 case ITEM_Integer: st->print("Integer"); break;
142 case ITEM_Float: st->print("Float"); break;
143 case ITEM_Double: st->print("Double"); break;
144 case ITEM_Long: st->print("Long"); break;
145 case ITEM_Null: st->print("Null"); break;
146 case ITEM_UninitializedThis:
147 st->print("UninitializedThis"); break;
148 case ITEM_Uninitialized:
149 st->print("Uninitialized[#%d]", bci()); break;
150 case ITEM_Object:
151 st->print("Object[#%d]", cpool_index()); break;
152 default:
153 assert(false, "Bad verification_type_info");
154 }
155 }
|