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

Add a stub for java.lang.invoke.MethodHandleImpl #20570

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

babsingh
Copy link
Contributor

OpenJ9 JDK8 and JDK11 currently use OpenJ9 MethodHandles.

Enabling jdk_bean in JDK8 and JDK11 triggers certain OpenJDK
MethodHandles code paths. However, OpenJ9 MethodHandles are in use
for JDK8 and JDK11, so OpenJDK MethodHandles paths shouldn't be
activated. To address this, a MethodHandleImpl stub was added,
used only with OpenJ9 MethodHandles, and not when OpenJDK
MethodHandles are enabled.

Related: #20531

@babsingh
Copy link
Contributor Author

babsingh commented Nov 12, 2024

fyi @pshipton @llxia, This should fix the InternalError ... OpenJDKCompileStubThrowError failures in JDK8 and JDK11 that were seen in #20531.

@pshipton
Copy link
Member

jenkins test sanity alinux jdk8,jdk11

@pshipton
Copy link
Member

java/lang/invoke/CustomizedLambdaFormTest.java failed.

00:53:26  /home/jenkins/workspace/Test_openjdk11_j9_sanity.openjdk_aarch64_linux_Personal_testList_1/aqa-tests/openjdk/openjdk-jdk/test/jdk/java/lang/invoke/java.base/java/lang/invoke/MethodHandleHelper.java:44: error: cannot find symbol
00:53:26          return MethodHandleImpl.varargsArray(nargs);
00:53:26                                 ^
00:53:26    symbol:   method varargsArray(int)
00:53:26    location: class MethodHandleImpl
00:53:26  /home/jenkins/workspace/Test_openjdk11_j9_sanity.openjdk_aarch64_linux_Personal_testList_1/aqa-tests/openjdk/openjdk-jdk/test/jdk/java/lang/invoke/java.base/java/lang/invoke/MethodHandleHelper.java:48: error: cannot find symbol
00:53:26          return MethodHandleImpl.varargsArray(arrayType, nargs);
00:53:26                                 ^
00:53:26    symbol:   method varargsArray(Class<CAP#1>,int)
00:53:26    location: class MethodHandleImpl
00:53:26    where CAP#1 is a fresh type-variable:
00:53:26      CAP#1 extends Object from capture of ?
00:53:26  2 errors

@pshipton
Copy link
Member

jenkins test extended.openjdk amac jdk11

@pshipton
Copy link
Member

OpenJ9 JDK8 and JDK11 currently use OpenJ9 MethodHandles.

Enabling jdk_bean in JDK8 and JDK11 triggers certain OpenJDK
MethodHandles code paths. However, OpenJ9 MethodHandles are in use
for JDK8 and JDK11, so OpenJDK MethodHandles paths shouldn't be
activated. To address this, a MethodHandleImpl stub was added,
used only with OpenJ9 MethodHandles, and not when OpenJDK
MethodHandles are enabled.

Related: eclipse-openj9#20531

Signed-off-by: Babneet Singh <[email protected]>
@babsingh
Copy link
Contributor Author

babsingh commented Nov 12, 2024

Added stubs for varargsArray to fix the failure reported in #20570 (comment). Old PR builds:

@babsingh
Copy link
Contributor Author

babsingh commented Nov 12, 2024

https://openj9-jenkins.osuosl.org/job/Test_openjdk11_j9_extended.openjdk_aarch64_mac_Personal/2/consoleFull

10:06:02   Target VM failed to initialize.
10:06:02  java.lang.NullPointerException
10:06:02  	at VMConnection.open(VMConnection.java:157)
10:06:02  	at TestScaffold.connect(TestScaffold.java:636)
10:06:02  	at TestScaffold.startUp(TestScaffold.java:364)
10:06:02  	at TestScaffold.startTo(TestScaffold.java:374)
10:06:02  	at TestScaffold.startToMain(TestScaffold.java:369)
10:06:02  	at ClassesByName2Test.runTests(ClassesByName2Test.java:147)
10:06:02  	at TestScaffold.startTests(TestScaffold.java:431)
10:06:02  	at ClassesByName2Test.main(ClassesByName2Test.java:123)
10:06:02  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
10:06:02  	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
10:06:02  	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
10:06:02  	at java.base/java.lang.reflect.Method.invoke(Method.java:572)
10:06:02  	at com.sun.javatest.regtest.agent.MainActionHelper$AgentVMRunnable.run(MainActionHelper.java:333)
10:06:02  	at java.base/java.lang.Thread.run(Thread.java:835)

@pshipton
Copy link
Member

jenkins compile amac jdk11

@pshipton
Copy link
Member

java/lang/invoke/CustomizedLambdaFormTest.java passed in a grinder.

@pshipton pshipton merged commit a79854a into eclipse-openj9:master Nov 12, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants