-
Notifications
You must be signed in to change notification settings - Fork 6k
8359707: Add classfile modification code to RedefineClassHelper #25857
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
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back coleenp! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
/label add hotspot-runtime |
@coleenp |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable. I've posted one nit suggestion.
test/lib/RedefineClassHelper.java
Outdated
* @param newString new class name to replace with old class name. | ||
*/ | ||
|
||
public static byte[] replaceAllStrings(ClassLoader loader, String oldString, String newString) throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I'd suggest to rename parameters:
oldString
=> oldClassName
newString
=> newClassName
Alternatively, it is possible to pass bytecodes buffer instead of class loader and keep oldString
and newString
as before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted this code to also read bytecodes off the disk and not the caller do that either. The code for getBytecodes or very similar is duplicated all over the tests also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add a byte buffer version though.
I copied this code for another test in the Valhalla repo and thought it would be a good utility function. It might be better written using the Classfile API.
Tested with test.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25857/head:pull/25857
$ git checkout pull/25857
Update a local copy of the PR:
$ git checkout pull/25857
$ git pull https://git.openjdk.org/jdk.git pull/25857/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25857
View PR using the GUI difftool:
$ git pr show -t 25857
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25857.diff
Using Webrev
Link to Webrev Comment