< prev index next >

src/hotspot/share/cds/classListParser.hpp

Print this page

 53     case JVM_REF_putStatic        : _items->append("REF_putStatic"); break;
 54     case JVM_REF_invokeVirtual    : _items->append("REF_invokeVirtual"); break;
 55     case JVM_REF_invokeStatic     : _items->append("REF_invokeStatic"); break;
 56     case JVM_REF_invokeSpecial    : _items->append("REF_invokeSpecial"); break;
 57     case JVM_REF_newInvokeSpecial : _items->append("REF_newInvokeSpecial"); break;
 58     case JVM_REF_invokeInterface  : _items->append("REF_invokeInterface"); break;
 59     default                       : ShouldNotReachHere();
 60     }
 61   }
 62   GrowableArray<const char*>* items() {
 63     return _items;
 64   }
 65 };
 66 
 67 class ClassListParser : public StackObj {
 68   static const char* CONSTANT_POOL_TAG;
 69   static const char* LAMBDA_FORM_TAG;
 70   static const char* LAMBDA_PROXY_TAG;
 71 
 72 public:


 73   enum ParseMode {
 74     _parse_all,
 75     _parse_lambda_forms_invokers_only,
 76   };
 77 
 78 private:
 79   // Must be C_HEAP allocated -- we don't want nested resource allocations.
 80   typedef ResizeableHashTable<int, InstanceKlass*,
 81                                       AnyObj::C_HEAP, mtClassShared> ID2KlassTable;
 82 
 83   enum {
 84     _unspecified      = -999,
 85   };
 86 
 87   // Use a small initial size in debug build to test resizing logic
 88   static const int INITIAL_TABLE_SIZE = DEBUG_ONLY(17) NOT_DEBUG(1987);
 89   static const int MAX_TABLE_SIZE = 61333;
 90   static volatile Thread* _parsing_thread; // the thread that created _instance
 91   static ClassListParser* _instance; // the singleton.
 92   const char* _classlist_file;

111   bool parse_uint_option(const char* option_name, int* value);
112   InstanceKlass* load_class_from_source(Symbol* class_name, TRAPS);
113   ID2KlassTable* id2klass_table() {
114     return &_id2klass_table;
115   }
116   InstanceKlass* lookup_class_by_id(int id);
117   void print_specified_interfaces();
118   void print_actual_interfaces(InstanceKlass *ik);
119   bool is_matching_cp_entry(const constantPoolHandle &pool, int cp_index, TRAPS);
120 
121   InstanceKlass* find_builtin_class_helper(JavaThread* current, Symbol* class_name_symbol, oop class_loader_oop);
122   InstanceKlass* find_builtin_class(JavaThread* current, const char* class_name);
123 
124   void resolve_indy(JavaThread* current, Symbol* class_name_symbol);
125   void resolve_indy_impl(Symbol* class_name_symbol, TRAPS);
126   void clean_up_input_line();
127   void read_class_name_and_attributes();
128   void parse_class_name_and_attributes(TRAPS);
129   Klass* load_current_class(Symbol* class_name_symbol, TRAPS);
130   void parse_constant_pool_tag();

131 
132   size_t lineno() { return _input_stream.lineno(); }
133   FILE* do_open(const char* file);
134   ClassListParser(const char* file, ParseMode _parse_mode);
135   ~ClassListParser();
136   void print_diagnostic_info(outputStream* st, const char* msg, va_list ap) ATTRIBUTE_PRINTF(3, 0);
137   void print_diagnostic_info(outputStream* st, const char* msg, ...) ATTRIBUTE_PRINTF(3, 0);
138   void constant_pool_resolution_warning(const char* msg, ...) ATTRIBUTE_PRINTF(2, 0);
139   void error(const char* msg, ...) ATTRIBUTE_PRINTF(2, 0);
140   GrowableArray<InstanceKlass*> get_specified_interfaces();
141   void check_supertype_obstruction(int specified_supertype_id, const InstanceKlass* specified_supertype, TRAPS);
142 
143 public:
144   static void parse_classlist(const char* classlist_path, ParseMode parse_mode, TRAPS);
145 
146   static bool is_parsing_thread();
147   static ClassListParser* instance() {
148     assert(is_parsing_thread(), "call this only in the thread that created ClassListParsing::_instance");
149     assert(_instance != nullptr, "must be");
150     return _instance;

 53     case JVM_REF_putStatic        : _items->append("REF_putStatic"); break;
 54     case JVM_REF_invokeVirtual    : _items->append("REF_invokeVirtual"); break;
 55     case JVM_REF_invokeStatic     : _items->append("REF_invokeStatic"); break;
 56     case JVM_REF_invokeSpecial    : _items->append("REF_invokeSpecial"); break;
 57     case JVM_REF_newInvokeSpecial : _items->append("REF_newInvokeSpecial"); break;
 58     case JVM_REF_invokeInterface  : _items->append("REF_invokeInterface"); break;
 59     default                       : ShouldNotReachHere();
 60     }
 61   }
 62   GrowableArray<const char*>* items() {
 63     return _items;
 64   }
 65 };
 66 
 67 class ClassListParser : public StackObj {
 68   static const char* CONSTANT_POOL_TAG;
 69   static const char* LAMBDA_FORM_TAG;
 70   static const char* LAMBDA_PROXY_TAG;
 71 
 72 public:
 73   static const char* LOADER_NEGATIVE_CACHE_TAG;
 74 
 75   enum ParseMode {
 76     _parse_all,
 77     _parse_lambda_forms_invokers_only,
 78   };
 79 
 80 private:
 81   // Must be C_HEAP allocated -- we don't want nested resource allocations.
 82   typedef ResizeableHashTable<int, InstanceKlass*,
 83                                       AnyObj::C_HEAP, mtClassShared> ID2KlassTable;
 84 
 85   enum {
 86     _unspecified      = -999,
 87   };
 88 
 89   // Use a small initial size in debug build to test resizing logic
 90   static const int INITIAL_TABLE_SIZE = DEBUG_ONLY(17) NOT_DEBUG(1987);
 91   static const int MAX_TABLE_SIZE = 61333;
 92   static volatile Thread* _parsing_thread; // the thread that created _instance
 93   static ClassListParser* _instance; // the singleton.
 94   const char* _classlist_file;

113   bool parse_uint_option(const char* option_name, int* value);
114   InstanceKlass* load_class_from_source(Symbol* class_name, TRAPS);
115   ID2KlassTable* id2klass_table() {
116     return &_id2klass_table;
117   }
118   InstanceKlass* lookup_class_by_id(int id);
119   void print_specified_interfaces();
120   void print_actual_interfaces(InstanceKlass *ik);
121   bool is_matching_cp_entry(const constantPoolHandle &pool, int cp_index, TRAPS);
122 
123   InstanceKlass* find_builtin_class_helper(JavaThread* current, Symbol* class_name_symbol, oop class_loader_oop);
124   InstanceKlass* find_builtin_class(JavaThread* current, const char* class_name);
125 
126   void resolve_indy(JavaThread* current, Symbol* class_name_symbol);
127   void resolve_indy_impl(Symbol* class_name_symbol, TRAPS);
128   void clean_up_input_line();
129   void read_class_name_and_attributes();
130   void parse_class_name_and_attributes(TRAPS);
131   Klass* load_current_class(Symbol* class_name_symbol, TRAPS);
132   void parse_constant_pool_tag();
133   void parse_loader_negative_cache_tag();
134 
135   size_t lineno() { return _input_stream.lineno(); }
136   FILE* do_open(const char* file);
137   ClassListParser(const char* file, ParseMode _parse_mode);
138   ~ClassListParser();
139   void print_diagnostic_info(outputStream* st, const char* msg, va_list ap) ATTRIBUTE_PRINTF(3, 0);
140   void print_diagnostic_info(outputStream* st, const char* msg, ...) ATTRIBUTE_PRINTF(3, 0);
141   void constant_pool_resolution_warning(const char* msg, ...) ATTRIBUTE_PRINTF(2, 0);
142   void error(const char* msg, ...) ATTRIBUTE_PRINTF(2, 0);
143   GrowableArray<InstanceKlass*> get_specified_interfaces();
144   void check_supertype_obstruction(int specified_supertype_id, const InstanceKlass* specified_supertype, TRAPS);
145 
146 public:
147   static void parse_classlist(const char* classlist_path, ParseMode parse_mode, TRAPS);
148 
149   static bool is_parsing_thread();
150   static ClassListParser* instance() {
151     assert(is_parsing_thread(), "call this only in the thread that created ClassListParsing::_instance");
152     assert(_instance != nullptr, "must be");
153     return _instance;
< prev index next >