Quellcode-Bibliothek classListWriter.cpp
Sprache: C
/* * Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
void ClassListWriter::init() { // For -XX:DumpLoadedClassList=<file> option if (DumpLoadedClassList != NULL) { constchar* list_name = make_log_name(DumpLoadedClassList, NULL);
_classlist_file = new(mtInternal)
fileStream(list_name);
_classlist_file->print_cr("# NOTE: Do not modify this file.");
_classlist_file->print_cr("#");
_classlist_file->print_cr("# This file is generated via the -XX:DumpLoadedClassList= option");
_classlist_file->print_cr("# and is used at CDS archive dump time (see -Xshare:dump).");
_classlist_file->print_cr("#");
FREE_C_HEAP_ARRAY(char, list_name);
}
}
ClassLoaderData* loader_data = k->class_loader_data(); bool is_builtin_loader = SystemDictionaryShared::is_builtin_loader(loader_data); if (!is_builtin_loader) { // class may be loaded from shared archive if (!k->is_shared()) { if (cfs == nullptr || cfs->source() == nullptr) { // CDS static dump only handles unregistered class with known source. return;
} if (strncmp(cfs->source(), "file:", 5) != 0) { return;
}
} else { // Shared unregistered classes are skipped since their real source are not recorded in shared space. return;
} if (!SystemDictionaryShared::add_unregistered_class(Thread::current(), (InstanceKlass*)k)) { return;
}
}
// filter out java/lang/invoke/BoundMethodHandle$Species... if (cfs != nullptr && cfs->source() != nullptr && strcmp(cfs->source(), "_ClassSpecializer_generateConcreteSpeciesCode") == 0) { return;
}
{
InstanceKlass* super = k->java_super(); if (super != NULL && !has_id(super)) { return;
}
Array<InstanceKlass*>* interfaces = k->local_interfaces(); int len = interfaces->length(); for (int i = 0; i < len; i++) {
InstanceKlass* intf = interfaces->at(i); if (!has_id(intf)) { return;
}
}
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.11Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.