hg: valhalla/valhalla: [nestmates] Implement the following rules for hidden nestmate classes
mandy.chung at oracle.com
mandy.chung at oracle.com
Tue Oct 8 00:29:59 UTC 2019
Changeset: ad257875959a
Author: mchung
Date: 2019-10-07 17:29 -0700
URL: https://hg.openjdk.java.net/valhalla/valhalla/rev/ad257875959a
[nestmates] Implement the following rules for hidden nestmate classes
- Lookup::defineHiddenClass can optionally add a hidden class to
the nest of the lookup class
- Hidden classes cannot participate in static nest membership as
they do not have names. NestHost/NestMembers attributes on
hidden classes are ignored
- After validation, a class with a bad NestHost belongs to a nest
consisting only of itself (i.e. fallback to pretend that the
attribute was not present)
- After validation of the asymmetric NH/NM attributes (or after
a bad NH is thrown away), access control effects of nesting
structure are applied uniformly across the nest
- A hidden class belongs to one nest determined at runtime. If added
as a member to the nest of a lookup class LC, then the runtime nest
host of the hidden class HC has the same runtime nest host as LC:
a) LC has no NH attribute, LC is the runtime nest host of HC
b) LC has a valid NH attribute (H), H is the runtime nest host of HC
c) LC has a bad NH attribute, LC becomes the runtime nest of LC
- LC::getNestHost == HC::getNestHost and
LC::getNestMembers == HC::getNestMembers
! make/hotspot/symbols/symbols-unix
! src/hotspot/share/classfile/classFileParser.cpp
! src/hotspot/share/include/jvm.h
! src/hotspot/share/oops/instanceKlass.cpp
! src/hotspot/share/oops/instanceKlass.hpp
! src/hotspot/share/prims/jvm.cpp
! src/java.base/share/classes/java/lang/Class.java
! src/java.base/share/classes/java/lang/System.java
! src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
! src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
! src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
! src/java.base/share/classes/java/lang/invoke/MethodHandles.java
! src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java
! src/java.base/share/classes/jdk/internal/access/JavaLangAccess.java
! src/java.base/share/native/libjava/Class.c
! test/hotspot/jtreg/runtime/Nestmates/membership/TestDynamicNestmateMembership.java
! test/jdk/java/lang/invoke/defineHiddenClass/BasicTest.java
! test/jdk/java/lang/invoke/defineHiddenClass/HiddenNestmateTest.java
! test/jdk/java/lang/invoke/defineHiddenClass/LambdaNestedInnerTest.java
+ test/jdk/java/lang/invoke/lambda/superProtectedMethod/SuperMethodTest.java
+ test/jdk/java/lang/invoke/lambda/superProtectedMethod/q/I.java
+ test/jdk/java/lang/invoke/lambda/superProtectedMethod/q/J.java
! test/jdk/java/lang/invoke/nestmates/Invoker.java
! test/jdk/java/lang/invoke/nestmates/MyThreadLocal.java
+ test/jdk/java/lang/invoke/nestmates/NestmateExtender.java
! test/jdk/java/lang/invoke/nestmates/NestmateTest.java
+ test/jdk/java/lang/invoke/nestmates/TestNestmateTeleport.java
+ test/jdk/java/lang/invoke/nestmates/src/p/C.java
+ test/jdk/java/lang/invoke/nestmates/src/p/D.java
+ test/jdk/java/lang/invoke/nestmates/src/p/E.java
+ test/jdk/java/lang/invoke/nestmates/src/p/F.java
More information about the valhalla-dev
mailing list