8039150: host_klass invariant fails when verifying newly loaded JSR-292 anonymous classes

Fri, 20 Jun 2014 10:48:36 -0400

author
coleenp
date
Fri, 20 Jun 2014 10:48:36 -0400
changeset 6741
ae92351815b6
parent 6740
b334bc7ff73e
child 6742
e4a6e7f1b90b

8039150: host_klass invariant fails when verifying newly loaded JSR-292 anonymous classes
Summary: Initialize host_klass while parsing the class with the other initializations.
Reviewed-by: sspitsyn, stefank

src/share/vm/classfile/classFileParser.cpp file | annotate | diff | comparison | revisions
src/share/vm/classfile/systemDictionary.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/classfile/classFileParser.cpp	Fri Jun 20 12:39:56 2014 -0700
     1.2 +++ b/src/share/vm/classfile/classFileParser.cpp	Fri Jun 20 10:48:36 2014 -0400
     1.3 @@ -4022,6 +4022,11 @@
     1.4      this_klass->set_major_version(major_version);
     1.5      this_klass->set_has_default_methods(has_default_methods);
     1.6  
     1.7 +    if (!host_klass.is_null()) {
     1.8 +      assert (this_klass->is_anonymous(), "should be the same");
     1.9 +      this_klass->set_host_klass(host_klass());
    1.10 +    }
    1.11 +
    1.12      // Set up Method*::intrinsic_id as soon as we know the names of methods.
    1.13      // (We used to do this lazily, but now we query it in Rewriter,
    1.14      // which is eagerly done for every method, so we might as well do it now,
     2.1 --- a/src/share/vm/classfile/systemDictionary.cpp	Fri Jun 20 12:39:56 2014 -0700
     2.2 +++ b/src/share/vm/classfile/systemDictionary.cpp	Fri Jun 20 10:48:36 2014 -0400
     2.3 @@ -997,7 +997,6 @@
     2.4  
     2.5    if (host_klass.not_null() && k.not_null()) {
     2.6      assert(EnableInvokeDynamic, "");
     2.7 -    k->set_host_klass(host_klass());
     2.8      // If it's anonymous, initialize it now, since nobody else will.
     2.9  
    2.10      {

mercurial