src/hotspot/share/runtime/signature.cpp
changeset 48826 c4d9d1b08e2e
parent 47216 71c04702a3d5
child 48836 423bcbb288ff
--- a/src/hotspot/share/runtime/signature.cpp	Wed Jan 31 10:55:49 2018 -0800
+++ b/src/hotspot/share/runtime/signature.cpp	Fri Sep 08 10:46:46 2017 -0700
@@ -392,11 +392,19 @@
 
 oop SignatureStream::as_java_mirror(Handle class_loader, Handle protection_domain,
                                     FailureMode failure_mode, TRAPS) {
-  if (!is_object())
-    return Universe::java_mirror(type());
-  Klass* klass = as_klass(class_loader, protection_domain, failure_mode, CHECK_NULL);
-  if (klass == NULL)  return NULL;
-  return klass->java_mirror();
+  if (raw_length() == 1) {
+    // short-cut in a common case
+    return SystemDictionary::find_java_mirror_for_type((char) raw_byte_at(0));
+  }
+  TempNewSymbol signature = SymbolTable::new_symbol(_signature, _begin, _end, CHECK_NULL);
+  Klass* no_accessing_klass = NULL;
+  Handle mirror = SystemDictionary::find_java_mirror_for_type(signature,
+                                                              no_accessing_klass,
+                                                              class_loader,
+                                                              protection_domain,
+                                                              failure_mode,
+                                                              CHECK_NULL);
+  return mirror();
 }
 
 Symbol* SignatureStream::as_symbol_or_null() {