8231995: two jtreg tests failed after 8229366 is fixed

Tue, 29 Oct 2019 19:53:30 -0300

author
mbalao
date
Tue, 29 Oct 2019 19:53:30 -0300
changeset 9886
986b79fabfa0
parent 9885
8e875c964f41
child 9887
78f156419d26

8231995: two jtreg tests failed after 8229366 is fixed
Reviewed-by: jbachorik

src/share/vm/classfile/systemDictionary.cpp file | annotate | diff | comparison | revisions
src/share/vm/jfr/jni/jfrUpcalls.cpp file | annotate | diff | comparison | revisions
src/share/vm/jfr/jni/jfrUpcalls.hpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/classfile/systemDictionary.cpp	Wed Oct 09 16:11:58 2019 +0800
     1.2 +++ b/src/share/vm/classfile/systemDictionary.cpp	Tue Oct 29 19:53:30 2019 -0300
     1.3 @@ -39,6 +39,7 @@
     1.4  #include "interpreter/bytecodeStream.hpp"
     1.5  #include "interpreter/interpreter.hpp"
     1.6  #include "jfr/jfrEvents.hpp"
     1.7 +#include "jfr/jni/jfrUpcalls.hpp"
     1.8  #include "memory/filemap.hpp"
     1.9  #include "memory/gcLocker.hpp"
    1.10  #include "memory/oopFactory.hpp"
    1.11 @@ -94,6 +95,9 @@
    1.12  // lazily initialized klass variables
    1.13  Klass* volatile SystemDictionary::_abstract_ownable_synchronizer_klass = NULL;
    1.14  
    1.15 +#if INCLUDE_JFR
    1.16 +static const Symbol* jfr_event_handler_proxy = NULL;
    1.17 +#endif // INCLUDE_JFR
    1.18  
    1.19  // ----------------------------------------------------------------------------
    1.20  // Java-level SystemLoader
    1.21 @@ -1333,6 +1337,25 @@
    1.22      if (!k.is_null()) {
    1.23        k = find_or_define_instance_class(class_name, class_loader, k, CHECK_(nh));
    1.24      }
    1.25 +#if INCLUDE_JFR
    1.26 +    else {
    1.27 +      assert(jfr_event_handler_proxy != NULL, "invariant");
    1.28 +      if (class_name == jfr_event_handler_proxy) {
    1.29 +        // EventHandlerProxy class is generated dynamically in
    1.30 +        // EventHandlerProxyCreator::makeEventHandlerProxyClass
    1.31 +        // method, so we generate a Java call from here.
    1.32 +        //
    1.33 +        // EventHandlerProxy class will finally be defined in
    1.34 +        // SystemDictionary::resolve_from_stream method, down
    1.35 +        // the call stack. Bootstrap classloader is parallel-capable,
    1.36 +        // so no concurrency issues are expected.
    1.37 +        CLEAR_PENDING_EXCEPTION;
    1.38 +        k = JfrUpcalls::load_event_handler_proxy_class(THREAD);
    1.39 +        assert(!k.is_null(), "invariant");
    1.40 +      }
    1.41 +    }
    1.42 +#endif // INCLUDE_JFR
    1.43 +
    1.44      return k;
    1.45    } else {
    1.46      // Use user specified class loader to load class. Call loadClass operation on class_loader.
    1.47 @@ -1886,6 +1909,9 @@
    1.48    _system_loader_lock_obj = oopFactory::new_intArray(0, CHECK);
    1.49    // Initialize basic classes
    1.50    initialize_preloaded_classes(CHECK);
    1.51 +#if INCLUDE_JFR
    1.52 +  jfr_event_handler_proxy = SymbolTable::new_permanent_symbol("jdk/jfr/proxy/internal/EventHandlerProxy", CHECK);
    1.53 +#endif // INCLUDE_JFR
    1.54  }
    1.55  
    1.56  // Compact table of directions on the initialization of klasses:
     2.1 --- a/src/share/vm/jfr/jni/jfrUpcalls.cpp	Wed Oct 09 16:11:58 2019 +0800
     2.2 +++ b/src/share/vm/jfr/jni/jfrUpcalls.cpp	Tue Oct 29 19:53:30 2019 -0300
     2.3 @@ -177,3 +177,14 @@
     2.4    *new_class_data_len = new_bytes_length;
     2.5    *new_class_data = new_bytes;
     2.6  }
     2.7 +
     2.8 +instanceKlassHandle JfrUpcalls::load_event_handler_proxy_class(TRAPS) {
     2.9 +  JavaValue result(T_OBJECT);
    2.10 +  JfrJavaArguments call_args(&result, "jdk/jfr/internal/JVMUpcalls",
    2.11 +          "getEventHandlerProxyClass", "()Ljava/lang/Class;", CHECK_NULL);
    2.12 +  JfrJavaSupport::call_static(&call_args, CHECK_NULL);
    2.13 +  assert(result.get_type() == T_OBJECT, "invariant");
    2.14 +  instanceHandle h_java_proxy(THREAD, (instanceOop)result.get_jobject());
    2.15 +  assert(h_java_proxy.not_null(), "invariant");
    2.16 +  return java_lang_Class::as_Klass(h_java_proxy());
    2.17 +}
     3.1 --- a/src/share/vm/jfr/jni/jfrUpcalls.hpp	Wed Oct 09 16:11:58 2019 +0800
     3.2 +++ b/src/share/vm/jfr/jni/jfrUpcalls.hpp	Tue Oct 29 19:53:30 2019 -0300
     3.3 @@ -53,6 +53,8 @@
     3.4                               jint* new_class_data_len,
     3.5                               unsigned char** new_class_data,
     3.6                               TRAPS);
     3.7 +
     3.8 +  static instanceKlassHandle load_event_handler_proxy_class(TRAPS);
     3.9  };
    3.10  
    3.11  #endif // SHARE_VM_JFR_JNI_JFRUPCALLS_HPP

mercurial