src/hotspot/share/classfile/classListParser.cpp
author iklam
Tue, 20 Nov 2018 20:00:15 -0800
changeset 52631 3009ca99de32
parent 52514 f4e3900c8d08
child 53261 b7dca420fa0c
permissions -rw-r--r--
8213587: Speed up CDS dump time by using resizable hashtables Reviewed-by: jiangli, coleenp, gziemski
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34257
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
     1
/*
49480
d7df2dd501ce 8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents: 49393
diff changeset
     2
 * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
34257
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
     4
 *
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
     7
 * published by the Free Software Foundation.
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
     8
 *
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    13
 * accompanied this code).
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    14
 *
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    18
 *
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    21
 * questions.
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    22
 *
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    23
 */
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    24
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    25
#include "precompiled.hpp"
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    26
#include "jvm.h"
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    27
#include "jimage.hpp"
34257
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    28
#include "classfile/classListParser.hpp"
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    29
#include "classfile/classLoaderExt.hpp"
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    30
#include "classfile/symbolTable.hpp"
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    31
#include "classfile/systemDictionary.hpp"
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    32
#include "classfile/systemDictionaryShared.hpp"
49480
d7df2dd501ce 8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents: 49393
diff changeset
    33
#include "logging/log.hpp"
d7df2dd501ce 8199809: Don't include frame.inline.hpp and other.inline.hpp from .hpp files
coleenp
parents: 49393
diff changeset
    34
#include "logging/logTag.hpp"
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    35
#include "memory/metaspaceShared.hpp"
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    36
#include "memory/resourceArea.hpp"
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    37
#include "runtime/fieldType.hpp"
49393
93fe2fc5c093 8199472: Fix non-PCH build after JDK-8199319
simonis
parents: 48383
diff changeset
    38
#include "runtime/handles.inline.hpp"
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    39
#include "runtime/javaCalls.hpp"
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    40
#include "utilities/defaultStream.hpp"
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    41
#include "utilities/hashtable.inline.hpp"
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    42
#include "utilities/macros.hpp"
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    43
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    44
ClassListParser* ClassListParser::_instance = NULL;
34257
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    45
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    46
ClassListParser::ClassListParser(const char* file) {
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    47
  assert(_instance == NULL, "must be singleton");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    48
  _instance = this;
34257
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    49
  _classlist_file = file;
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    50
  _file = fopen(file, "r");
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    51
  if (_file == NULL) {
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    52
    char errmsg[JVM_MAXPATHLEN];
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    53
    os::lasterror(errmsg, JVM_MAXPATHLEN);
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    54
    vm_exit_during_initialization("Loading classlist failed", errmsg);
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    55
  }
51057
13ed0d538b89 8206470: Incorrect use of os::lasterror in ClassListParser
coleenp
parents: 50625
diff changeset
    56
  _line_no = 0;
13ed0d538b89 8206470: Incorrect use of os::lasterror in ClassListParser
coleenp
parents: 50625
diff changeset
    57
  _interfaces = new (ResourceObj::C_HEAP, mtClass) GrowableArray<int>(10, true);
34257
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    58
}
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    59
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    60
ClassListParser::~ClassListParser() {
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    61
  if (_file) {
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    62
    fclose(_file);
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    63
  }
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    64
  _instance = NULL;
34257
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    65
}
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    66
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    67
bool ClassListParser::parse_one_line() {
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    68
  for (;;) {
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    69
    if (fgets(_line, sizeof(_line), _file) == NULL) {
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    70
      return false;
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    71
    }
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    72
    ++ _line_no;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    73
    _line_len = (int)strlen(_line);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    74
    if (_line_len > _max_allowed_line_len) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    75
      error("input line too long (must be no longer than %d chars)", _max_allowed_line_len);
34257
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    76
    }
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    77
    if (*_line == '#') { // comment
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    78
      continue;
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    79
    }
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    80
    break;
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    81
  }
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
    82
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    83
  _id = _unspecified;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    84
  _super = _unspecified;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    85
  _interfaces->clear();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    86
  _source = NULL;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    87
  _interfaces_specified = false;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    88
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    89
  {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    90
    int len = (int)strlen(_line);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    91
    int i;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    92
    // Replace \t\r\n with ' '
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    93
    for (i=0; i<len; i++) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    94
      if (_line[i] == '\t' || _line[i] == '\r' || _line[i] == '\n') {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    95
        _line[i] = ' ';
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    96
      }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    97
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    98
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
    99
    // Remove trailing newline/space
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   100
    while (len > 0) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   101
      if (_line[len-1] == ' ') {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   102
        _line[len-1] = '\0';
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   103
        len --;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   104
      } else {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   105
        break;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   106
      }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   107
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   108
    _line_len = len;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   109
    _class_name = _line;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   110
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   111
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   112
  if ((_token = strchr(_line, ' ')) == NULL) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   113
    // No optional arguments are specified.
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   114
    return true;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   115
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   116
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   117
  // Mark the end of the name, and go to the next input char
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   118
  *_token++ = '\0';
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   119
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   120
  while (*_token) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   121
    skip_whitespaces();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   122
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   123
    if (parse_int_option("id:", &_id)) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   124
      continue;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   125
    } else if (parse_int_option("super:", &_super)) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   126
      check_already_loaded("Super class", _super);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   127
      continue;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   128
    } else if (skip_token("interfaces:")) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   129
      int i;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   130
      while (try_parse_int(&i)) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   131
        check_already_loaded("Interface", i);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   132
        _interfaces->append(i);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   133
      }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   134
    } else if (skip_token("source:")) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   135
      skip_whitespaces();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   136
      _source = _token;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   137
      char* s = strchr(_token, ' ');
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   138
      if (s == NULL) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   139
        break; // end of input line
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   140
      } else {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   141
        *s = '\0'; // mark the end of _source
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   142
        _token = s+1;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   143
      }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   144
    } else {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   145
      error("Unknown input");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   146
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   147
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   148
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   149
  // if src is specified
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   150
  //     id super interfaces must all be specified
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   151
  //     loader may be specified
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   152
  // else
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   153
  //     # the class is loaded from classpath
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   154
  //     id may be specified
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   155
  //     super, interfaces, loader must not be specified
34257
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
   156
  return true;
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
   157
}
4be3504cc03b 8140802: Clean up and refactor of class loading code for CDS
iklam
parents:
diff changeset
   158
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   159
void ClassListParser::skip_whitespaces() {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   160
  while (*_token == ' ' || *_token == '\t') {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   161
    _token ++;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   162
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   163
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   164
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   165
void ClassListParser::skip_non_whitespaces() {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   166
  while (*_token && *_token != ' ' && *_token != '\t') {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   167
    _token ++;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   168
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   169
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   170
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   171
void ClassListParser::parse_int(int* value) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   172
  skip_whitespaces();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   173
  if (sscanf(_token, "%i", value) == 1) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   174
    skip_non_whitespaces();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   175
    if (*value < 0) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   176
      error("Error: negative integers not allowed (%d)", *value);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   177
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   178
  } else {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   179
    error("Error: expected integer");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   180
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   181
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   182
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   183
bool ClassListParser::try_parse_int(int* value) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   184
  skip_whitespaces();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   185
  if (sscanf(_token, "%i", value) == 1) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   186
    skip_non_whitespaces();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   187
    return true;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   188
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   189
  return false;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   190
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   191
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   192
bool ClassListParser::skip_token(const char* option_name) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   193
  size_t len = strlen(option_name);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   194
  if (strncmp(_token, option_name, len) == 0) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   195
    _token += len;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   196
    return true;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   197
  } else {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   198
    return false;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   199
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   200
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   201
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   202
bool ClassListParser::parse_int_option(const char* option_name, int* value) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   203
  if (skip_token(option_name)) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   204
    if (*value != _unspecified) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   205
      error("%s specified twice", option_name);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   206
    } else {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   207
      parse_int(value);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   208
      return true;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   209
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   210
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   211
  return false;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   212
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   213
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   214
void ClassListParser::print_specified_interfaces() {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   215
  const int n = _interfaces->length();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   216
  jio_fprintf(defaultStream::error_stream(), "Currently specified interfaces[%d] = {\n", n);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   217
  for (int i=0; i<n; i++) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   218
    InstanceKlass* k = lookup_class_by_id(_interfaces->at(i));
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   219
    jio_fprintf(defaultStream::error_stream(), "  %4d = %s\n", _interfaces->at(i), k->name()->as_klass_external_name());
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   220
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   221
  jio_fprintf(defaultStream::error_stream(), "}\n");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   222
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   223
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   224
void ClassListParser::print_actual_interfaces(InstanceKlass *ik) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   225
  int n = ik->local_interfaces()->length();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   226
  jio_fprintf(defaultStream::error_stream(), "Actual interfaces[%d] = {\n", n);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   227
  for (int i = 0; i < n; i++) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   228
    InstanceKlass* e = InstanceKlass::cast(ik->local_interfaces()->at(i));
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   229
    jio_fprintf(defaultStream::error_stream(), "  %s\n", e->name()->as_klass_external_name());
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   230
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   231
  jio_fprintf(defaultStream::error_stream(), "}\n");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   232
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   233
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   234
void ClassListParser::error(const char *msg, ...) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   235
  va_list ap;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   236
  va_start(ap, msg);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   237
  int error_index = _token - _line;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   238
  if (error_index >= _line_len) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   239
    error_index = _line_len - 1;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   240
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   241
  if (error_index < 0) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   242
    error_index = 0;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   243
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   244
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   245
  jio_fprintf(defaultStream::error_stream(),
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   246
              "An error has occurred while processing class list file %s %d:%d.\n",
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   247
              _classlist_file, _line_no, (error_index + 1));
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   248
  jio_vfprintf(defaultStream::error_stream(), msg, ap);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   249
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   250
  if (_line_len <= 0) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   251
    jio_fprintf(defaultStream::error_stream(), "\n");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   252
  } else {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   253
    jio_fprintf(defaultStream::error_stream(), ":\n");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   254
    for (int i=0; i<_line_len; i++) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   255
      char c = _line[i];
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   256
      if (c == '\0') {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   257
        jio_fprintf(defaultStream::error_stream(), "%s", " ");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   258
      } else {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   259
        jio_fprintf(defaultStream::error_stream(), "%c", c);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   260
      }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   261
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   262
    jio_fprintf(defaultStream::error_stream(), "\n");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   263
    for (int i=0; i<error_index; i++) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   264
      jio_fprintf(defaultStream::error_stream(), "%s", " ");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   265
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   266
    jio_fprintf(defaultStream::error_stream(), "^\n");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   267
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   268
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   269
  vm_exit_during_initialization("class list format error.", NULL);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   270
  va_end(ap);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   271
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   272
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   273
// This function is used for loading classes for customized class loaders
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   274
// during archive dumping.
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   275
InstanceKlass* ClassListParser::load_class_from_source(Symbol* class_name, TRAPS) {
51659
ca3003390cf0 8185145: AppCDS custom loader support on Mac OS X
ccheung
parents: 51057
diff changeset
   276
#if !(defined(_LP64) && (defined(LINUX)|| defined(SOLARIS) || defined(__APPLE__)))
ca3003390cf0 8185145: AppCDS custom loader support on Mac OS X
ccheung
parents: 51057
diff changeset
   277
  // The only supported platforms are: (1) Linux/64-bit and (2) Solaris/64-bit and
ca3003390cf0 8185145: AppCDS custom loader support on Mac OS X
ccheung
parents: 51057
diff changeset
   278
  // (3) MacOSX/64-bit
48155
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 48138
diff changeset
   279
  // This #if condition should be in sync with the areCustomLoadersSupportedForCDS
551de50b4ff7 8191927: Enable AppCDS for custom loaders on all 64-bit Linux and AIX
iklam
parents: 48138
diff changeset
   280
  // method in test/lib/jdk/test/lib/Platform.java.
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   281
  error("AppCDS custom class loaders not supported on this platform");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   282
#endif
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   283
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   284
  if (!is_super_specified()) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   285
    error("If source location is specified, super class must be also specified");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   286
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   287
  if (!is_id_specified()) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   288
    error("If source location is specified, id must be also specified");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   289
  }
52514
f4e3900c8d08 8213346: Re-implement shared dictionary using CompactHashtable
iklam
parents: 51659
diff changeset
   290
  InstanceKlass* k = ClassLoaderExt::load_class(class_name, _source, CHECK_NULL);
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   291
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   292
  if (strncmp(_class_name, "java/", 5) == 0) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   293
    log_info(cds)("Prohibited package for non-bootstrap classes: %s.class from %s",
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   294
          _class_name, _source);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   295
    return NULL;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   296
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   297
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   298
  if (k != NULL) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   299
    if (k->local_interfaces()->length() != _interfaces->length()) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   300
      print_specified_interfaces();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   301
      print_actual_interfaces(k);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   302
      error("The number of interfaces (%d) specified in class list does not match the class file (%d)",
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   303
            _interfaces->length(), k->local_interfaces()->length());
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   304
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   305
52514
f4e3900c8d08 8213346: Re-implement shared dictionary using CompactHashtable
iklam
parents: 51659
diff changeset
   306
    bool added = SystemDictionaryShared::add_unregistered_class(k, CHECK_NULL);
f4e3900c8d08 8213346: Re-implement shared dictionary using CompactHashtable
iklam
parents: 51659
diff changeset
   307
    if (!added) {
f4e3900c8d08 8213346: Re-implement shared dictionary using CompactHashtable
iklam
parents: 51659
diff changeset
   308
      // We allow only a single unregistered class for each unique name.
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   309
      error("Duplicated class %s", _class_name);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   310
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   311
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   312
    // This tells JVM_FindLoadedClass to not find this class.
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   313
    k->set_shared_classpath_index(UNREGISTERED_INDEX);
50206
adec398d9051 8193332: MetaspaceShared::check_shared_class_loader_type is not used during archive creation
iklam
parents: 50039
diff changeset
   314
    k->clear_class_loader_type();
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   315
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   316
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   317
  return k;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   318
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   319
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   320
Klass* ClassListParser::load_current_class(TRAPS) {
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   321
  TempNewSymbol class_name_symbol = SymbolTable::new_symbol(_class_name, THREAD);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   322
  guarantee(!HAS_PENDING_EXCEPTION, "Exception creating a symbol.");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   323
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   324
  Klass *klass = NULL;
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   325
  if (!is_loading_from_source()) {
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   326
    // Load classes for the boot/platform/app loaders only.
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   327
    if (is_super_specified()) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   328
      error("If source location is not specified, super class must not be specified");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   329
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   330
    if (are_interfaces_specified()) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   331
      error("If source location is not specified, interface(s) must not be specified");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   332
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   333
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   334
    bool non_array = !FieldType::is_array(class_name_symbol);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   335
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   336
    JavaValue result(T_OBJECT);
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   337
    if (non_array) {
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   338
      // At this point, we are executing in the context of the boot loader. We
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   339
      // cannot call Class.forName because that is context dependent and
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   340
      // would load only classes for the boot loader.
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   341
      //
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   342
      // Instead, let's call java_system_loader().loadClass() directly, which will
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   343
      // delegate to the correct loader (boot, platform or app) depending on
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   344
      // the class name.
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   345
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   346
      Handle s = java_lang_String::create_from_symbol(class_name_symbol, CHECK_0);
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   347
      // ClassLoader.loadClass() wants external class name format, i.e., convert '/' chars to '.'
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   348
      Handle ext_class_name = java_lang_String::externalize_classname(s, CHECK_0);
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   349
      Handle loader = Handle(THREAD, SystemDictionary::java_system_loader());
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   350
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   351
      JavaCalls::call_virtual(&result,
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   352
                              loader, //SystemDictionary::java_system_loader(),
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   353
                              SystemDictionary::ClassLoader_klass(),
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   354
                              vmSymbols::loadClass_name(),
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   355
                              vmSymbols::string_class_signature(),
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   356
                              ext_class_name,
52514
f4e3900c8d08 8213346: Re-implement shared dictionary using CompactHashtable
iklam
parents: 51659
diff changeset
   357
                              THREAD); // <-- failure is handled below
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   358
    } else {
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   359
      // array classes are not supported in class list.
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   360
      THROW_NULL(vmSymbols::java_lang_ClassNotFoundException());
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   361
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   362
    assert(result.get_type() == T_OBJECT, "just checking");
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   363
    oop obj = (oop) result.get_jobject();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   364
    if (!HAS_PENDING_EXCEPTION && (obj != NULL)) {
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   365
      klass = java_lang_Class::as_Klass(obj);
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   366
    } else { // load classes in bootclasspath/a
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   367
      if (HAS_PENDING_EXCEPTION) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   368
        CLEAR_PENDING_EXCEPTION;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   369
      }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   370
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   371
      if (non_array) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   372
        Klass* k = SystemDictionary::resolve_or_null(class_name_symbol, CHECK_NULL);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   373
        if (k != NULL) {
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   374
          klass = k;
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   375
        } else {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   376
          if (!HAS_PENDING_EXCEPTION) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   377
            THROW_NULL(vmSymbols::java_lang_ClassNotFoundException());
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   378
          }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   379
        }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   380
      }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   381
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   382
  } else {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   383
    // If "source:" tag is specified, all super class and super interfaces must be specified in the
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   384
    // class list file.
49931
840e26123940 8193213: Make the UseAppCDS option obsolete.
jiangli
parents: 49480
diff changeset
   385
    klass = load_class_from_source(class_name_symbol, CHECK_NULL);
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   386
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   387
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   388
  if (klass != NULL && klass->is_instance_klass() && is_id_specified()) {
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   389
    InstanceKlass* ik = InstanceKlass::cast(klass);
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   390
    int id = this->id();
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   391
    SystemDictionaryShared::update_shared_entry(ik, id);
52631
3009ca99de32 8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents: 52514
diff changeset
   392
    InstanceKlass** old_ptr = table()->lookup(id);
3009ca99de32 8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents: 52514
diff changeset
   393
    if (old_ptr != NULL) {
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   394
      error("Duplicated ID %d for class %s", id, _class_name);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   395
    }
48383
d6388b652504 8192989: runtime/appcds/javaldr/ArrayTest.java crashes with assert(k->is_instance_klass())
ccheung
parents: 48155
diff changeset
   396
    table()->add(id, ik);
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   397
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   398
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   399
  return klass;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   400
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   401
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   402
bool ClassListParser::is_loading_from_source() {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   403
  return (_source != NULL);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   404
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   405
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   406
InstanceKlass* ClassListParser::lookup_class_by_id(int id) {
52631
3009ca99de32 8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents: 52514
diff changeset
   407
  InstanceKlass** klass_ptr = table()->lookup(id);
3009ca99de32 8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents: 52514
diff changeset
   408
  if (klass_ptr == NULL) {
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   409
    error("Class ID %d has not been defined", id);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   410
  }
52631
3009ca99de32 8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents: 52514
diff changeset
   411
  assert(*klass_ptr != NULL, "must be");
3009ca99de32 8213587: Speed up CDS dump time by using resizable hashtables
iklam
parents: 52514
diff changeset
   412
  return *klass_ptr;
48138
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   413
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   414
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   415
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   416
InstanceKlass* ClassListParser::lookup_super_for_current_class(Symbol* super_name) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   417
  if (!is_loading_from_source()) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   418
    return NULL;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   419
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   420
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   421
  InstanceKlass* k = lookup_class_by_id(super());
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   422
  if (super_name != k->name()) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   423
    error("The specified super class %s (id %d) does not match actual super class %s",
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   424
          k->name()->as_klass_external_name(), super(),
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   425
          super_name->as_klass_external_name());
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   426
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   427
  return k;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   428
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   429
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   430
InstanceKlass* ClassListParser::lookup_interface_for_current_class(Symbol* interface_name) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   431
  if (!is_loading_from_source()) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   432
    return NULL;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   433
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   434
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   435
  const int n = _interfaces->length();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   436
  if (n == 0) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   437
    error("Class %s implements the interface %s, but no interface has been specified in the input line",
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   438
          _class_name, interface_name->as_klass_external_name());
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   439
    ShouldNotReachHere();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   440
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   441
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   442
  int i;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   443
  for (i=0; i<n; i++) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   444
    InstanceKlass* k = lookup_class_by_id(_interfaces->at(i));
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   445
    if (interface_name == k->name()) {
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   446
      return k;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   447
    }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   448
  }
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   449
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   450
  // interface_name is not specified by the "interfaces:" keyword.
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   451
  print_specified_interfaces();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   452
  error("The interface %s implemented by class %s does not match any of the specified interface IDs",
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   453
        interface_name->as_klass_external_name(), _class_name);
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   454
  ShouldNotReachHere();
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   455
  return NULL;
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   456
}
78b2ecdd3c4b 8188791: Move AppCDS from closed repo to open repo
iklam
parents: 47216
diff changeset
   457