jdk icon indicating copy to clipboard operation
jdk copied to clipboard

8307818: Convert Indify tool to Classfile API

Open OssamaLouati opened this issue 1 year ago • 4 comments

An indify tool in j.l.i tests (also in vmTestBase) convert some source-code private static methods with MT_ MH_, and INDY_ prefixes into MethodHandle, MethodType, and CallSite constants. It currently uses ad-hoc code to process class files and intends to migrate to ASM; but since we have the Classfile API, we can migrate to Classfile API instead.


Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

Issue

  • JDK-8307818: Convert Indify tool to Classfile API (Sub-task - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/18841/head:pull/18841
$ git checkout pull/18841

Update a local copy of the PR:
$ git checkout pull/18841
$ git pull https://git.openjdk.org/jdk.git pull/18841/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18841

View PR using the GUI difftool:
$ git pr show -t 18841

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/18841.diff

OssamaLouati avatar Apr 18 '24 13:04 OssamaLouati

:wave: Welcome back OssamaLouati! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

bridgekeeper[bot] avatar Apr 18 '24 13:04 bridgekeeper[bot]

❗ This change is not yet ready to be integrated. See the Progress checklist in the description for automated requirements.

openjdk[bot] avatar Apr 18 '24 13:04 openjdk[bot]

@OssamaLouati The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

openjdk[bot] avatar Apr 18 '24 13:04 openjdk[bot]

This is going to be a difficult task because of the sheer size of indify tool; to migrate you really need in-depth understanding of both indify and CF API. Good luck!

Thank you

OssamaLouati avatar Apr 18 '24 14:04 OssamaLouati

Minimal change to enable preview for build and run of the Indify tool is drafted here: https://github.com/openjdk/jdk/commit/7c2344b275da1dff99ade284192488eaa8ffba02

asotona avatar May 21 '24 11:05 asotona

Indify invocation on Microbenchmarks as a part of the JDK build (after application of the above patch) still fails with:

Failure on /Applications/XcodeJIB.app/dev/github/jdk/build/macosx-aarch64/support/test/micro/classes
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.lang.classfile.ClassModel.thisClass()" because "model" is null
	at java.base/java.lang.classfile.ClassFile.transform(ClassFile.java:445)
	at indify.Indify.transformToBytes(Indify.java:369)
	at indify.Indify.writeNewClassFile(Indify.java:360)
	at indify.Indify.indifyFile(Indify.java:356)
	at indify.Indify.indifyTree(Indify.java:391)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indify(Indify.java:339)
	at indify.Indify.run(Indify.java:191)
	at indify.Indify.main(Indify.java:101)

asotona avatar May 21 '24 11:05 asotona

Indify invocation on Microbenchmarks as a part of the JDK build (after application of the above patch) still fails with:

Failure on /Applications/XcodeJIB.app/dev/github/jdk/build/macosx-aarch64/support/test/micro/classes
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.lang.classfile.ClassModel.thisClass()" because "model" is null
	at java.base/java.lang.classfile.ClassFile.transform(ClassFile.java:445)
	at indify.Indify.transformToBytes(Indify.java:369)
	at indify.Indify.writeNewClassFile(Indify.java:360)
	at indify.Indify.indifyFile(Indify.java:356)
	at indify.Indify.indifyTree(Indify.java:391)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indifyTree(Indify.java:393)
	at indify.Indify.indify(Indify.java:339)
	at indify.Indify.run(Indify.java:191)
	at indify.Indify.main(Indify.java:101)

I applied a patch addressing this issue, the tool invocation should pass now on Microbenchmarks.

OssamaLouati avatar May 21 '24 23:05 OssamaLouati

@OssamaLouati This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

bridgekeeper[bot] avatar Jul 23 '24 16:07 bridgekeeper[bot]

@OssamaLouati This pull request has been inactive for more than 8 weeks and will now be automatically closed. If you would like to continue working on this pull request in the future, feel free to reopen it! This can be done using the /open pull request command.

bridgekeeper[bot] avatar Sep 09 '24 10:09 bridgekeeper[bot]