< prev index next >

src/hotspot/share/cds/classListParser.hpp

Print this page
*** 23,18 ***
   */
  
  #ifndef SHARE_CDS_CLASSLISTPARSER_HPP
  #define SHARE_CDS_CLASSLISTPARSER_HPP
  
  #include "utilities/exceptions.hpp"
  #include "utilities/globalDefinitions.hpp"
  #include "utilities/growableArray.hpp"
  #include "utilities/resizeableResourceHash.hpp"
  
- #define LAMBDA_PROXY_TAG "@lambda-proxy"
- #define LAMBDA_FORM_TAG  "@lambda-form-invoker"
- 
  class constantPoolHandle;
  class Thread;
  
  class CDSIndyInfo {
    GrowableArray<const char*>* _items;
--- 23,16 ---
   */
  
  #ifndef SHARE_CDS_CLASSLISTPARSER_HPP
  #define SHARE_CDS_CLASSLISTPARSER_HPP
  
+ #include "interpreter/bytecodes.hpp"
  #include "utilities/exceptions.hpp"
  #include "utilities/globalDefinitions.hpp"
  #include "utilities/growableArray.hpp"
  #include "utilities/resizeableResourceHash.hpp"
  
  class constantPoolHandle;
  class Thread;
  
  class CDSIndyInfo {
    GrowableArray<const char*>* _items;

*** 65,11 ***
--- 63,18 ---
      return _items;
    }
  };
  
  class ClassListParser : public StackObj {
+   static const char* CONSTANT_POOL_TAG;
+   static const char* DYNAMIC_PROXY_TAG;
+   static const char* LAMBDA_PROXY_TAG;
+   static const char* LAMBDA_FORM_TAG;
  public:
+   static const char* CLASS_REFLECTION_DATA_TAG;
+   static const char* LOADER_NEGATIVE_CACHE_TAG;
+ 
    enum ParseMode {
      _parse_all,
      _parse_lambda_forms_invokers_only,
    };
  

*** 83,11 ***
  
      // Max number of bytes allowed per line in the classlist.
      // Theoretically Java class names could be 65535 bytes in length. Also, an input line
      // could have a very long path name up to JVM_MAXPATHLEN bytes in length. In reality,
      // 4K bytes is more than enough.
!     _max_allowed_line_len = 4096,
      _line_buf_extra       = 10, // for detecting input too long
      _line_buf_size        = _max_allowed_line_len + _line_buf_extra
    };
  
    // Use a small initial size in debug build to test resizing logic
--- 88,11 ---
  
      // Max number of bytes allowed per line in the classlist.
      // Theoretically Java class names could be 65535 bytes in length. Also, an input line
      // could have a very long path name up to JVM_MAXPATHLEN bytes in length. In reality,
      // 4K bytes is more than enough.
!     _max_allowed_line_len = 65536, // WAS 4096,
      _line_buf_extra       = 10, // for detecting input too long
      _line_buf_size        = _max_allowed_line_len + _line_buf_extra
    };
  
    // Use a small initial size in debug build to test resizing logic

*** 112,10 ***
--- 117,13 ---
    int                 _super;
    GrowableArray<int>* _interfaces;
    bool                _interfaces_specified;
    const char*         _source;
    bool                _lambda_form_line;
+   bool                _constant_pool_line;
+   bool                _class_reflection_data_line;
+   bool                _loader_negative_cache_line;
    ParseMode           _parse_mode;
  
    bool parse_int_option(const char* option_name, int* value);
    bool parse_uint_option(const char* option_name, int* value);
    InstanceKlass* load_class_from_source(Symbol* class_name, TRAPS);

*** 125,18 ***
    InstanceKlass* lookup_class_by_id(int id);
    void print_specified_interfaces();
    void print_actual_interfaces(InstanceKlass *ik);
    bool is_matching_cp_entry(const constantPoolHandle &pool, int cp_index, TRAPS);
  
    void resolve_indy(JavaThread* current, Symbol* class_name_symbol);
    void resolve_indy_impl(Symbol* class_name_symbol, TRAPS);
    bool parse_one_line();
    Klass* load_current_class(Symbol* class_name_symbol, TRAPS);
  
    ClassListParser(const char* file, ParseMode _parse_mode);
    ~ClassListParser();
! 
  public:
    static int parse_classlist(const char* classlist_path, ParseMode parse_mode, TRAPS) {
      ClassListParser parser(classlist_path, parse_mode);
      return parser.parse(THREAD); // returns the number of classes loaded.
    }
--- 133,29 ---
    InstanceKlass* lookup_class_by_id(int id);
    void print_specified_interfaces();
    void print_actual_interfaces(InstanceKlass *ik);
    bool is_matching_cp_entry(const constantPoolHandle &pool, int cp_index, TRAPS);
  
+   InstanceKlass* find_builtin_class_helper(JavaThread* current, Symbol* class_name_symbol, oop class_loader_oop);
+   InstanceKlass* find_builtin_class(JavaThread* current, const char* class_name);
+ 
    void resolve_indy(JavaThread* current, Symbol* class_name_symbol);
    void resolve_indy_impl(Symbol* class_name_symbol, TRAPS);
    bool parse_one_line();
    Klass* load_current_class(Symbol* class_name_symbol, TRAPS);
+   void parse_constant_pool_tag();
+   void parse_class_reflection_data_tag();
+   void parse_dynamic_proxy_tag();
+   void parse_loader_negative_cache_tag();
  
    ClassListParser(const char* file, ParseMode _parse_mode);
    ~ClassListParser();
!   void print_diagnostic_info(outputStream* st, const char* msg, va_list ap) ATTRIBUTE_PRINTF(3, 0);
+   void print_diagnostic_info(outputStream* st, const char* msg, ...) ATTRIBUTE_PRINTF(3, 0);
+   void constant_pool_resolution_warning(const char* msg, ...) ATTRIBUTE_PRINTF(2, 0);
+   void error(const char* msg, ...) ATTRIBUTE_PRINTF(2, 0);
+   oop loader_from_type(const char* loader_name);
  public:
    static int parse_classlist(const char* classlist_path, ParseMode parse_mode, TRAPS) {
      ClassListParser parser(classlist_path, parse_mode);
      return parser.parse(THREAD); // returns the number of classes loaded.
    }

*** 145,17 ***
    static ClassListParser* instance() {
      assert(is_parsing_thread(), "call this only in the thread that created ClassListParsing::_instance");
      assert(_instance != nullptr, "must be");
      return _instance;
    }
  
    int parse(TRAPS);
    void split_tokens_by_whitespace(int offset);
    int split_at_tag_from_line();
    bool parse_at_tags();
    char* _token;
-   void error(const char* msg, ...);
    void parse_int(int* value);
    void parse_uint(int* value);
    bool try_parse_uint(int* value);
    bool skip_token(const char* option_name);
    void skip_whitespaces();
--- 164,22 ---
    static ClassListParser* instance() {
      assert(is_parsing_thread(), "call this only in the thread that created ClassListParsing::_instance");
      assert(_instance != nullptr, "must be");
      return _instance;
    }
+   static const char* lambda_proxy_tag() {
+     return LAMBDA_PROXY_TAG;
+   }
+   static const char* lambda_form_tag() {
+     return LAMBDA_FORM_TAG;
+   }
  
    int parse(TRAPS);
    void split_tokens_by_whitespace(int offset);
    int split_at_tag_from_line();
    bool parse_at_tags();
    char* _token;
    void parse_int(int* value);
    void parse_uint(int* value);
    bool try_parse_uint(int* value);
    bool skip_token(const char* option_name);
    void skip_whitespaces();
< prev index next >