# HG changeset patch # User coleenp # Date 1403275716 14400 # Node ID fc25d8f6c4667ddf03db4acfd3c3b0244e7fbe11 # Parent a45a4f5a9609de50600d466f68904fe9941c31fe 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 diff -r a45a4f5a9609 -r fc25d8f6c466 src/share/vm/classfile/classFileParser.cpp --- a/src/share/vm/classfile/classFileParser.cpp Fri Jun 13 13:46:06 2014 +0200 +++ b/src/share/vm/classfile/classFileParser.cpp Fri Jun 20 10:48:36 2014 -0400 @@ -4022,6 +4022,11 @@ this_klass->set_major_version(major_version); this_klass->set_has_default_methods(has_default_methods); + if (!host_klass.is_null()) { + assert (this_klass->is_anonymous(), "should be the same"); + this_klass->set_host_klass(host_klass()); + } + // Set up Method*::intrinsic_id as soon as we know the names of methods. // (We used to do this lazily, but now we query it in Rewriter, // which is eagerly done for every method, so we might as well do it now, diff -r a45a4f5a9609 -r fc25d8f6c466 src/share/vm/classfile/systemDictionary.cpp --- a/src/share/vm/classfile/systemDictionary.cpp Fri Jun 13 13:46:06 2014 +0200 +++ b/src/share/vm/classfile/systemDictionary.cpp Fri Jun 20 10:48:36 2014 -0400 @@ -997,7 +997,6 @@ if (host_klass.not_null() && k.not_null()) { assert(EnableInvokeDynamic, ""); - k->set_host_klass(host_klass()); // If it's anonymous, initialize it now, since nobody else will. {