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

Apply ForgeFlower's patches #8

Merged
merged 69 commits into from May 12, 2021
Merged

Apply ForgeFlower's patches #8

merged 69 commits into from May 12, 2021

Conversation

jaskarth
Copy link
Member

This PR applies ForgeFlower's patches to our current working tree, to reduce the amount of work needed on our part. Many of their patches have been tried and tested in creating good results for decompiled code, which provides a strong base to work off of. Much more testing and cleanup work needs to be done before it can be merged so the PR is in a draft state at the moment.

cdracm and others added 30 commits April 20, 2021 19:51
…ic System.arraycopy()

GitOrigin-RevId: 16b9869eae4200f4ff24c4535d7f33d8e6847b4c
GitOrigin-RevId: 6ed9b1ee1df87618c9b8c534e328ea89ead9fdc3
…n range

PR #1026

GitOrigin-RevId: 18492644f44796505f5a4be9471344c1ce1d0f3a
… time (IDEA-259329)

GitOrigin-RevId: b2f2c85514d360e8d716e6f136f7c11760086f0e
GitOrigin-RevId: ce15f37f8882fb7915cf5c8b62e3cc4601a5cc76
…ing Gradle version

GitOrigin-RevId: 068aadf4b64097c66de34ff19134f57083d2ac66
PR #1406

GitOrigin-RevId: 501d3b66e790316f8ab52606ea4cba41665213c0
…es; test data layout; typos; formatting)

GitOrigin-RevId: 3589e4d8f2dfa8a5096fcf49070bc65ba6734482
GitOrigin-RevId: 63c315cd01502cbdd76a1ef2c86b3634ce6250fd
GitOrigin-RevId: f6f84befdd81adfe54616cad5e1b69514e0335dc
GitOrigin-RevId: e20e9b802600dec52700065a7a29799c73c1dc49
GitOrigin-RevId: c2f9cfd88f57e7d59cca54ec090f67f29377ff23
GitOrigin-RevId: 9a18d056d33847d77a8ca2177567a6c5d5ec9d8b
GitOrigin-RevId: bac64af4495e36b044873f6a97625342af907bec
GitOrigin-RevId: 6eb52135a5bfdf772bb10d3120648500a95325a4
It gives better speed and functionality. Added method to gather bytecode markers for every expression. Allows us to get the bytecode offsets for an entire block of code. Also more aggressively capture bytecode ranges to better understand how much of the code we are processing/outputting
This is used in several later commits.
JDLogic and others added 13 commits April 20, 2021 20:09
Java 9+ added overrides to these functions to return the specific subclass, however, when there is a compiler "bug" that when targeting release * or below, it will still reference these new methods, causing exceptions at runtime on Java 8.
Revert part of a change introduced upstream. MinecraftForge/FernFlower@81faff6#diff-e057d0d70e5b15f5e12ec86ac46c85eeR57
This upstream change causes local variables to not be inlined in many cases, and makes decomp very messy for the reason of 'thread safety'.
…e target jar.

Uses a prefix system, so -only=net/minecraft/block/ will decompile all classes in the block package and subpackages.
Useful for debugging to limit scope/runtime.
Breaks outer this references. Code existed before my time, no idea what it's intention is.
It's staggering how many exceptions there were, but in the end my application that I used to test this against was decompiled without any significant errors (there's still the issue of <unknown> being used in enchanted for-loops) and correct logic (compared to the output of Krakatau). Of course I'd now need to figure out how to decompile enums.

Co-Authored-By: Geolykt <admin@geolykt.de>
Some tests are broken, but they are commented out for the time being. They'll need another look at in the future
@jaskarth jaskarth marked this pull request as ready for review April 22, 2021 19:33
@jaskarth
Copy link
Member Author

Most of the glaring issues have been fixed, and while there are certainly areas for improvement what we have now should be ready to go and can be fixed up in the future, as they do not directly affect the decompilation of the Minecraft codebase. Due to the large scope of this PR I'm not expecting anyone to actually review it, but any and all comments are appreciated.

@kashike kashike dismissed their stale review April 23, 2021 09:41

Resolved.

@jaskarth jaskarth merged commit 161eeca into Vineflower:master May 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet