--- old/src/share/vm/classfile/stackMapFrame.cpp 2011-02-21 15:35:48.258983000 -0500 +++ new/src/share/vm/classfile/stackMapFrame.cpp 2011-02-21 15:35:46.686510000 -0500 @@ -182,6 +182,35 @@ bool match_stack = is_assignable_to( _stack, target->stack(), _stack_size, CHECK_false); bool match_flags = (_flags | target->flags()) == target->flags(); + + // We allow flags of {UninitThis} to assign to {} if-and-only-if the + // target frame does not depend upon the current type. + // This is slightly too strict, as we need only enforce that the + // slots that were initialized by the (the things that were + // UninitializedThis before initialize_object() converted them) are unused. + // However we didn't save that information so we'll enforce this upon + // anything that might have been initalized. This a rare situation + // and javac never generates code that would end up here, but some profilers + // (such as NetBeans) might, when adding exception handlers to + // methods. See 7020118. + if (!match_flags && flag_this_uninit() && target->flags() == 0) { + match_flags = true; + for (int i = 0; i < target->locals_size(); ++i) { + if (locals()[i] == verifier()->current_type() && + target->locals()[i] != VerificationType::top_type()) { + match_flags = false; + break; + } + } + for (int i = 0; i < target->stack_size(); ++i) { + if (stack()[i] == verifier()->current_type() && + target->stack()[i] != VerificationType::top_type()) { + match_flags = false; + break; + } + } + } + return (match_locals && match_stack && match_flags); } --- old/src/share/vm/classfile/verificationType.hpp 2011-02-21 15:35:56.456325000 -0500 +++ new/src/share/vm/classfile/verificationType.hpp 2011-02-21 15:35:54.881720000 -0500 @@ -128,6 +128,7 @@ // Create verification types static VerificationType bogus_type() { return VerificationType(Bogus); } + static VerificationType top_type() { return bogus_type(); } // alias static VerificationType null_type() { return VerificationType(Null); } static VerificationType integer_type() { return VerificationType(Integer); } static VerificationType float_type() { return VerificationType(Float); }