< prev index next >
src/hotspot/share/classfile/klassFactory.cpp
Print this page
@@ -81,16 +81,21 @@
ClassFileStream::verify);
ClassFileParser parser(stream,
class_name,
loader_data,
protection_domain,
- NULL,
- NULL,
+ NULL, // unsafe_anonymous_host
+ NULL, // cp_patches
+ false, // is_hidden
+ false, // can_access_vm_annotations
ClassFileParser::BROADCAST, // publicity level
CHECK_NULL);
- InstanceKlass* new_ik = parser.create_instance_klass(true /* changed_by_loadhook */,
+ ClassInstanceInfo cl_inst_info;
+ InstanceKlass* new_ik = parser.create_instance_klass(true, // changed_by_loadhook
+ cl_inst_info, // dynamic_nest_host and classData
CHECK_NULL);
+
if (cached_class_file != NULL) {
new_ik->set_cached_class_file(cached_class_file);
}
if (class_loader.is_null()) {
@@ -164,13 +169,11 @@
InstanceKlass* KlassFactory::create_from_stream(ClassFileStream* stream,
Symbol* name,
ClassLoaderData* loader_data,
- Handle protection_domain,
- const InstanceKlass* unsafe_anonymous_host,
- GrowableArray<Handle>* cp_patches,
+ const ClassLoadInfo& cl_info,
TRAPS) {
assert(stream != NULL, "invariant");
assert(loader_data != NULL, "invariant");
assert(THREAD->is_Java_thread(), "must be a JavaThread");
@@ -182,31 +185,41 @@
ClassFileStream* old_stream = stream;
// increment counter
THREAD->statistical_info().incr_define_class_count();
- // Skip this processing for VM anonymous classes
- if (unsafe_anonymous_host == NULL) {
+ assert(!(cl_info.is_hidden() && (cl_info.unsafe_anonymous_host() != NULL)),
+ "hidden class has an anonymous host");
+
+ // Skip this processing for VM hidden or anonymous classes
+ if (!cl_info.is_hidden() && (cl_info.unsafe_anonymous_host() == NULL)) {
stream = check_class_file_load_hook(stream,
name,
loader_data,
- protection_domain,
+ cl_info.protection_domain(),
&cached_class_file,
CHECK_NULL);
}
ClassFileParser parser(stream,
name,
loader_data,
- protection_domain,
- unsafe_anonymous_host,
- cp_patches,
+ cl_info.protection_domain(),
+ cl_info.unsafe_anonymous_host(),
+ cl_info.cp_patches(),
+ cl_info.is_hidden(),
+ cl_info.can_access_vm_annotations(),
ClassFileParser::BROADCAST, // publicity level
CHECK_NULL);
- InstanceKlass* result = parser.create_instance_klass(old_stream != stream, CHECK_NULL);
- assert(result == parser.create_instance_klass(old_stream != stream, THREAD), "invariant");
+ const ClassInstanceInfo* cl_inst_info = cl_info.class_hidden_info_ptr();
+ InstanceKlass* result = parser.create_instance_klass(old_stream != stream, *cl_inst_info, CHECK_NULL);
+#ifdef ASSERT
+ // Need a NULL dynamic_nest_host here otherwise set_nest_host() may assert.
+ ClassInstanceInfo cl_inst_info_null(NULL, cl_inst_info->class_data());
+ assert(result == parser.create_instance_klass(old_stream != stream, cl_inst_info_null, THREAD), "invariant");
+#endif
if (result == NULL) {
return NULL;
}
< prev index next >