[9] RFR(S): 8050079: crash while compiling java.lang.ref.Finalizer::runFinalizer

John Rose john.r.rose at oracle.com
Fri Nov 14 18:38:46 UTC 2014


On Nov 13, 2014, at 6:51 AM, Tobias Hartmann <tobias.hartmann at oracle.com> wrote:

> 
> Solution:
> (1) A check for 'oop_is_instance' is added to ignore non-instance Klasses in the
> subclass hierarchy.
> (2) I added a check to only execute the interface related checks if we come from
> a top level call.
> 

Good work.

For (1) I would prefer putting the check near to the operation it protects:

diff --git a/src/share/vm/code/dependencies.cpp b/src/share/vm/code/dependencies.cpp
--- a/src/share/vm/code/dependencies.cpp
+++ b/src/share/vm/code/dependencies.cpp
@@ -904,6 +904,8 @@
   bool is_witness(Klass* k) {
     if (doing_subtype_search()) {
       return Dependencies::is_concrete_klass(k);
+    } else if (!k->oop_is_instance()) {
+      return false;  // no methods to find in an array type
     } else {
       Method* m = InstanceKlass::cast(k)->find_method(_name, _signature);
       if (m == NULL || !Dependencies::is_concrete_method(m))  return false;

If we ever put methods on arrays (clone, freeze, asList, etc.) it will be a little easier to see how to adjust this code.

— John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20141114/875ed285/attachment.html>


More information about the hotspot-compiler-dev mailing list