Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDK16 changes for Hidden Classes #11321

Closed
tajila opened this issue Dec 1, 2020 · 6 comments
Closed

JDK16 changes for Hidden Classes #11321

tajila opened this issue Dec 1, 2020 · 6 comments
Assignees
Labels
comp:vm project:MH Used to track Method Handles related work

Comments

@tajila
Copy link
Contributor

tajila commented Dec 1, 2020

See https://bugs.openjdk.java.net/browse/JDK-8256214

Some changes to Lookup

@tajila
Copy link
Contributor Author

tajila commented Dec 1, 2020

@hangshao0

@hangshao0
Copy link
Contributor

I will look at this.

@babsingh
Copy link
Contributor

babsingh commented Dec 1, 2020

In https://bugs.openjdk.java.net/browse/JDK-8256214, the new specification introduces the following new methods and updates few old methods:

    In java.lang.invoke.MethodHandles.Lookup class:
        New Lookup::defineHiddenClassWithClassData method
        New Lookup::ORIGINAL mode and the following methods are updated to reflect this new mode
            Lookup::lookupModes
            Lookup::in
            Lookup::dropLookupIn
    java.lang.invoke.MethodHandles class
        New MethodHandles::classData(Lookup lookup, String name, Class<?> type) static method
        New MethodHandles::classDataAt(Lookup lookup, String name, Class<?> type, int index) static method
        MethodHandles::lookup and MethodHandles::privateLookupIn are updated to reflect the new ORIGINAL mode

Since we plan to move to OpenJDK MH (#7352) in JDK16, the above Java changes to J9 classes can be avoided. We can do minimal changes to get JDK16 builds re-enabled in the short term.

@hangshao0
Copy link
Contributor

Since we plan to move to OpenJDK MH (#7352) in JDK16, the above Java changes to J9 classes can be avoided.

I agree. I was planning to just add the missing bit ORIGINAL and the public API to resolve the compilation issue. But from #11312 (comment) I see you are already doing that.

babsingh added a commit to babsingh/openj9 that referenced this issue Dec 2, 2020
The new Lookup.ORIGINAL field (= 0x40) conflicts with
Lookup.INTERNAL_PRIVILEGED. Since INTERNAL_PRIVILEGED is J9 specific, it
is given a different value (= 0x80).

In JDK16, defineHiddenClassWithClassData has changed to a public method;
and the initOption is supplied by the caller instead of it always being
true.

Related:
eclipse-openj9#11312
eclipse-openj9#11321

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
@hangshao0
Copy link
Contributor

Since #11322 is merged, I think this can be closed. All the new changes here are in OpenJDK MH, which will be consumed by OpenJ9 in Java 16.

@babsingh
Copy link
Contributor

babsingh commented Dec 3, 2020

Updated refs:

  1. https://bugs.openjdk.java.net/browse/JDK-8256214
  2. https://bugs.openjdk.java.net/browse/JDK-8230501

Related commit: ibmruntimes/openj9-openjdk-jdk@1e8bd60

All is Java code. No native dependencies found.
+1 to close this issue.
But, we should relate it to project:MH to verify functionality once OpenJDK MH is enabled in OpenJ9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:vm project:MH Used to track Method Handles related work
Projects
None yet
Development

No branches or pull requests

3 participants