[Nestmates] RFR: 8194856: [Nestmates] Activate nestmate processing for JDK Version 11 only

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Jan 15 13:15:44 UTC 2018


Javac changes look good - thanks

Maurizio


On 15/01/18 03:57, David Holmes wrote:
> Trivial update:
> - javac: only generate nestmate attributes and virtual invoke 
> bytecodes for private methods, when outputting for JDK 11 / classfile 
> version 55
> - hotspot: only read nestmate attributes if classfile version >= 55 
> (JDK 11)
>
> bug: https://bugs.openjdk.java.net/browse/JDK-8194856
> webrev: http://cr.openjdk.java.net/~dholmes/8194856/webrev/
>
> Thanks,
> David
> -----
>
> --- old/src/hotspot/share/classfile/classFileParser.cpp 2018-01-14 
> 22:35:12.386673245 -0500
> +++ new/src/hotspot/share/classfile/classFileParser.cpp 2018-01-14 
> 22:35:10.230549972 -0500
> @@ -3469,7 +3469,7 @@
>            assert(runtime_invisible_type_annotations != NULL, "null 
> invisible type annotations");
>          }
>          cfs->skip_u1(attribute_length, CHECK);
> -      } else if (_major_version >= JAVA_10_VERSION) {
> +      } else if (_major_version >= JAVA_11_VERSION) {
>          if (tag == vmSymbols::tag_nest_members()) {
>            // Check for NestMembers tag
>            if (parsed_nest_members_attribute) {
> --- 
> old/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java 
> 2018-01-14 22:35:19.063054956 -0500
> +++ 
> new/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java 
> 2018-01-14 22:35:16.894930997 -0500
> @@ -1,5 +1,5 @@
>  /*
> - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights 
> reserved.
> + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights 
> reserved.
>   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
>   *
>   * This code is free software; you can redistribute it and/or modify it
> @@ -158,13 +158,13 @@
>      /** Does the target VM support nestmate access?
>       */
>      public boolean hasNestmateAccess() {
> -        return compareTo(JDK1_10) >= 0;
> +        return compareTo(JDK1_11) >= 0;
>      }
>
>      /** Does the target VM support virtual private invocations?
>       */
>      public boolean hasVirtualPrivateInvoke() {
> -        return compareTo(JDK1_10) >= 0;
> +        return compareTo(JDK1_11) >= 0;
>      }
>
>  }




More information about the valhalla-dev mailing list