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

[GR-62356] Replace ASM with ClassFile API #10758

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

graalvmbot
Copy link
Collaborator

This PR replaces ASM usage with ClassFile API in Graal unit tests. There are three kind of usages:

  1. static analysis: see jdk.graal.compiler.core.test.OptionsVerifierTest
  2. bytecode manipulation: see jdk.graal.compiler.replacements.test.UnsafeObjectReplacementsTest
  3. class construction: all the rest

CustomizedBytecodePatternTest is now an interface and allows multiple definition in subclass, see jdk.graal.compiler.core.test.ResolveDynamicConstantTest

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 25, 2025
@mur47x111
Copy link
Member

@liach could you please review this PR and see if there is anything that can be improved?

.trying(tryBlock -> {
tryBlock
.iload(1)
.invokestatic(classSharedExceptionHandlerClass, "foo", MethodTypeDesc.of(CD_int, CD_int))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can cache this MethodTypeDesc in a variable and reuse that variable. MethodTypeDesc caches its descriptor string, so reusing the same instance is actually helpful to the ClassFile API's generation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants