changeset 13394:eba06bb9ed49 mvt

8185443: [MVT] VectorTest fails with -Xcomp "can not load classes with compiler thread" Reviewed-by: roland
author thartmann
date Fri, 28 Jul 2017 17:57:05 +0200
parents e6b97a7f1d8f
children 90de0b1060bb
files src/share/vm/runtime/sharedRuntime.cpp src/share/vm/runtime/signature.cpp
diffstat 2 files changed, 15 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/sharedRuntime.cpp	Fri Jul 28 17:56:25 2017 +0200
+++ b/src/share/vm/runtime/sharedRuntime.cpp	Fri Jul 28 17:57:05 2017 +0200
@@ -2719,17 +2719,21 @@
       }
       for (SignatureStream ss(method->signature()); !ss.at_return_type(); ss.next()) {
         if (ValueTypePassFieldsAsArgs && ss.type() == T_VALUETYPE) {
-          Klass* k = ss.as_klass(Handle(THREAD, holder->class_loader()),
-                                 Handle(THREAD, holder->protection_domain()),
-                                 SignatureStream::ReturnNull, THREAD);
-          assert(k != NULL && !HAS_PENDING_EXCEPTION, "can resolve klass?");
-          ValueKlass* vk = ValueKlass::cast(k);
-          if (vk == SystemDictionary::___Value_klass()) {
+          Symbol* name = ss.as_symbol_or_null();
+          assert(name != NULL, "should not be null");
+          if (name == vmSymbols::java_lang____Value()) {
             assert(method->is_compiled_lambda_form() || method->is_method_handle_intrinsic(),
                    "should not use __Value for a value type argument");
             sig_extended.push(SigEntry(T_OBJECT));
           } else {
-            const Array<SigEntry>* sig_vk = vk->extended_sig();
+            // Method handle intrinsics with a __Value argument may be created during
+            // compilation. Only do a full system dictionary lookup if the argument name
+            // is not __Value, to avoid lookups from the compiler thread.
+            Klass* k = ss.as_klass(Handle(THREAD, holder->class_loader()),
+                                   Handle(THREAD, holder->protection_domain()),
+                                   SignatureStream::ReturnNull, THREAD);
+            assert(k != NULL && !HAS_PENDING_EXCEPTION, "can resolve klass?");
+            const Array<SigEntry>* sig_vk = ValueKlass::cast(k)->extended_sig();
             sig_extended.appendAll(sig_vk);
           }
         } else {
--- a/src/share/vm/runtime/signature.cpp	Fri Jul 28 17:56:25 2017 +0200
+++ b/src/share/vm/runtime/signature.cpp	Fri Jul 28 17:57:05 2017 +0200
@@ -386,10 +386,12 @@
   int begin = _begin;
   int end   = _end;
 
-  if ( ( _signature->byte_at(_begin) == 'L' || _signature->byte_at(_begin) == 'Q' )
-      && _signature->byte_at(_end-1) == ';') {
+  if (_type == T_OBJECT || _type == T_VALUETYPE) {
     begin++;
     end--;
+    if (begin == end) {
+      return (_type == T_OBJECT) ? vmSymbols::java_lang_Object() : vmSymbols::java_lang____Value();
+    }
   }
 
   // Save names for cleaning up reference count at the end of