提交 97c6698d 编写于 作者: M mbalao

8231995: two jtreg tests failed after 8229366 is fixed

Reviewed-by: jbachorik
上级 2a8d5f43
......@@ -39,6 +39,7 @@
#include "interpreter/bytecodeStream.hpp"
#include "interpreter/interpreter.hpp"
#include "jfr/jfrEvents.hpp"
#include "jfr/jni/jfrUpcalls.hpp"
#include "memory/filemap.hpp"
#include "memory/gcLocker.hpp"
#include "memory/oopFactory.hpp"
......@@ -94,6 +95,9 @@ bool SystemDictionary::_has_checkPackageAccess = false;
// lazily initialized klass variables
Klass* volatile SystemDictionary::_abstract_ownable_synchronizer_klass = NULL;
#if INCLUDE_JFR
static const Symbol* jfr_event_handler_proxy = NULL;
#endif // INCLUDE_JFR
// ----------------------------------------------------------------------------
// Java-level SystemLoader
......@@ -1333,6 +1337,25 @@ instanceKlassHandle SystemDictionary::load_instance_class(Symbol* class_name, Ha
if (!k.is_null()) {
k = find_or_define_instance_class(class_name, class_loader, k, CHECK_(nh));
}
#if INCLUDE_JFR
else {
assert(jfr_event_handler_proxy != NULL, "invariant");
if (class_name == jfr_event_handler_proxy) {
// EventHandlerProxy class is generated dynamically in
// EventHandlerProxyCreator::makeEventHandlerProxyClass
// method, so we generate a Java call from here.
//
// EventHandlerProxy class will finally be defined in
// SystemDictionary::resolve_from_stream method, down
// the call stack. Bootstrap classloader is parallel-capable,
// so no concurrency issues are expected.
CLEAR_PENDING_EXCEPTION;
k = JfrUpcalls::load_event_handler_proxy_class(THREAD);
assert(!k.is_null(), "invariant");
}
}
#endif // INCLUDE_JFR
return k;
} else {
// Use user specified class loader to load class. Call loadClass operation on class_loader.
......@@ -1886,6 +1909,9 @@ void SystemDictionary::initialize(TRAPS) {
_system_loader_lock_obj = oopFactory::new_intArray(0, CHECK);
// Initialize basic classes
initialize_preloaded_classes(CHECK);
#if INCLUDE_JFR
jfr_event_handler_proxy = SymbolTable::new_permanent_symbol("jdk/jfr/proxy/internal/EventHandlerProxy", CHECK);
#endif // INCLUDE_JFR
}
// Compact table of directions on the initialization of klasses:
......
......@@ -177,3 +177,14 @@ void JfrUpcalls::new_bytes_eager_instrumentation(jlong trace_id,
*new_class_data_len = new_bytes_length;
*new_class_data = new_bytes;
}
instanceKlassHandle JfrUpcalls::load_event_handler_proxy_class(TRAPS) {
JavaValue result(T_OBJECT);
JfrJavaArguments call_args(&result, "jdk/jfr/internal/JVMUpcalls",
"getEventHandlerProxyClass", "()Ljava/lang/Class;", CHECK_NULL);
JfrJavaSupport::call_static(&call_args, CHECK_NULL);
assert(result.get_type() == T_OBJECT, "invariant");
instanceHandle h_java_proxy(THREAD, (instanceOop)result.get_jobject());
assert(h_java_proxy.not_null(), "invariant");
return java_lang_Class::as_Klass(h_java_proxy());
}
......@@ -53,6 +53,8 @@ class JfrUpcalls : AllStatic {
jint* new_class_data_len,
unsigned char** new_class_data,
TRAPS);
static instanceKlassHandle load_event_handler_proxy_class(TRAPS);
};
#endif // SHARE_VM_JFR_JNI_JFRUPCALLS_HPP
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册