< prev index next >

src/share/vm/classfile/klassFactory.cpp

Print this page

        

*** 35,52 **** #include "prims/jvmtiEnvBase.hpp" #include "prims/jvmtiRedefineClasses.hpp" #include "trace/traceMacros.hpp" // called during initial loading of a shared class ! instanceKlassHandle KlassFactory::check_shared_class_file_load_hook( ! instanceKlassHandle ik, Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS) { #if INCLUDE_CDS && INCLUDE_JVMTI ! assert(ik.not_null(), "sanity"); ! assert(ik()->is_shared(), "expecting a shared class"); if (JvmtiExport::should_post_class_file_load_hook()) { assert(THREAD->is_Java_thread(), "must be JavaThread"); // Post the CFLH --- 35,52 ---- #include "prims/jvmtiEnvBase.hpp" #include "prims/jvmtiRedefineClasses.hpp" #include "trace/traceMacros.hpp" // called during initial loading of a shared class ! InstanceKlass* KlassFactory::check_shared_class_file_load_hook( ! InstanceKlass* ik, Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS) { #if INCLUDE_CDS && INCLUDE_JVMTI ! assert(ik != NULL, "sanity"); ! assert(ik->is_shared(), "expecting a shared class"); if (JvmtiExport::should_post_class_file_load_hook()) { assert(THREAD->is_Java_thread(), "must be JavaThread"); // Post the CFLH
*** 82,92 **** protection_domain, NULL, NULL, ClassFileParser::BROADCAST, // publicity level CHECK_NULL); ! instanceKlassHandle new_ik = parser.create_instance_klass(true /* changed_by_loadhook */, CHECK_NULL); if (cached_class_file != NULL) { new_ik->set_cached_class_file(cached_class_file); } --- 82,92 ---- protection_domain, NULL, NULL, ClassFileParser::BROADCAST, // publicity level CHECK_NULL); ! InstanceKlass* new_ik = parser.create_instance_klass(true /* changed_by_loadhook */, CHECK_NULL); if (cached_class_file != NULL) { new_ik->set_cached_class_file(cached_class_file); }
*** 126,143 **** // avoid the bug described by 7126851. JvmtiThreadState* state = jt->jvmti_thread_state(); if (state != NULL) { ! KlassHandle* h_class_being_redefined = ! state->get_class_being_redefined(); ! if (h_class_being_redefined != NULL) { ! instanceKlassHandle ikh_class_being_redefined = ! instanceKlassHandle(THREAD, (*h_class_being_redefined)()); ! ! *cached_class_file = ikh_class_being_redefined->get_cached_class_file(); } } unsigned char* ptr = const_cast<unsigned char*>(stream->buffer()); unsigned char* end_ptr = ptr + stream->length(); --- 126,140 ---- // avoid the bug described by 7126851. JvmtiThreadState* state = jt->jvmti_thread_state(); if (state != NULL) { ! Klass* k = state->get_class_being_redefined(); ! if (k != NULL) { ! InstanceKlass* class_being_redefined = InstanceKlass::cast(k); ! *cached_class_file = class_being_redefined->get_cached_class_file(); } } unsigned char* ptr = const_cast<unsigned char*>(stream->buffer()); unsigned char* end_ptr = ptr + stream->length();
*** 161,171 **** return stream; } ! instanceKlassHandle KlassFactory::create_from_stream(ClassFileStream* stream, Symbol* name, ClassLoaderData* loader_data, Handle protection_domain, const InstanceKlass* host_klass, GrowableArray<Handle>* cp_patches, --- 158,168 ---- return stream; } ! InstanceKlass* KlassFactory::create_from_stream(ClassFileStream* stream, Symbol* name, ClassLoaderData* loader_data, Handle protection_domain, const InstanceKlass* host_klass, GrowableArray<Handle>* cp_patches,
*** 198,211 **** host_klass, cp_patches, ClassFileParser::BROADCAST, // publicity level CHECK_NULL); ! instanceKlassHandle result = parser.create_instance_klass(old_stream != stream, CHECK_NULL); assert(result == parser.create_instance_klass(old_stream != stream, THREAD), "invariant"); ! if (result.is_null()) { return NULL; } if (cached_class_file != NULL) { // JVMTI: we have an InstanceKlass now, tell it about the cached bytes --- 195,208 ---- host_klass, cp_patches, 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"); ! if (result == NULL) { return NULL; } if (cached_class_file != NULL) { // JVMTI: we have an InstanceKlass now, tell it about the cached bytes
< prev index next >