< prev index next >
src/share/vm/classfile/classFileParser.cpp
Print this page
rev 8856 : 8210094: Better loading of classloader classes
Reviewed-by: acorn, hseigel, ahgross, rhalade
rev 8910 : full patch for jfr
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2019, 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.
@@ -59,10 +59,11 @@
#include "runtime/reflection.hpp"
#include "runtime/signature.hpp"
#include "runtime/timer.hpp"
#include "services/classLoadingService.hpp"
#include "services/threadService.hpp"
+#include "trace/traceMacros.hpp"
#include "utilities/array.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/ostream.hpp"
// We generally try to create the oops directly when parsing, rather than
@@ -3883,10 +3884,11 @@
verify_legal_class_modifiers(flags, CHECK_(nullHandle));
access_flags.set_flags(flags);
// This class and superclass
u2 this_class_index = cfs->get_u2_fast();
+ _this_class_index = this_class_index; //used by jfr
check_property(
valid_cp_range(this_class_index, cp_size) &&
cp->tag_at(this_class_index).is_unresolved_klass(),
"Invalid this class index %u in constant pool in class file %s",
this_class_index, CHECK_(nullHandle));
@@ -4213,10 +4215,11 @@
// Update the loader_data graph.
record_defined_class_dependencies(this_klass, CHECK_NULL);
ClassLoadingService::notify_class_loaded(InstanceKlass::cast(this_klass()),
false /* not shared class */);
+ TRACE_INIT_ID(InstanceKlass::cast(this_klass()));
if (TraceClassLoading) {
ResourceMark rm;
// print in a single call to reduce interleaving of output
if (cfs->source() != NULL) {
@@ -5298,5 +5301,21 @@
return NULL;
}
}
return NULL;
}
+
+const ClassFileStream* ClassFileParser::clone_stream() const {
+ assert(_stream != NULL, "invariant");
+ return _stream->clone();
+}
+
+void ClassFileParser::set_klass_to_deallocate(InstanceKlass* klass) {
+
+#ifdef ASSERT
+ if (klass != NULL) {
+ assert(NULL == _klass, "leaking?");
+ }
+#endif
+
+ _klass = klass;
+}
< prev index next >