Update to use threaded fernflower
parent
26755cb82c
commit
3ce6fcd9a4
|
@ -54,7 +54,7 @@ dependencies {
|
||||||
|
|
||||||
// decompilers
|
// decompilers
|
||||||
implementation ('net.fabricmc:procyon-fabric-compilertools:0.5.35.13')
|
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
|
// source code remapping
|
||||||
implementation ('org.cadixdev:mercury:0.1.0.fabric-SNAPSHOT')
|
implementation ('org.cadixdev:mercury:0.1.0.fabric-SNAPSHOT')
|
||||||
|
|
|
@ -66,6 +66,7 @@ public class FernFlowerTask extends AbstractDecompileTask implements ForkingJava
|
||||||
options.put(IFernflowerPreferences.BYTECODE_SOURCE_MAPPING, "1");
|
options.put(IFernflowerPreferences.BYTECODE_SOURCE_MAPPING, "1");
|
||||||
options.put(IFernflowerPreferences.REMOVE_SYNTHETIC, "1");
|
options.put(IFernflowerPreferences.REMOVE_SYNTHETIC, "1");
|
||||||
options.put(IFernflowerPreferences.LOG_LEVEL, "trace");
|
options.put(IFernflowerPreferences.LOG_LEVEL, "trace");
|
||||||
|
options.put(IFernflowerPreferences.THREADS, getNumThreads());
|
||||||
getLogging().captureStandardOutput(LogLevel.LIFECYCLE);
|
getLogging().captureStandardOutput(LogLevel.LIFECYCLE);
|
||||||
|
|
||||||
List<String> args = new ArrayList<>();
|
List<String> args = new ArrayList<>();
|
||||||
|
@ -78,7 +79,6 @@ public class FernFlowerTask extends AbstractDecompileTask implements ForkingJava
|
||||||
args.add("-l=" + getLineMapFile().getAbsolutePath());
|
args.add("-l=" + getLineMapFile().getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
args.add("-t=" + getNumThreads());
|
|
||||||
args.add("-m=" + getExtension().getMappingsProvider().tinyMappings.getAbsolutePath());
|
args.add("-m=" + getExtension().getMappingsProvider().tinyMappings.getAbsolutePath());
|
||||||
|
|
||||||
//TODO, Decompiler breaks on jemalloc, J9 module-info.class?
|
//TODO, Decompiler breaks on jemalloc, J9 module-info.class?
|
||||||
|
|
|
@ -53,7 +53,6 @@ public class ForkedFFExecutor {
|
||||||
File lineMap = null;
|
File lineMap = null;
|
||||||
File mappings = null;
|
File mappings = null;
|
||||||
List<File> libraries = new ArrayList<>();
|
List<File> libraries = new ArrayList<>();
|
||||||
int numThreads = 0;
|
|
||||||
|
|
||||||
boolean isOption = true;
|
boolean isOption = true;
|
||||||
|
|
||||||
|
@ -91,8 +90,6 @@ public class ForkedFFExecutor {
|
||||||
}
|
}
|
||||||
|
|
||||||
mappings = new File(arg.substring(3));
|
mappings = new File(arg.substring(3));
|
||||||
} else if (arg.startsWith("-t=")) {
|
|
||||||
numThreads = Integer.parseInt(arg.substring(3));
|
|
||||||
} else {
|
} else {
|
||||||
if (input != null) {
|
if (input != null) {
|
||||||
throw new RuntimeException("Unable to set more than one input.");
|
throw new RuntimeException("Unable to set more than one input.");
|
||||||
|
|
|
@ -92,15 +92,11 @@ public class ThreadIDFFLogger extends IFernflowerLogger {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startMethod(String methodName) {
|
public void startMethod(String methodName) {
|
||||||
String className = workingClass.get().peek();
|
//No need to print out methods
|
||||||
line.get().push("Decompiling " + className + "." + methodName.substring(0, methodName.indexOf(" ")));
|
|
||||||
print();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void endMethod() {
|
public void endMethod() {
|
||||||
line.get().pop();
|
|
||||||
print();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue