[hotspot]The VM support of static and private interface method
Mike Duigou
mike.duigou at oracle.com
Fri Jan 11 10:13:00 PST 2013
Thank you very much for tracking this problem down. Your analysis is exactly correct. I have restored the missing code. We will also start efforts to incorporate this code in to jdk8 mainline.
Mike
On Jan 10 2013, at 22:49 , bitter_fox wrote:
> FYI, this is the diff around static interface method.
>
> Regards,
> bitter_fox
>
> [1]:
> @@ -3788,7 +3788,7 @@ instanceKlassHandle ClassFileParser::par
> check_final_method_override(this_klass, CHECK_(nullHandle));
> // check that if this class is an interface then it doesn't have static
> methods
> - if (this_klass->is_interface()) {
> + if (this_klass->is_interface() && major_version < JAVA_8_VERSION) {
> check_illegal_static_method(this_klass, CHECK_(nullHandle));
> }
>
> [2]:
> @@ -3766,6 +3767,31 @@ instanceKlassHandle ClassFileParser::par
> // Initialize itable offset tables
> klassItable::setup_itable_offset_table(this_klass);
> + // Compute transitive closure of interfaces this class implements
> + // Do final class setup
> + fill_oop_maps(this_klass, nonstatic_oop_map_count, nonstatic_oop_offsets,
> nonstatic_oop_counts);
> +
> + // Fill in has_finalizer, has_vanilla_constructor, and layout_helper
> + set_precomputed_flags(this_klass);
> +
> + // reinitialize modifiers, using the InnerClasses attribute
> + int computed_modifiers =
> this_klass->compute_modifier_flags(CHECK_(nullHandle));
> + this_klass->set_modifier_flags(computed_modifiers);
> +
> + // check if this class can access its super class
> + check_super_class_access(this_klass, CHECK_(nullHandle));
> +
> + // check if this class can access its superinterfaces
> + check_super_interface_access(this_klass, CHECK_(nullHandle));
> +
> + // check if this class overrides any final method
> + check_final_method_override(this_klass, CHECK_(nullHandle));
> +
> + // check that if this class is an interface then it doesn't have static
> methods
> + if (this_klass->is_interface()) {
> + check_illegal_static_method(this_klass, CHECK_(nullHandle));
> + }
> +
> #ifdef ASSERT
> if (ParseAllGenericSignatures) {
> @@ -3773,39 +3799,17 @@ instanceKlassHandle ClassFileParser::par
> }
> #endif
> + // Generate any default methods - default methods are interface methods
> + // that have a default implementation. This is new with Lambda project.
> if (has_default_methods && !access_flags.is_interface() &&
> local_interfaces->length() > 0) {
> DefaultMethods::generate_default_methods(
> this_klass(), &all_mirandas, CHECK_(nullHandle));
> }
> +
> if (_requires_bridges && !access_flags.is_interface()) {
> DefaultMethods::create_missing_bridges(this_klass(), CHECK_(nullHandle));
> - }
> -
> - // Compute transitive closure of interfaces this class implements
> - // Do final class setup
> - fill_oop_maps(this_klass, nonstatic_oop_map_count, nonstatic_oop_offsets,
> nonstatic_oop_counts);
> -
> - // Fill in has_finalizer, has_vanilla_constructor, and layout_helper
> - set_precomputed_flags(this_klass);
> -
> - // reinitialize modifiers, using the InnerClasses attribute
> - int computed_modifiers =
> this_klass->compute_modifier_flags(CHECK_(nullHandle));
> - this_klass->set_modifier_flags(computed_modifiers);
> -
> - // check if this class can access its super class
> - check_super_class_access(this_klass, CHECK_(nullHandle));
> -
> - // check if this class can access its superinterfaces
> - check_super_interface_access(this_klass, CHECK_(nullHandle));
> -
> - // check if this class overrides any final method
> - check_final_method_override(this_klass, CHECK_(nullHandle));
> -
> - // check that if this class is an interface then it doesn't have static
> methods
> - if (this_klass->is_interface() && major_version < JAVA_8_VERSION) {
> - check_illegal_static_method(this_klass, CHECK_(nullHandle));
> }
> // Allocate mirror and initialize static fields
>
More information about the lambda-dev
mailing list