RFR (L) : 8014013 : CallInfo structure no longer accurately reports the result of a LinkResolver operation

Christian Thalinger christian.thalinger at oracle.com
Thu Aug 15 19:38:43 PDT 2013


On Aug 15, 2013, at 9:05 AM, David Chase <david.r.chase at oracle.com> wrote:

> Webrev: http://cr.openjdk.java.net/~drchase/8014013/webrev.01/

src/share/vm/interpreter/linkResolver.cpp (and others):

+   debug_only(verify());  // verify before making side effects

Use upper-case DEBUG_ONLY.  debug_only is deprecated.

+   if (resolved_klass == NULL)  // 2nd argument defaults to holder of 1st
+     resolved_klass = resolved_method_holder;
+   _resolved_klass  = resolved_klass;
+   _selected_klass  = resolved_klass;
+   _resolved_method = resolved_method;
+   _selected_method = resolved_method;

It is almost impossible to see that there is an if statement and where it ends.  Add {}.

+     ShouldNotReachHere();  // C++ constructor failure

fatal with error message would be better.

src/share/vm/oops/method.cpp:

+ // These are methods do not need vtable entries.
+ bool Method::is_final_method(AccessFlags class_access_flags) const {

This comment reads odd.

src/share/vm/opto/library_call.cpp:

+   assert(vtable_index >= 0 || vtable_index == Method::nonvirtual_vtable_index, err_msg("bad index %d", vtable_index));

Please use err_msg_res in the compiler.  We had problems with stack overflows in the past.

src/share/vm/runtime/fieldDescriptor.cpp:

+   if (_cp.is_null() || field_holder() != ik) {
+     _cp = constantPoolHandle(Thread::current(), ik->constants());
+     assert(field_holder() == ik, "must be already initialized to this class");
+   }

This assert cannot hold.

-- Chris

> 
> Bug: The addition of interface (default) methods made the old way
> of resolving method invocation not be right. 
> In addition, the code was fiddly and distributed through the source.
> See also duplicate 7086758,
> "MethodHandles.Lookup.findVirtual is confused by interface methods that are multiply inherited"
> 
> Fix: Enhance method resolution (add "CallKind")
> and the data structures for reporting resolution results,
> and centralize the process as much as possible.
> 
> Testing:
> 
> Note: this fix is bug-for-bug-compatible with current on jdk/lambda/vm/DefaultMethodsTest.java 
> 
> 64-bit Intel (MacOS):
> jtreg - compiler
> jtreg - jdk/{lib,sun,java/util, java/lang, jdk}
> ute/tonga - vm.quick.testlist
> 
> 32-bit Intel (Ubuntu)
> Point checks on all the corner cases from the 64-bit testing.
> (jck60008, b7087658)
> jtreg - jdk/{java/util, java/lang, jdk}
> 
> Solaris-sparc
> jtreg - jdk/{java/util, java/lang, jdk}
> 
> Also compiled on Windows/VS2010 w/ JPRT.
> 
> 



More information about the hotspot-runtime-dev mailing list