Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/verifier.hpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 4ee06e614636 |
children | 92ef81e2f571 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
26 #define SHARE_VM_CLASSFILE_VERIFIER_HPP | 26 #define SHARE_VM_CLASSFILE_VERIFIER_HPP |
27 | 27 |
28 #include "classfile/verificationType.hpp" | 28 #include "classfile/verificationType.hpp" |
29 #include "memory/gcLocker.hpp" | 29 #include "memory/gcLocker.hpp" |
30 #include "oops/klass.hpp" | 30 #include "oops/klass.hpp" |
31 #include "oops/methodOop.hpp" | 31 #include "oops/method.hpp" |
32 #include "runtime/handles.hpp" | 32 #include "runtime/handles.hpp" |
33 #include "utilities/exceptions.hpp" | 33 #include "utilities/exceptions.hpp" |
34 | 34 |
35 // The verifier class | 35 // The verifier class |
36 class Verifier : AllStatic { | 36 class Verifier : AllStatic { |
222 void reset_frames() { | 222 void reset_frames() { |
223 _type.reset_frame(); | 223 _type.reset_frame(); |
224 _expected.reset_frame(); | 224 _expected.reset_frame(); |
225 } | 225 } |
226 | 226 |
227 void details(outputStream* ss, methodOop method) const; | 227 void details(outputStream* ss, Method* method) const; |
228 | 228 |
229 #ifdef ASSERT | 229 #ifdef ASSERT |
230 void print_on(outputStream* str) const { | 230 void print_on(outputStream* str) const { |
231 str->print("error_context(%d, %d,", _bci, _fault); | 231 str->print("error_context(%d, %d,", _bci, _fault); |
232 _type.print_on(str); | 232 _type.print_on(str); |
235 str->print(")"); | 235 str->print(")"); |
236 } | 236 } |
237 #endif | 237 #endif |
238 | 238 |
239 private: | 239 private: |
240 void location_details(outputStream* ss, methodOop method) const; | 240 void location_details(outputStream* ss, Method* method) const; |
241 void reason_details(outputStream* ss) const; | 241 void reason_details(outputStream* ss) const; |
242 void frame_details(outputStream* ss) const; | 242 void frame_details(outputStream* ss) const; |
243 void bytecode_details(outputStream* ss, methodOop method) const; | 243 void bytecode_details(outputStream* ss, Method* method) const; |
244 void handler_details(outputStream* ss, methodOop method) const; | 244 void handler_details(outputStream* ss, Method* method) const; |
245 void stackmap_details(outputStream* ss, methodOop method) const; | 245 void stackmap_details(outputStream* ss, Method* method) const; |
246 }; | 246 }; |
247 | 247 |
248 // A new instance of this class is created for each class being verified | 248 // A new instance of this class is created for each class being verified |
249 class ClassVerifier : public StackObj { | 249 class ClassVerifier : public StackObj { |
250 private: | 250 private: |
266 int index, constantPoolHandle cp, TRAPS) { | 266 int index, constantPoolHandle cp, TRAPS) { |
267 return cp_index_to_type(cp->klass_ref_index_at(index), cp, THREAD); | 267 return cp_index_to_type(cp->klass_ref_index_at(index), cp, THREAD); |
268 } | 268 } |
269 | 269 |
270 bool is_protected_access( | 270 bool is_protected_access( |
271 instanceKlassHandle this_class, klassOop target_class, | 271 instanceKlassHandle this_class, Klass* target_class, |
272 Symbol* field_name, Symbol* field_sig, bool is_method); | 272 Symbol* field_name, Symbol* field_sig, bool is_method); |
273 | 273 |
274 void verify_cp_index(u2 bci, constantPoolHandle cp, int index, TRAPS); | 274 void verify_cp_index(u2 bci, constantPoolHandle cp, int index, TRAPS); |
275 void verify_cp_type(u2 bci, int index, constantPoolHandle cp, | 275 void verify_cp_type(u2 bci, int index, constantPoolHandle cp, |
276 unsigned int types, TRAPS); | 276 unsigned int types, TRAPS); |
378 // Called when verify or class format errors are encountered. | 378 // Called when verify or class format errors are encountered. |
379 // May throw an exception based upon the mode. | 379 // May throw an exception based upon the mode. |
380 void verify_error(ErrorContext ctx, const char* fmt, ...); | 380 void verify_error(ErrorContext ctx, const char* fmt, ...); |
381 void class_format_error(const char* fmt, ...); | 381 void class_format_error(const char* fmt, ...); |
382 | 382 |
383 klassOop load_class(Symbol* name, TRAPS); | 383 Klass* load_class(Symbol* name, TRAPS); |
384 | 384 |
385 int change_sig_to_verificationType( | 385 int change_sig_to_verificationType( |
386 SignatureStream* sig_type, VerificationType* inference_type, TRAPS); | 386 SignatureStream* sig_type, VerificationType* inference_type, TRAPS); |
387 | 387 |
388 VerificationType cp_index_to_type(int index, constantPoolHandle cp, TRAPS) { | 388 VerificationType cp_index_to_type(int index, constantPoolHandle cp, TRAPS) { |