hotspot/src/share/vm/interpreter/linkResolver.cpp
changeset 46505 fd4bc78630b1
parent 46458 3c12af929e7d
child 46560 388aa8d67c80
--- a/hotspot/src/share/vm/interpreter/linkResolver.cpp	Fri May 26 13:47:33 2017 -0700
+++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp	Sat May 27 09:21:01 2017 -0400
@@ -24,6 +24,7 @@
 
 #include "precompiled.hpp"
 #include "classfile/defaultMethods.hpp"
+#include "classfile/javaClasses.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmSymbols.hpp"
@@ -131,7 +132,7 @@
 }
 
 // utility query for unreflecting a method
-CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass) {
+CallInfo::CallInfo(Method* resolved_method, Klass* resolved_klass, TRAPS) {
   Klass* resolved_method_holder = resolved_method->method_holder();
   if (resolved_klass == NULL) { // 2nd argument defaults to holder of 1st
     resolved_klass = resolved_method_holder;
@@ -180,9 +181,19 @@
   _call_kind  = kind;
   _call_index = index;
   _resolved_appendix = Handle();
+  // Find or create a ResolvedMethod instance for this Method*
+  set_resolved_method_name(CHECK);
+
   DEBUG_ONLY(verify());
 }
 
+void CallInfo::set_resolved_method_name(TRAPS) {
+  Method* m = _resolved_method();
+  assert(m != NULL, "Should already have a Method*");
+  oop rmethod_name = java_lang_invoke_ResolvedMethodName::find_resolved_method(m, CHECK);
+  _resolved_method_name = Handle(THREAD, rmethod_name);
+}
+
 #ifdef ASSERT
 void CallInfo::verify() {
   switch (call_kind()) {  // the meaning and allowed value of index depends on kind