author | naoto |
Tue, 09 Jul 2019 08:05:38 -0700 | |
changeset 55627 | 9c1885fb2a42 |
parent 54847 | 59ea39bb2809 |
permissions | -rw-r--r-- |
1 | 1 |
/* |
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52878
diff
changeset
|
2 |
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. |
1 | 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 |
* |
|
5547
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3820
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3820
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f4b087cbb361
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
3820
diff
changeset
|
21 |
* questions. |
1 | 22 |
* |
23 |
*/ |
|
24 |
||
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52878
diff
changeset
|
25 |
#ifndef SHARE_CLASSFILE_VERIFIER_HPP |
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52878
diff
changeset
|
26 |
#define SHARE_CLASSFILE_VERIFIER_HPP |
7397 | 27 |
|
28 |
#include "classfile/verificationType.hpp" |
|
29 |
#include "oops/klass.hpp" |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13476
diff
changeset
|
30 |
#include "oops/method.hpp" |
7397 | 31 |
#include "runtime/handles.hpp" |
30764 | 32 |
#include "utilities/exceptions.hpp" |
25955
8ccc2eddcf22
8050485: super() in a try block in a ctor causes VerifyError
hseigel
parents:
25899
diff
changeset
|
33 |
#include "utilities/growableArray.hpp" |
54308
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
34 |
#include "utilities/resourceHash.hpp" |
7397 | 35 |
|
1 | 36 |
// The verifier class |
37 |
class Verifier : AllStatic { |
|
38 |
public: |
|
5882 | 39 |
enum { |
40 |
STACKMAP_ATTRIBUTE_MAJOR_VERSION = 50, |
|
17863
d77007cf03c1
8015385: Remove RelaxAccessControlCheck for JDK 8 bytecodes
hseigel
parents:
17370
diff
changeset
|
41 |
INVOKEDYNAMIC_MAJOR_VERSION = 51, |
48826 | 42 |
NO_RELAX_ACCESS_CTRL_CHECK_VERSION = 52, |
43 |
DYNAMICCONSTANT_MAJOR_VERSION = 55 |
|
5882 | 44 |
}; |
1 | 45 |
|
51697
49e1b21d9878
8210470: Remove unused Verifier::verify() Verifier::Mode argument
hseigel
parents:
49594
diff
changeset
|
46 |
// Verify the bytecodes for a class. |
49e1b21d9878
8210470: Remove unused Verifier::verify() Verifier::Mode argument
hseigel
parents:
49594
diff
changeset
|
47 |
static bool verify(InstanceKlass* klass, bool should_verify_class, TRAPS); |
49e1b21d9878
8210470: Remove unused Verifier::verify() Verifier::Mode argument
hseigel
parents:
49594
diff
changeset
|
48 |
|
34628
6d08ec72803b
8142976: Reimplement TraceClassInitialization with Unified Logging
mockner
parents:
33593
diff
changeset
|
49 |
static void log_end_verification(outputStream* st, const char* klassName, Symbol* exception_name, TRAPS); |
1 | 50 |
|
3820
0a8fbbe180db
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
1
diff
changeset
|
51 |
// Return false if the class is loaded by the bootstrap loader, |
0a8fbbe180db
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
1
diff
changeset
|
52 |
// or if defineClass was called requesting skipping verification |
53853 | 53 |
// -Xverify:all overrides this value |
3820
0a8fbbe180db
6830542: Performance: JVM_DefineClass already verified.
acorn
parents:
1
diff
changeset
|
54 |
static bool should_verify_for(oop class_loader, bool should_verify_class); |
1 | 55 |
|
40856
3378947a95e6
8148854: Class names "SomeClass" and "LSomeClass;" treated by JVM as an equivalent
rprotacio
parents:
38151
diff
changeset
|
56 |
// Relax certain access checks to enable some broken 1.1 apps to run on 1.2. |
3378947a95e6
8148854: Class names "SomeClass" and "LSomeClass;" treated by JVM as an equivalent
rprotacio
parents:
38151
diff
changeset
|
57 |
static bool relax_access_for(oop class_loader); |
1 | 58 |
|
38151
fffedc5e5cf8
8154110: Update class* and safepoint* logging subsystems
mockner
parents:
35219
diff
changeset
|
59 |
// Print output for class+resolve |
30616
fde3a4fee412
8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
30102
diff
changeset
|
60 |
static void trace_class_resolution(Klass* resolve_class, InstanceKlass* verify_class); |
fde3a4fee412
8076318: split verifier needs to add TraceClassResolution
hseigel
parents:
30102
diff
changeset
|
61 |
|
1 | 62 |
private: |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
40856
diff
changeset
|
63 |
static bool is_eligible_for_verification(InstanceKlass* klass, bool should_verify_class); |
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
64 |
static Symbol* inference_verify( |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
40856
diff
changeset
|
65 |
InstanceKlass* klass, char* msg, size_t msg_len, TRAPS); |
1 | 66 |
}; |
67 |
||
68 |
class RawBytecodeStream; |
|
69 |
class StackMapFrame; |
|
70 |
class StackMapTable; |
|
71 |
||
72 |
// Summary of verifier's memory usage: |
|
73 |
// StackMapTable is stack allocated. |
|
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
74 |
// StackMapFrame are resource allocated. There is only one ResourceMark |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
75 |
// for each class verification, which is created at the top level. |
1 | 76 |
// There is one mutable StackMapFrame (current_frame) which is updated |
77 |
// by abstract bytecode interpretation. frame_in_exception_handler() returns |
|
78 |
// a frame that has a mutable one-item stack (ready for pushing the |
|
79 |
// catch type exception object). All the other StackMapFrame's |
|
80 |
// are immutable (including their locals and stack arrays) after |
|
81 |
// their constructions. |
|
82 |
// locals/stack arrays in StackMapFrame are resource allocated. |
|
83 |
// locals/stack arrays can be shared between StackMapFrame's, except |
|
84 |
// the mutable StackMapFrame (current_frame). |
|
85 |
||
86 |
// These macros are used similarly to CHECK macros but also check |
|
87 |
// the status of the verifier and return if that has an error. |
|
88 |
#define CHECK_VERIFY(verifier) \ |
|
18073
f02460441ddc
8014431: cleanup warnings indicated by the -Wunused-value compiler option on linux
ccheung
parents:
17863
diff
changeset
|
89 |
CHECK); if ((verifier)->has_error()) return; ((void)0 |
1 | 90 |
#define CHECK_VERIFY_(verifier, result) \ |
18073
f02460441ddc
8014431: cleanup warnings indicated by the -Wunused-value compiler option on linux
ccheung
parents:
17863
diff
changeset
|
91 |
CHECK_(result)); if ((verifier)->has_error()) return (result); ((void)0 |
1 | 92 |
|
49364
601146c66cad
8173070: Remove ValueObj class for allocation subclassing for runtime code
coleenp
parents:
48826
diff
changeset
|
93 |
class TypeOrigin { |
13476 | 94 |
private: |
95 |
typedef enum { |
|
96 |
CF_LOCALS, // Comes from the current frame locals |
|
97 |
CF_STACK, // Comes from the current frame expression stack |
|
98 |
SM_LOCALS, // Comes from stackmap locals |
|
99 |
SM_STACK, // Comes from stackmap expression stack |
|
100 |
CONST_POOL, // Comes from the constant pool |
|
101 |
SIG, // Comes from method signature |
|
102 |
IMPLICIT, // Comes implicitly from code or context |
|
103 |
BAD_INDEX, // No type, but the index is bad |
|
104 |
FRAME_ONLY, // No type, context just contains the frame |
|
105 |
NONE |
|
106 |
} Origin; |
|
107 |
||
108 |
Origin _origin; |
|
109 |
u2 _index; // local, stack, or constant pool index |
|
110 |
StackMapFrame* _frame; // source frame if CF or SM |
|
111 |
VerificationType _type; // The actual type |
|
112 |
||
113 |
TypeOrigin( |
|
114 |
Origin origin, u2 index, StackMapFrame* frame, VerificationType type) |
|
115 |
: _origin(origin), _index(index), _frame(frame), _type(type) {} |
|
116 |
||
117 |
public: |
|
118 |
TypeOrigin() : _origin(NONE), _index(0), _frame(NULL) {} |
|
119 |
||
120 |
static TypeOrigin null(); |
|
121 |
static TypeOrigin local(u2 index, StackMapFrame* frame); |
|
122 |
static TypeOrigin stack(u2 index, StackMapFrame* frame); |
|
123 |
static TypeOrigin sm_local(u2 index, StackMapFrame* frame); |
|
124 |
static TypeOrigin sm_stack(u2 index, StackMapFrame* frame); |
|
125 |
static TypeOrigin cp(u2 index, VerificationType vt); |
|
126 |
static TypeOrigin signature(VerificationType vt); |
|
127 |
static TypeOrigin bad_index(u2 index); |
|
128 |
static TypeOrigin implicit(VerificationType t); |
|
129 |
static TypeOrigin frame(StackMapFrame* frame); |
|
130 |
||
131 |
void reset_frame(); |
|
132 |
void details(outputStream* ss) const; |
|
133 |
void print_frame(outputStream* ss) const; |
|
134 |
const StackMapFrame* frame() const { return _frame; } |
|
135 |
bool is_valid() const { return _origin != NONE; } |
|
136 |
u2 index() const { return _index; } |
|
137 |
||
138 |
#ifdef ASSERT |
|
139 |
void print_on(outputStream* str) const; |
|
140 |
#endif |
|
141 |
}; |
|
142 |
||
49364
601146c66cad
8173070: Remove ValueObj class for allocation subclassing for runtime code
coleenp
parents:
48826
diff
changeset
|
143 |
class ErrorContext { |
13476 | 144 |
private: |
145 |
typedef enum { |
|
146 |
INVALID_BYTECODE, // There was a problem with the bytecode |
|
147 |
WRONG_TYPE, // Type value was not as expected |
|
148 |
FLAGS_MISMATCH, // Frame flags are not assignable |
|
149 |
BAD_CP_INDEX, // Invalid constant pool index |
|
150 |
BAD_LOCAL_INDEX, // Invalid local index |
|
151 |
LOCALS_SIZE_MISMATCH, // Frames have differing local counts |
|
152 |
STACK_SIZE_MISMATCH, // Frames have different stack sizes |
|
153 |
STACK_OVERFLOW, // Attempt to push onto a full expression stack |
|
154 |
STACK_UNDERFLOW, // Attempt to pop and empty expression stack |
|
155 |
MISSING_STACKMAP, // No stackmap for this location and there should be |
|
156 |
BAD_STACKMAP, // Format error in stackmap |
|
157 |
NO_FAULT, // No error |
|
158 |
UNKNOWN |
|
159 |
} FaultType; |
|
160 |
||
161 |
int _bci; |
|
162 |
FaultType _fault; |
|
163 |
TypeOrigin _type; |
|
164 |
TypeOrigin _expected; |
|
165 |
||
166 |
ErrorContext(int bci, FaultType fault) : |
|
167 |
_bci(bci), _fault(fault) {} |
|
168 |
ErrorContext(int bci, FaultType fault, TypeOrigin type) : |
|
169 |
_bci(bci), _fault(fault), _type(type) {} |
|
170 |
ErrorContext(int bci, FaultType fault, TypeOrigin type, TypeOrigin exp) : |
|
171 |
_bci(bci), _fault(fault), _type(type), _expected(exp) {} |
|
172 |
||
173 |
public: |
|
174 |
ErrorContext() : _bci(-1), _fault(NO_FAULT) {} |
|
175 |
||
176 |
static ErrorContext bad_code(u2 bci) { |
|
177 |
return ErrorContext(bci, INVALID_BYTECODE); |
|
178 |
} |
|
179 |
static ErrorContext bad_type(u2 bci, TypeOrigin type) { |
|
180 |
return ErrorContext(bci, WRONG_TYPE, type); |
|
181 |
} |
|
182 |
static ErrorContext bad_type(u2 bci, TypeOrigin type, TypeOrigin exp) { |
|
183 |
return ErrorContext(bci, WRONG_TYPE, type, exp); |
|
184 |
} |
|
185 |
static ErrorContext bad_flags(u2 bci, StackMapFrame* frame) { |
|
186 |
return ErrorContext(bci, FLAGS_MISMATCH, TypeOrigin::frame(frame)); |
|
187 |
} |
|
188 |
static ErrorContext bad_flags(u2 bci, StackMapFrame* cur, StackMapFrame* sm) { |
|
189 |
return ErrorContext(bci, FLAGS_MISMATCH, |
|
190 |
TypeOrigin::frame(cur), TypeOrigin::frame(sm)); |
|
191 |
} |
|
192 |
static ErrorContext bad_cp_index(u2 bci, u2 index) { |
|
193 |
return ErrorContext(bci, BAD_CP_INDEX, TypeOrigin::bad_index(index)); |
|
194 |
} |
|
195 |
static ErrorContext bad_local_index(u2 bci, u2 index) { |
|
196 |
return ErrorContext(bci, BAD_LOCAL_INDEX, TypeOrigin::bad_index(index)); |
|
197 |
} |
|
198 |
static ErrorContext locals_size_mismatch( |
|
199 |
u2 bci, StackMapFrame* frame0, StackMapFrame* frame1) { |
|
200 |
return ErrorContext(bci, LOCALS_SIZE_MISMATCH, |
|
201 |
TypeOrigin::frame(frame0), TypeOrigin::frame(frame1)); |
|
202 |
} |
|
203 |
static ErrorContext stack_size_mismatch( |
|
204 |
u2 bci, StackMapFrame* frame0, StackMapFrame* frame1) { |
|
205 |
return ErrorContext(bci, STACK_SIZE_MISMATCH, |
|
206 |
TypeOrigin::frame(frame0), TypeOrigin::frame(frame1)); |
|
207 |
} |
|
208 |
static ErrorContext stack_overflow(u2 bci, StackMapFrame* frame) { |
|
209 |
return ErrorContext(bci, STACK_OVERFLOW, TypeOrigin::frame(frame)); |
|
210 |
} |
|
211 |
static ErrorContext stack_underflow(u2 bci, StackMapFrame* frame) { |
|
212 |
return ErrorContext(bci, STACK_UNDERFLOW, TypeOrigin::frame(frame)); |
|
213 |
} |
|
214 |
static ErrorContext missing_stackmap(u2 bci) { |
|
215 |
return ErrorContext(bci, MISSING_STACKMAP); |
|
216 |
} |
|
217 |
static ErrorContext bad_stackmap(int index, StackMapFrame* frame) { |
|
218 |
return ErrorContext(0, BAD_STACKMAP, TypeOrigin::frame(frame)); |
|
219 |
} |
|
220 |
||
221 |
bool is_valid() const { return _fault != NO_FAULT; } |
|
222 |
int bci() const { return _bci; } |
|
223 |
||
224 |
void reset_frames() { |
|
225 |
_type.reset_frame(); |
|
226 |
_expected.reset_frame(); |
|
227 |
} |
|
228 |
||
17370
59a0620561fa
8003557: NPG: Klass* const k should be const Klass* k.
minqi
parents:
13728
diff
changeset
|
229 |
void details(outputStream* ss, const Method* method) const; |
13476 | 230 |
|
231 |
#ifdef ASSERT |
|
232 |
void print_on(outputStream* str) const { |
|
233 |
str->print("error_context(%d, %d,", _bci, _fault); |
|
234 |
_type.print_on(str); |
|
235 |
str->print(","); |
|
236 |
_expected.print_on(str); |
|
237 |
str->print(")"); |
|
238 |
} |
|
239 |
#endif |
|
240 |
||
241 |
private: |
|
17370
59a0620561fa
8003557: NPG: Klass* const k should be const Klass* k.
minqi
parents:
13728
diff
changeset
|
242 |
void location_details(outputStream* ss, const Method* method) const; |
13476 | 243 |
void reason_details(outputStream* ss) const; |
244 |
void frame_details(outputStream* ss) const; |
|
17370
59a0620561fa
8003557: NPG: Klass* const k should be const Klass* k.
minqi
parents:
13728
diff
changeset
|
245 |
void bytecode_details(outputStream* ss, const Method* method) const; |
59a0620561fa
8003557: NPG: Klass* const k should be const Klass* k.
minqi
parents:
13728
diff
changeset
|
246 |
void handler_details(outputStream* ss, const Method* method) const; |
59a0620561fa
8003557: NPG: Klass* const k should be const Klass* k.
minqi
parents:
13728
diff
changeset
|
247 |
void stackmap_details(outputStream* ss, const Method* method) const; |
13476 | 248 |
}; |
249 |
||
54308
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
250 |
class sig_as_verification_types : public ResourceObj { |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
251 |
private: |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
252 |
int _num_args; // Number of arguments, not including return type. |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
253 |
GrowableArray<VerificationType>* _sig_verif_types; |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
254 |
|
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
255 |
public: |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
256 |
|
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
257 |
sig_as_verification_types(GrowableArray<VerificationType>* sig_verif_types) : |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
258 |
_num_args(0), _sig_verif_types(sig_verif_types) { |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
259 |
} |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
260 |
|
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
261 |
int num_args() const { return _num_args; } |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
262 |
void set_num_args(int num_args) { _num_args = num_args; } |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
263 |
|
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
264 |
GrowableArray<VerificationType>* sig_verif_types() { return _sig_verif_types; } |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
265 |
void set_sig_verif_types(GrowableArray<VerificationType>* sig_verif_types) { |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
266 |
_sig_verif_types = sig_verif_types; |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
267 |
} |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
268 |
|
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
269 |
}; |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
270 |
|
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
271 |
// This hashtable is indexed by the Utf8 constant pool indexes pointed to |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
272 |
// by constant pool (Interface)Method_refs' NameAndType signature entries. |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
273 |
typedef ResourceHashtable<int, sig_as_verification_types*, |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
274 |
primitive_hash<int>, primitive_equals<int>, 1007> |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
275 |
method_signatures_table_type; |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
276 |
|
1 | 277 |
// A new instance of this class is created for each class being verified |
278 |
class ClassVerifier : public StackObj { |
|
279 |
private: |
|
280 |
Thread* _thread; |
|
54133
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
281 |
|
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
282 |
Symbol* _previous_symbol; // cache of the previously looked up symbol |
13476 | 283 |
GrowableArray<Symbol*>* _symbols; // keep a list of symbols created |
284 |
||
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
285 |
Symbol* _exception_type; |
1 | 286 |
char* _message; |
13476 | 287 |
|
54308
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
288 |
method_signatures_table_type* _method_signatures_table; |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
289 |
|
13476 | 290 |
ErrorContext _error_context; // contains information about an error |
1 | 291 |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
30768
diff
changeset
|
292 |
void verify_method(const methodHandle& method, TRAPS); |
35194
7151995ee79e
8144256: compiler/uncommontrap/TestStackBangRbp.java crashes VM on Solaris
coleenp
parents:
34628
diff
changeset
|
293 |
char* generate_code_data(const methodHandle& m, u4 code_length, TRAPS); |
13476 | 294 |
void verify_exception_handler_table(u4 code_length, char* code_data, |
295 |
int& min, int& max, TRAPS); |
|
1 | 296 |
void verify_local_variable_table(u4 code_length, char* code_data, TRAPS); |
297 |
||
298 |
VerificationType cp_ref_index_to_type( |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
30768
diff
changeset
|
299 |
int index, const constantPoolHandle& cp, TRAPS) { |
1 | 300 |
return cp_index_to_type(cp->klass_ref_index_at(index), cp, THREAD); |
301 |
} |
|
302 |
||
303 |
bool is_protected_access( |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
40856
diff
changeset
|
304 |
InstanceKlass* this_class, Klass* target_class, |
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
305 |
Symbol* field_name, Symbol* field_sig, bool is_method); |
1 | 306 |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
30768
diff
changeset
|
307 |
void verify_cp_index(u2 bci, const constantPoolHandle& cp, int index, TRAPS); |
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
30768
diff
changeset
|
308 |
void verify_cp_type(u2 bci, int index, const constantPoolHandle& cp, |
13476 | 309 |
unsigned int types, TRAPS); |
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
30768
diff
changeset
|
310 |
void verify_cp_class_type(u2 bci, int index, const constantPoolHandle& cp, TRAPS); |
1 | 311 |
|
312 |
u2 verify_stackmap_table( |
|
313 |
u2 stackmap_index, u2 bci, StackMapFrame* current_frame, |
|
314 |
StackMapTable* stackmap_table, bool no_control_flow, TRAPS); |
|
315 |
||
316 |
void verify_exception_handler_targets( |
|
317 |
u2 bci, bool this_uninit, StackMapFrame* current_frame, |
|
318 |
StackMapTable* stackmap_table, TRAPS); |
|
319 |
||
320 |
void verify_ldc( |
|
321 |
int opcode, u2 index, StackMapFrame *current_frame, |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
30768
diff
changeset
|
322 |
const constantPoolHandle& cp, u2 bci, TRAPS); |
1 | 323 |
|
324 |
void verify_switch( |
|
325 |
RawBytecodeStream* bcs, u4 code_length, char* code_data, |
|
326 |
StackMapFrame* current_frame, StackMapTable* stackmap_table, TRAPS); |
|
327 |
||
328 |
void verify_field_instructions( |
|
329 |
RawBytecodeStream* bcs, StackMapFrame* current_frame, |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
30768
diff
changeset
|
330 |
const constantPoolHandle& cp, bool allow_arrays, TRAPS); |
1 | 331 |
|
332 |
void verify_invoke_init( |
|
13476 | 333 |
RawBytecodeStream* bcs, u2 ref_index, VerificationType ref_class_type, |
28512
968fe01e1f82
8058982: Better verification of an exceptional invokespecial
hseigel
parents:
26928
diff
changeset
|
334 |
StackMapFrame* current_frame, u4 code_length, bool in_try_block, |
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
30768
diff
changeset
|
335 |
bool* this_uninit, const constantPoolHandle& cp, StackMapTable* stackmap_table, |
28512
968fe01e1f82
8058982: Better verification of an exceptional invokespecial
hseigel
parents:
26928
diff
changeset
|
336 |
TRAPS); |
1 | 337 |
|
30102
d932845db0fe
8075118: JVM stuck in infinite loop during verification
hseigel
parents:
28652
diff
changeset
|
338 |
// Used by ends_in_athrow() to push all handlers that contain bci onto the |
d932845db0fe
8075118: JVM stuck in infinite loop during verification
hseigel
parents:
28652
diff
changeset
|
339 |
// handler_stack, if the handler has not already been pushed on the stack. |
25955
8ccc2eddcf22
8050485: super() in a try block in a ctor causes VerifyError
hseigel
parents:
25899
diff
changeset
|
340 |
void push_handlers(ExceptionTable* exhandlers, |
30102
d932845db0fe
8075118: JVM stuck in infinite loop during verification
hseigel
parents:
28652
diff
changeset
|
341 |
GrowableArray<u4>* handler_list, |
25955
8ccc2eddcf22
8050485: super() in a try block in a ctor causes VerifyError
hseigel
parents:
25899
diff
changeset
|
342 |
GrowableArray<u4>* handler_stack, |
8ccc2eddcf22
8050485: super() in a try block in a ctor causes VerifyError
hseigel
parents:
25899
diff
changeset
|
343 |
u4 bci); |
8ccc2eddcf22
8050485: super() in a try block in a ctor causes VerifyError
hseigel
parents:
25899
diff
changeset
|
344 |
|
8ccc2eddcf22
8050485: super() in a try block in a ctor causes VerifyError
hseigel
parents:
25899
diff
changeset
|
345 |
// Returns true if all paths starting with start_bc_offset end in athrow |
8ccc2eddcf22
8050485: super() in a try block in a ctor causes VerifyError
hseigel
parents:
25899
diff
changeset
|
346 |
// bytecode or loop. |
8ccc2eddcf22
8050485: super() in a try block in a ctor causes VerifyError
hseigel
parents:
25899
diff
changeset
|
347 |
bool ends_in_athrow(u4 start_bc_offset); |
8ccc2eddcf22
8050485: super() in a try block in a ctor causes VerifyError
hseigel
parents:
25899
diff
changeset
|
348 |
|
1 | 349 |
void verify_invoke_instructions( |
350 |
RawBytecodeStream* bcs, u4 code_length, StackMapFrame* current_frame, |
|
28512
968fe01e1f82
8058982: Better verification of an exceptional invokespecial
hseigel
parents:
26928
diff
changeset
|
351 |
bool in_try_block, bool* this_uninit, VerificationType return_type, |
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
30768
diff
changeset
|
352 |
const constantPoolHandle& cp, StackMapTable* stackmap_table, TRAPS); |
1 | 353 |
|
354 |
VerificationType get_newarray_type(u2 index, u2 bci, TRAPS); |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
30768
diff
changeset
|
355 |
void verify_anewarray(u2 bci, u2 index, const constantPoolHandle& cp, |
13476 | 356 |
StackMapFrame* current_frame, TRAPS); |
1 | 357 |
void verify_return_value( |
13476 | 358 |
VerificationType return_type, VerificationType type, u2 offset, |
359 |
StackMapFrame* current_frame, TRAPS); |
|
1 | 360 |
|
361 |
void verify_iload (u2 index, StackMapFrame* current_frame, TRAPS); |
|
362 |
void verify_lload (u2 index, StackMapFrame* current_frame, TRAPS); |
|
363 |
void verify_fload (u2 index, StackMapFrame* current_frame, TRAPS); |
|
364 |
void verify_dload (u2 index, StackMapFrame* current_frame, TRAPS); |
|
365 |
void verify_aload (u2 index, StackMapFrame* current_frame, TRAPS); |
|
366 |
void verify_istore(u2 index, StackMapFrame* current_frame, TRAPS); |
|
367 |
void verify_lstore(u2 index, StackMapFrame* current_frame, TRAPS); |
|
368 |
void verify_fstore(u2 index, StackMapFrame* current_frame, TRAPS); |
|
369 |
void verify_dstore(u2 index, StackMapFrame* current_frame, TRAPS); |
|
370 |
void verify_astore(u2 index, StackMapFrame* current_frame, TRAPS); |
|
371 |
void verify_iinc (u2 index, StackMapFrame* current_frame, TRAPS); |
|
372 |
||
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
40856
diff
changeset
|
373 |
bool name_in_supers(Symbol* ref_name, InstanceKlass* current); |
1 | 374 |
|
7380
041cf7f1cce6
6865028: Illegal instructions passing verification prior to 'invokespecial Object.<init>'
kamg
parents:
5882
diff
changeset
|
375 |
VerificationType object_type() const; |
041cf7f1cce6
6865028: Illegal instructions passing verification prior to 'invokespecial Object.<init>'
kamg
parents:
5882
diff
changeset
|
376 |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
40856
diff
changeset
|
377 |
InstanceKlass* _klass; // the class being verified |
1 | 378 |
methodHandle _method; // current method being verified |
379 |
VerificationType _this_type; // the verification type of the current class |
|
380 |
||
5693 | 381 |
// Some recursive calls from the verifier to the name resolver |
382 |
// can cause the current class to be re-verified and rewritten. |
|
383 |
// If this happens, the original verification should not continue, |
|
384 |
// because constant pool indexes will have changed. |
|
385 |
// The rewriter is preceded by the verifier. If the verifier throws |
|
386 |
// an error, rewriting is prevented. Also, rewriting always precedes |
|
387 |
// bytecode execution or compilation. Thus, is_rewritten implies |
|
388 |
// that a class has been verified and prepared for execution. |
|
389 |
bool was_recursively_verified() { return _klass->is_rewritten(); } |
|
390 |
||
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
40856
diff
changeset
|
391 |
bool is_same_or_direct_interface(InstanceKlass* klass, |
21768
b7dba4cde1c6
8026065: InterfaceMethodref for invokespecial must name a direct superinterface
hseigel
parents:
18073
diff
changeset
|
392 |
VerificationType klass_type, VerificationType ref_class_type); |
b7dba4cde1c6
8026065: InterfaceMethodref for invokespecial must name a direct superinterface
hseigel
parents:
18073
diff
changeset
|
393 |
|
1 | 394 |
public: |
395 |
enum { |
|
396 |
BYTECODE_OFFSET = 1, |
|
397 |
NEW_OFFSET = 2 |
|
398 |
}; |
|
399 |
||
400 |
// constructor |
|
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
40856
diff
changeset
|
401 |
ClassVerifier(InstanceKlass* klass, TRAPS); |
1 | 402 |
|
403 |
// destructor |
|
404 |
~ClassVerifier(); |
|
405 |
||
406 |
Thread* thread() { return _thread; } |
|
35194
7151995ee79e
8144256: compiler/uncommontrap/TestStackBangRbp.java crashes VM on Solaris
coleenp
parents:
34628
diff
changeset
|
407 |
const methodHandle& method() { return _method; } |
46329
53ccc37bda19
8155672: Remove instanceKlassHandles and KlassHandles
coleenp
parents:
40856
diff
changeset
|
408 |
InstanceKlass* current_class() const { return _klass; } |
1 | 409 |
VerificationType current_type() const { return _this_type; } |
410 |
||
411 |
// Verifies the class. If a verify or class file format error occurs, |
|
412 |
// the '_exception_name' symbols will set to the exception name and |
|
413 |
// the message_buffer will be filled in with the exception message. |
|
414 |
void verify_class(TRAPS); |
|
415 |
||
54308
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
416 |
// Translates method signature entries into verificationTypes and saves them |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
417 |
// in the growable array. |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
418 |
void translate_signature(Symbol* const method_sig, sig_as_verification_types* sig_verif_types, TRAPS); |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
419 |
|
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
420 |
// Initializes a sig_as_verification_types entry and puts it in the hash table. |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
421 |
void create_method_sig_entry(sig_as_verification_types* sig_verif_types, int sig_index, TRAPS); |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
422 |
|
1 | 423 |
// Return status modes |
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
424 |
Symbol* result() const { return _exception_type; } |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
425 |
bool has_error() const { return result() != NULL; } |
13476 | 426 |
char* exception_message() { |
427 |
stringStream ss; |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
21768
diff
changeset
|
428 |
ss.print("%s", _message); |
13476 | 429 |
_error_context.details(&ss, _method()); |
430 |
return ss.as_string(); |
|
431 |
} |
|
1 | 432 |
|
433 |
// Called when verify or class format errors are encountered. |
|
434 |
// May throw an exception based upon the mode. |
|
24424
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
21768
diff
changeset
|
435 |
void verify_error(ErrorContext ctx, const char* fmt, ...) ATTRIBUTE_PRINTF(3, 4); |
2658d7834c6e
8037816: Fix for 8036122 breaks build with Xcode5/clang
drchase
parents:
21768
diff
changeset
|
436 |
void class_format_error(const char* fmt, ...) ATTRIBUTE_PRINTF(2, 3); |
1 | 437 |
|
13728
882756847a04
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
13476
diff
changeset
|
438 |
Klass* load_class(Symbol* name, TRAPS); |
1 | 439 |
|
54308
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
440 |
method_signatures_table_type* method_signatures_table() const { |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
441 |
return _method_signatures_table; |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
442 |
} |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
443 |
|
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
444 |
void set_method_signatures_table(method_signatures_table_type* method_signatures_table) { |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
445 |
_method_signatures_table = method_signatures_table; |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
446 |
} |
1dcacbe612ae
8059357: ClassVerifier redundantly checks constant pool entries multiple times
hseigel
parents:
54133
diff
changeset
|
447 |
|
1 | 448 |
int change_sig_to_verificationType( |
54847
59ea39bb2809
8223657: Remove unused THREAD argument from SymbolTable functions
coleenp
parents:
54308
diff
changeset
|
449 |
SignatureStream* sig_type, VerificationType* inference_type); |
1 | 450 |
|
33593
60764a78fa5c
8140274: methodHandles and constantPoolHandles should be passed as const references
coleenp
parents:
30768
diff
changeset
|
451 |
VerificationType cp_index_to_type(int index, const constantPoolHandle& cp, TRAPS) { |
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
452 |
return VerificationType::reference_type(cp->klass_name_at(index)); |
1 | 453 |
} |
454 |
||
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
455 |
// Keep a list of temporary symbols created during verification because |
26928
744b310d4fdd
8057846: ClassVerifier::change_sig_to_verificationType temporary symbol creation code is hot
coleenp
parents:
25955
diff
changeset
|
456 |
// their reference counts need to be decremented when the verifier object |
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
457 |
// goes out of scope. Since these symbols escape the scope in which they're |
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
458 |
// created, we can't use a TempNewSymbol. |
54847
59ea39bb2809
8223657: Remove unused THREAD argument from SymbolTable functions
coleenp
parents:
54308
diff
changeset
|
459 |
Symbol* create_temporary_symbol(const Symbol* s, int begin, int end); |
59ea39bb2809
8223657: Remove unused THREAD argument from SymbolTable functions
coleenp
parents:
54308
diff
changeset
|
460 |
Symbol* create_temporary_symbol(const char *s, int length); |
26928
744b310d4fdd
8057846: ClassVerifier::change_sig_to_verificationType temporary symbol creation code is hot
coleenp
parents:
25955
diff
changeset
|
461 |
Symbol* create_temporary_symbol(Symbol* s) { |
54133
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
462 |
if (s == _previous_symbol) { |
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
463 |
return s; |
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
464 |
} |
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
465 |
if (!s->is_permanent()) { |
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
466 |
s->increment_refcount(); |
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
467 |
if (_symbols == NULL) { |
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
468 |
_symbols = new GrowableArray<Symbol*>(50, 0, NULL); |
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
469 |
} |
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
470 |
_symbols->push(s); |
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
471 |
} |
829bf950287e
8220366: Optimize Symbol handling in ClassVerifier and SignatureStream
redestad
parents:
53853
diff
changeset
|
472 |
_previous_symbol = s; |
26928
744b310d4fdd
8057846: ClassVerifier::change_sig_to_verificationType temporary symbol creation code is hot
coleenp
parents:
25955
diff
changeset
|
473 |
return s; |
744b310d4fdd
8057846: ClassVerifier::change_sig_to_verificationType temporary symbol creation code is hot
coleenp
parents:
25955
diff
changeset
|
474 |
} |
744b310d4fdd
8057846: ClassVerifier::change_sig_to_verificationType temporary symbol creation code is hot
coleenp
parents:
25955
diff
changeset
|
475 |
|
54847
59ea39bb2809
8223657: Remove unused THREAD argument from SymbolTable functions
coleenp
parents:
54308
diff
changeset
|
476 |
TypeOrigin ref_ctx(const char* str); |
25505 | 477 |
|
1 | 478 |
}; |
479 |
||
480 |
inline int ClassVerifier::change_sig_to_verificationType( |
|
54847
59ea39bb2809
8223657: Remove unused THREAD argument from SymbolTable functions
coleenp
parents:
54308
diff
changeset
|
481 |
SignatureStream* sig_type, VerificationType* inference_type) { |
1 | 482 |
BasicType bt = sig_type->type(); |
483 |
switch (bt) { |
|
484 |
case T_OBJECT: |
|
485 |
case T_ARRAY: |
|
486 |
{ |
|
54847
59ea39bb2809
8223657: Remove unused THREAD argument from SymbolTable functions
coleenp
parents:
54308
diff
changeset
|
487 |
Symbol* name = sig_type->as_symbol(); |
26928
744b310d4fdd
8057846: ClassVerifier::change_sig_to_verificationType temporary symbol creation code is hot
coleenp
parents:
25955
diff
changeset
|
488 |
// Create another symbol to save as signature stream unreferences this symbol. |
744b310d4fdd
8057846: ClassVerifier::change_sig_to_verificationType temporary symbol creation code is hot
coleenp
parents:
25955
diff
changeset
|
489 |
Symbol* name_copy = create_temporary_symbol(name); |
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
490 |
assert(name_copy == name, "symbols don't match"); |
1 | 491 |
*inference_type = |
8076
96d498ec7ae1
6990754: Use native memory and reference counting to implement SymbolTable
coleenp
parents:
7397
diff
changeset
|
492 |
VerificationType::reference_type(name_copy); |
1 | 493 |
return 1; |
494 |
} |
|
495 |
case T_LONG: |
|
496 |
*inference_type = VerificationType::long_type(); |
|
497 |
*++inference_type = VerificationType::long2_type(); |
|
498 |
return 2; |
|
499 |
case T_DOUBLE: |
|
500 |
*inference_type = VerificationType::double_type(); |
|
501 |
*++inference_type = VerificationType::double2_type(); |
|
502 |
return 2; |
|
503 |
case T_INT: |
|
504 |
case T_BOOLEAN: |
|
505 |
case T_BYTE: |
|
506 |
case T_CHAR: |
|
507 |
case T_SHORT: |
|
508 |
*inference_type = VerificationType::integer_type(); |
|
509 |
return 1; |
|
510 |
case T_FLOAT: |
|
511 |
*inference_type = VerificationType::float_type(); |
|
512 |
return 1; |
|
513 |
default: |
|
514 |
ShouldNotReachHere(); |
|
515 |
return 1; |
|
516 |
} |
|
517 |
} |
|
7397 | 518 |
|
53244
9807daeb47c4
8216167: Update include guards to reflect correct directories
coleenp
parents:
52878
diff
changeset
|
519 |
#endif // SHARE_CLASSFILE_VERIFIER_HPP |