From 3ce6fcd9a4189ac8b4c9577f9d606f5b8c3d535e Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Fri, 24 Apr 2020 13:36:50 +0100 Subject: [PATCH] Update to use threaded fernflower --- build.gradle | 2 +- .../net/fabricmc/loom/task/fernflower/FernFlowerTask.java | 2 +- .../net/fabricmc/loom/task/fernflower/ForkedFFExecutor.java | 3 --- .../net/fabricmc/loom/task/fernflower/ThreadIDFFLogger.java | 6 +----- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 65f25a3..c52da48 100644 --- a/build.gradle +++ b/build.gradle @@ -54,7 +54,7 @@ dependencies { // decompilers implementation ('net.fabricmc:procyon-fabric-compilertools:0.5.35.13') - implementation ('org.jetbrains:intellij-fernflower:1.1.0.11') + implementation ('org.jetbrains:intellij-fernflower:1.2.0') // source code remapping implementation ('org.cadixdev:mercury:0.1.0.fabric-SNAPSHOT') diff --git a/src/main/java/net/fabricmc/loom/task/fernflower/FernFlowerTask.java b/src/main/java/net/fabricmc/loom/task/fernflower/FernFlowerTask.java index fa7a2a4..d2881d7 100644 --- a/src/main/java/net/fabricmc/loom/task/fernflower/FernFlowerTask.java +++ b/src/main/java/net/fabricmc/loom/task/fernflower/FernFlowerTask.java @@ -66,6 +66,7 @@ public class FernFlowerTask extends AbstractDecompileTask implements ForkingJava options.put(IFernflowerPreferences.BYTECODE_SOURCE_MAPPING, "1"); options.put(IFernflowerPreferences.REMOVE_SYNTHETIC, "1"); options.put(IFernflowerPreferences.LOG_LEVEL, "trace"); + options.put(IFernflowerPreferences.THREADS, getNumThreads()); getLogging().captureStandardOutput(LogLevel.LIFECYCLE); List args = new ArrayList<>(); @@ -78,7 +79,6 @@ public class FernFlowerTask extends AbstractDecompileTask implements ForkingJava args.add("-l=" + getLineMapFile().getAbsolutePath()); } - args.add("-t=" + getNumThreads()); args.add("-m=" + getExtension().getMappingsProvider().tinyMappings.getAbsolutePath()); //TODO, Decompiler breaks on jemalloc, J9 module-info.class? diff --git a/src/main/java/net/fabricmc/loom/task/fernflower/ForkedFFExecutor.java b/src/main/java/net/fabricmc/loom/task/fernflower/ForkedFFExecutor.java index b60de1c..10b5ccf 100644 --- a/src/main/java/net/fabricmc/loom/task/fernflower/ForkedFFExecutor.java +++ b/src/main/java/net/fabricmc/loom/task/fernflower/ForkedFFExecutor.java @@ -53,7 +53,6 @@ public class ForkedFFExecutor { File lineMap = null; File mappings = null; List libraries = new ArrayList<>(); - int numThreads = 0; boolean isOption = true; @@ -91,8 +90,6 @@ public class ForkedFFExecutor { } mappings = new File(arg.substring(3)); - } else if (arg.startsWith("-t=")) { - numThreads = Integer.parseInt(arg.substring(3)); } else { if (input != null) { throw new RuntimeException("Unable to set more than one input."); diff --git a/src/main/java/net/fabricmc/loom/task/fernflower/ThreadIDFFLogger.java b/src/main/java/net/fabricmc/loom/task/fernflower/ThreadIDFFLogger.java index 2740299..0d69a4b 100644 --- a/src/main/java/net/fabricmc/loom/task/fernflower/ThreadIDFFLogger.java +++ b/src/main/java/net/fabricmc/loom/task/fernflower/ThreadIDFFLogger.java @@ -92,15 +92,11 @@ public class ThreadIDFFLogger extends IFernflowerLogger { @Override public void startMethod(String methodName) { - String className = workingClass.get().peek(); - line.get().push("Decompiling " + className + "." + methodName.substring(0, methodName.indexOf(" "))); - print(); + //No need to print out methods } @Override public void endMethod() { - line.get().pop(); - print(); } @Override