Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8324584

Optimize Symbol and char* handling in ClassLoader

XMLWordPrintable

    • b11

      We have:

      ClassLoader::load_class(Symbol* name, bool search_append_only, TRAPS) {

      then:

      const char* const class_name = name->as_C_string();

      then

       stream = search_module_entries(THREAD, XXXX, class_name, file_name);

      where:

      ClassFileStream* ClassLoader::search_module_entries(JavaThread* current,
                                                          const GrowableArray<ModuleClassPathList*>* const module_list,
                                                          const char* const class_name,
                                                          const char* const file_name) {
        ClassFileStream* stream = nullptr;

        // Find the class' defining module in the boot loader's module entry table
        TempNewSymbol class_name_symbol = SymbolTable::new_symbol(class_name);

      So we started with a Symbol, converted it to char* and passed it to a function that turned it back into a Symbol! We could just pass the original Symbol directly.

            matsaave Matias Saavedra Silva
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: