24 |
24 |
25 #ifndef SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP |
25 #ifndef SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP |
26 #define SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP |
26 #define SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP |
27 |
27 |
28 #include "classfile/classFileStream.hpp" |
28 #include "classfile/classFileStream.hpp" |
29 #include "memory/resourceArea.hpp" |
29 #include "classfile/symbolTable.hpp" |
|
30 #include "oops/annotations.hpp" |
|
31 #include "oops/constantPool.hpp" |
30 #include "oops/typeArrayOop.hpp" |
32 #include "oops/typeArrayOop.hpp" |
31 #include "utilities/accessFlags.hpp" |
33 #include "utilities/accessFlags.hpp" |
32 #include "classfile/symbolTable.hpp" |
34 |
33 |
35 class CompressedLineNumberWriteStream; |
34 class FieldAllocationCount; |
36 class FieldAllocationCount; |
|
37 class FieldInfo; |
35 class FieldLayoutInfo; |
38 class FieldLayoutInfo; |
36 |
39 |
37 |
40 |
38 // Parser for for .class files |
41 // Parser for for .class files |
39 // |
42 // |
313 void classfile_parse_error(const char* msg, int index, const char *name, TRAPS); |
316 void classfile_parse_error(const char* msg, int index, const char *name, TRAPS); |
314 inline void guarantee_property(bool b, const char* msg, TRAPS) { |
317 inline void guarantee_property(bool b, const char* msg, TRAPS) { |
315 if (!b) { classfile_parse_error(msg, CHECK); } |
318 if (!b) { classfile_parse_error(msg, CHECK); } |
316 } |
319 } |
317 |
320 |
318 PRAGMA_DIAG_PUSH |
321 void report_assert_property_failure(const char* msg, TRAPS); |
319 PRAGMA_FORMAT_NONLITERAL_IGNORED |
322 void report_assert_property_failure(const char* msg, int index, TRAPS); |
320 inline void assert_property(bool b, const char* msg, TRAPS) { |
323 |
|
324 inline void assert_property(bool b, const char* msg, TRAPS) { |
321 #ifdef ASSERT |
325 #ifdef ASSERT |
322 if (!b) { |
326 if (!b) { |
323 ResourceMark rm(THREAD); |
327 report_assert_property_failure(msg, THREAD); |
324 fatal(err_msg(msg, _class_name->as_C_string())); |
|
325 } |
328 } |
326 #endif |
329 #endif |
327 } |
330 } |
328 |
331 |
329 inline void assert_property(bool b, const char* msg, int index, TRAPS) { |
332 inline void assert_property(bool b, const char* msg, int index, TRAPS) { |
330 #ifdef ASSERT |
333 #ifdef ASSERT |
331 if (!b) { |
334 if (!b) { |
332 ResourceMark rm(THREAD); |
335 report_assert_property_failure(msg, index, THREAD); |
333 fatal(err_msg(msg, index, _class_name->as_C_string())); |
|
334 } |
336 } |
335 #endif |
337 #endif |
336 } |
338 } |
337 PRAGMA_DIAG_POP |
|
338 |
339 |
339 inline void check_property(bool property, const char* msg, int index, TRAPS) { |
340 inline void check_property(bool property, const char* msg, int index, TRAPS) { |
340 if (_need_verify) { |
341 if (_need_verify) { |
341 guarantee_property(property, msg, index, CHECK); |
342 guarantee_property(property, msg, index, CHECK); |
342 } else { |
343 } else { |