< prev index next >

src/share/vm/classfile/classFileParser.hpp

Print this page




  30 #include "oops/oop.inline.hpp"
  31 #include "oops/typeArrayOop.hpp"
  32 #include "runtime/handles.inline.hpp"
  33 #include "utilities/accessFlags.hpp"
  34 #include "classfile/symbolTable.hpp"
  35 
  36 class FieldAllocationCount;
  37 class FieldLayoutInfo;
  38 
  39 
  40 // Parser for for .class files
  41 //
  42 // The bytes describing the class file structure is read from a Stream object
  43 
  44 class ClassFileParser VALUE_OBJ_CLASS_SPEC {
  45  private:
  46   bool _need_verify;
  47   bool _relax_verify;
  48   u2   _major_version;
  49   u2   _minor_version;

  50   Symbol* _class_name;
  51   ClassLoaderData* _loader_data;
  52   KlassHandle _host_klass;
  53   GrowableArray<Handle>* _cp_patches; // overrides for CP entries
  54 
  55   // precomputed flags
  56   bool _has_finalizer;
  57   bool _has_empty_finalizer;
  58   bool _has_vanilla_constructor;
  59   int _max_bootstrap_specifier_index;  // detects BSS values
  60 
  61   // class attributes parsed before the instance klass is created:
  62   bool       _synthetic_flag;
  63   int        _sde_length;
  64   char*      _sde_buffer;
  65   u2         _sourcefile_index;
  66   u2         _generic_signature_index;
  67 
  68   // Metadata created before the instance klass is created.  Must be deallocated
  69   // if not transferred to the InstanceKlass upon successful class loading


 474                                      TempNewSymbol& parsed_name,
 475                                      bool verify,
 476                                      TRAPS) {
 477     KlassHandle no_host_klass;
 478     return parseClassFile(name, loader_data, protection_domain, no_host_klass, NULL, parsed_name, verify, THREAD);
 479   }
 480   instanceKlassHandle parseClassFile(Symbol* name,
 481                                      ClassLoaderData* loader_data,
 482                                      Handle protection_domain,
 483                                      KlassHandle host_klass,
 484                                      GrowableArray<Handle>* cp_patches,
 485                                      TempNewSymbol& parsed_name,
 486                                      bool verify,
 487                                      TRAPS);
 488 
 489   // Verifier checks
 490   static void check_super_class_access(instanceKlassHandle this_klass, TRAPS);
 491   static void check_super_interface_access(instanceKlassHandle this_klass, TRAPS);
 492   static void check_final_method_override(instanceKlassHandle this_klass, TRAPS);
 493   static void check_illegal_static_method(instanceKlassHandle this_klass, TRAPS);







 494 };
 495 
 496 #endif // SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP


  30 #include "oops/oop.inline.hpp"
  31 #include "oops/typeArrayOop.hpp"
  32 #include "runtime/handles.inline.hpp"
  33 #include "utilities/accessFlags.hpp"
  34 #include "classfile/symbolTable.hpp"
  35 
  36 class FieldAllocationCount;
  37 class FieldLayoutInfo;
  38 
  39 
  40 // Parser for for .class files
  41 //
  42 // The bytes describing the class file structure is read from a Stream object
  43 
  44 class ClassFileParser VALUE_OBJ_CLASS_SPEC {
  45  private:
  46   bool _need_verify;
  47   bool _relax_verify;
  48   u2   _major_version;
  49   u2   _minor_version;
  50   u2   _this_class_index;
  51   Symbol* _class_name;
  52   ClassLoaderData* _loader_data;
  53   KlassHandle _host_klass;
  54   GrowableArray<Handle>* _cp_patches; // overrides for CP entries
  55 
  56   // precomputed flags
  57   bool _has_finalizer;
  58   bool _has_empty_finalizer;
  59   bool _has_vanilla_constructor;
  60   int _max_bootstrap_specifier_index;  // detects BSS values
  61 
  62   // class attributes parsed before the instance klass is created:
  63   bool       _synthetic_flag;
  64   int        _sde_length;
  65   char*      _sde_buffer;
  66   u2         _sourcefile_index;
  67   u2         _generic_signature_index;
  68 
  69   // Metadata created before the instance klass is created.  Must be deallocated
  70   // if not transferred to the InstanceKlass upon successful class loading


 475                                      TempNewSymbol& parsed_name,
 476                                      bool verify,
 477                                      TRAPS) {
 478     KlassHandle no_host_klass;
 479     return parseClassFile(name, loader_data, protection_domain, no_host_klass, NULL, parsed_name, verify, THREAD);
 480   }
 481   instanceKlassHandle parseClassFile(Symbol* name,
 482                                      ClassLoaderData* loader_data,
 483                                      Handle protection_domain,
 484                                      KlassHandle host_klass,
 485                                      GrowableArray<Handle>* cp_patches,
 486                                      TempNewSymbol& parsed_name,
 487                                      bool verify,
 488                                      TRAPS);
 489 
 490   // Verifier checks
 491   static void check_super_class_access(instanceKlassHandle this_klass, TRAPS);
 492   static void check_super_interface_access(instanceKlassHandle this_klass, TRAPS);
 493   static void check_final_method_override(instanceKlassHandle this_klass, TRAPS);
 494   static void check_illegal_static_method(instanceKlassHandle this_klass, TRAPS);
 495 
 496   u2 this_class_index() const { return _this_class_index; }
 497 
 498 #if INCLUDE_JFR
 499   ClassFileStream* clone_stream() const;
 500   void set_klass_to_deallocate(InstanceKlass* klass);
 501 #endif // INCLUDE_JFR
 502 };
 503 
 504 #endif // SHARE_VM_CLASSFILE_CLASSFILEPARSER_HPP
< prev index next >