Make classpath entries properly lazy #118
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This primarily reduces the memory consumed by FF, now able to decompile one of the 1.18.2 snapshots with a minimum of 2GB of ram, rather than the 4+GB previously required.
There may be some performance improvements from this change as well, but the difference between this change and just #116 is pretty negligible, so it's not super useful for judging this PR.
I've also introduced a
-jrt <1|current|path>
option, which allows reading JDK classes from a JEP220 java runtime image, or the legacyrt/lib/*.jar
andlib/*.jar
format, to cover modern and pre-J9 runtimes. This means that users who want to decompile classes produced for a version of Java older than the one required for Forgeflower (now J17) can reference that runtime, without any attachment to what FF requires.There is no change to the decompiled output from this branch.
Currently, these changes are tacked into a patch at the end of the list -- once I gather up the motivation/initial review has happened, I'll move the lazy classpath patch earlier in the sequence, so later patches can make their changes taking advantage of the lazy classpath API. I'll leave it as a draft until then.