diff options
| author | 2020-04-02 10:36:27 -0500 | |
|---|---|---|
| committer | 2020-04-02 16:36:27 +0100 | |
| commit | ccccfa1786d783867daf91fbfa522d4a5c55dfdb (patch) | |
| tree | b09cbde37e4757c993d59dfd70bfee81fbbd5e63 /src/main/java/cuchaz/enigma/analysis | |
| parent | Merge pull request #203 from Runemoro/fix-cfr (diff) | |
| download | enigma-fork-ccccfa1786d783867daf91fbfa522d4a5c55dfdb.tar.gz enigma-fork-ccccfa1786d783867daf91fbfa522d4a5c55dfdb.tar.xz enigma-fork-ccccfa1786d783867daf91fbfa522d4a5c55dfdb.zip | |
Support java 9+ and gradle 6+ (#206)
* Support java 9+ and gradle 6+
* Update asm
Signed-off-by: liach <liach@users.noreply.github.com>
* Use asm 8 and move that to a constant
* Bump version
* fix version format
Co-authored-by: liach <liach@users.noreply.github.com>
Diffstat (limited to 'src/main/java/cuchaz/enigma/analysis')
5 files changed, 11 insertions, 6 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/BuiltinPlugin.java b/src/main/java/cuchaz/enigma/analysis/BuiltinPlugin.java index fddd9a8..dc3f553 100644 --- a/src/main/java/cuchaz/enigma/analysis/BuiltinPlugin.java +++ b/src/main/java/cuchaz/enigma/analysis/BuiltinPlugin.java | |||
| @@ -12,6 +12,7 @@ import cuchaz.enigma.translation.representation.entry.ClassEntry; | |||
| 12 | import cuchaz.enigma.translation.representation.entry.Entry; | 12 | import cuchaz.enigma.translation.representation.entry.Entry; |
| 13 | import cuchaz.enigma.translation.representation.entry.FieldEntry; | 13 | import cuchaz.enigma.translation.representation.entry.FieldEntry; |
| 14 | import cuchaz.enigma.utils.Pair; | 14 | import cuchaz.enigma.utils.Pair; |
| 15 | import cuchaz.enigma.utils.Utils; | ||
| 15 | import org.objectweb.asm.ClassReader; | 16 | import org.objectweb.asm.ClassReader; |
| 16 | import org.objectweb.asm.ClassVisitor; | 17 | import org.objectweb.asm.ClassVisitor; |
| 17 | import org.objectweb.asm.FieldVisitor; | 18 | import org.objectweb.asm.FieldVisitor; |
| @@ -69,7 +70,7 @@ public final class BuiltinPlugin implements EnigmaPlugin { | |||
| 69 | private final List<MethodNode> classInits = new ArrayList<>(); | 70 | private final List<MethodNode> classInits = new ArrayList<>(); |
| 70 | 71 | ||
| 71 | EnumFieldNameFindingVisitor(Map<Entry<?>, String> mappings) { | 72 | EnumFieldNameFindingVisitor(Map<Entry<?>, String> mappings) { |
| 72 | super(Opcodes.ASM7); | 73 | super(Utils.ASM_VERSION); |
| 73 | this.mappings = mappings; | 74 | this.mappings = mappings; |
| 74 | } | 75 | } |
| 75 | 76 | ||
diff --git a/src/main/java/cuchaz/enigma/analysis/ClassCache.java b/src/main/java/cuchaz/enigma/analysis/ClassCache.java index d97b204..f694bf3 100644 --- a/src/main/java/cuchaz/enigma/analysis/ClassCache.java +++ b/src/main/java/cuchaz/enigma/analysis/ClassCache.java | |||
| @@ -7,6 +7,7 @@ import cuchaz.enigma.ClassProvider; | |||
| 7 | import cuchaz.enigma.ProgressListener; | 7 | import cuchaz.enigma.ProgressListener; |
| 8 | import cuchaz.enigma.analysis.index.JarIndex; | 8 | import cuchaz.enigma.analysis.index.JarIndex; |
| 9 | import cuchaz.enigma.bytecode.translators.LocalVariableFixVisitor; | 9 | import cuchaz.enigma.bytecode.translators.LocalVariableFixVisitor; |
| 10 | import cuchaz.enigma.utils.Utils; | ||
| 10 | import org.objectweb.asm.ClassReader; | 11 | import org.objectweb.asm.ClassReader; |
| 11 | import org.objectweb.asm.ClassVisitor; | 12 | import org.objectweb.asm.ClassVisitor; |
| 12 | import org.objectweb.asm.Opcodes; | 13 | import org.objectweb.asm.Opcodes; |
| @@ -77,7 +78,7 @@ public final class ClassCache implements AutoCloseable, ClassProvider { | |||
| 77 | 78 | ||
| 78 | ClassNode node = new ClassNode(); | 79 | ClassNode node = new ClassNode(); |
| 79 | 80 | ||
| 80 | LocalVariableFixVisitor visitor = new LocalVariableFixVisitor(Opcodes.ASM5, node); | 81 | LocalVariableFixVisitor visitor = new LocalVariableFixVisitor(Utils.ASM_VERSION, node); |
| 81 | reader.accept(visitor, 0); | 82 | reader.accept(visitor, 0); |
| 82 | 83 | ||
| 83 | return node; | 84 | return node; |
diff --git a/src/main/java/cuchaz/enigma/analysis/IndexSimpleVerifier.java b/src/main/java/cuchaz/enigma/analysis/IndexSimpleVerifier.java index da2b5ef..80a7154 100644 --- a/src/main/java/cuchaz/enigma/analysis/IndexSimpleVerifier.java +++ b/src/main/java/cuchaz/enigma/analysis/IndexSimpleVerifier.java | |||
| @@ -5,6 +5,7 @@ import cuchaz.enigma.analysis.index.InheritanceIndex; | |||
| 5 | import cuchaz.enigma.translation.representation.AccessFlags; | 5 | import cuchaz.enigma.translation.representation.AccessFlags; |
| 6 | import cuchaz.enigma.translation.representation.entry.ClassDefEntry; | 6 | import cuchaz.enigma.translation.representation.entry.ClassDefEntry; |
| 7 | import cuchaz.enigma.translation.representation.entry.ClassEntry; | 7 | import cuchaz.enigma.translation.representation.entry.ClassEntry; |
| 8 | import cuchaz.enigma.utils.Utils; | ||
| 8 | import org.objectweb.asm.Type; | 9 | import org.objectweb.asm.Type; |
| 9 | import org.objectweb.asm.tree.analysis.BasicValue; | 10 | import org.objectweb.asm.tree.analysis.BasicValue; |
| 10 | import org.objectweb.asm.tree.analysis.SimpleVerifier; | 11 | import org.objectweb.asm.tree.analysis.SimpleVerifier; |
| @@ -17,7 +18,7 @@ public class IndexSimpleVerifier extends SimpleVerifier { | |||
| 17 | private final InheritanceIndex inheritanceIndex; | 18 | private final InheritanceIndex inheritanceIndex; |
| 18 | 19 | ||
| 19 | public IndexSimpleVerifier(EntryIndex entryIndex, InheritanceIndex inheritanceIndex) { | 20 | public IndexSimpleVerifier(EntryIndex entryIndex, InheritanceIndex inheritanceIndex) { |
| 20 | super(ASM7, null, null, null, false); | 21 | super(Utils.ASM_VERSION, null, null, null, false); |
| 21 | this.entryIndex = entryIndex; | 22 | this.entryIndex = entryIndex; |
| 22 | this.inheritanceIndex = inheritanceIndex; | 23 | this.inheritanceIndex = inheritanceIndex; |
| 23 | } | 24 | } |
diff --git a/src/main/java/cuchaz/enigma/analysis/InterpreterPair.java b/src/main/java/cuchaz/enigma/analysis/InterpreterPair.java index af74c85..f260729 100644 --- a/src/main/java/cuchaz/enigma/analysis/InterpreterPair.java +++ b/src/main/java/cuchaz/enigma/analysis/InterpreterPair.java | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | package cuchaz.enigma.analysis; | 1 | package cuchaz.enigma.analysis; |
| 2 | 2 | ||
| 3 | import cuchaz.enigma.utils.Utils; | ||
| 3 | import org.objectweb.asm.Opcodes; | 4 | import org.objectweb.asm.Opcodes; |
| 4 | import org.objectweb.asm.Type; | 5 | import org.objectweb.asm.Type; |
| 5 | import org.objectweb.asm.tree.AbstractInsnNode; | 6 | import org.objectweb.asm.tree.AbstractInsnNode; |
| @@ -16,7 +17,7 @@ public class InterpreterPair<V extends Value, W extends Value> extends Interpret | |||
| 16 | private final Interpreter<W> right; | 17 | private final Interpreter<W> right; |
| 17 | 18 | ||
| 18 | public InterpreterPair(Interpreter<V> left, Interpreter<W> right) { | 19 | public InterpreterPair(Interpreter<V> left, Interpreter<W> right) { |
| 19 | super(Opcodes.ASM7); | 20 | super(Utils.ASM_VERSION); |
| 20 | this.left = left; | 21 | this.left = left; |
| 21 | this.right = right; | 22 | this.right = right; |
| 22 | } | 23 | } |
diff --git a/src/main/java/cuchaz/enigma/analysis/index/JarIndex.java b/src/main/java/cuchaz/enigma/analysis/index/JarIndex.java index c96e774..e401c2f 100644 --- a/src/main/java/cuchaz/enigma/analysis/index/JarIndex.java +++ b/src/main/java/cuchaz/enigma/analysis/index/JarIndex.java | |||
| @@ -22,6 +22,7 @@ import cuchaz.enigma.translation.representation.Lambda; | |||
| 22 | import cuchaz.enigma.translation.representation.entry.*; | 22 | import cuchaz.enigma.translation.representation.entry.*; |
| 23 | import cuchaz.enigma.utils.I18n; | 23 | import cuchaz.enigma.utils.I18n; |
| 24 | 24 | ||
| 25 | import cuchaz.enigma.utils.Utils; | ||
| 25 | import org.objectweb.asm.ClassReader; | 26 | import org.objectweb.asm.ClassReader; |
| 26 | import org.objectweb.asm.Opcodes; | 27 | import org.objectweb.asm.Opcodes; |
| 27 | 28 | ||
| @@ -63,10 +64,10 @@ public class JarIndex implements JarIndexer { | |||
| 63 | progress.init(4, I18n.translate("progress.jar.indexing")); | 64 | progress.init(4, I18n.translate("progress.jar.indexing")); |
| 64 | 65 | ||
| 65 | progress.step(1, I18n.translate("progress.jar.indexing.entries")); | 66 | progress.step(1, I18n.translate("progress.jar.indexing.entries")); |
| 66 | classCache.visit(() -> new IndexClassVisitor(this, Opcodes.ASM5), ClassReader.SKIP_CODE); | 67 | classCache.visit(() -> new IndexClassVisitor(this, Utils.ASM_VERSION), ClassReader.SKIP_CODE); |
| 67 | 68 | ||
| 68 | progress.step(2, I18n.translate("progress.jar.indexing.references")); | 69 | progress.step(2, I18n.translate("progress.jar.indexing.references")); |
| 69 | classCache.visit(() -> new IndexReferenceVisitor(this, entryIndex, inheritanceIndex, Opcodes.ASM5), 0); | 70 | classCache.visit(() -> new IndexReferenceVisitor(this, entryIndex, inheritanceIndex, Utils.ASM_VERSION), 0); |
| 70 | 71 | ||
| 71 | progress.step(3, I18n.translate("progress.jar.indexing.methods")); | 72 | progress.step(3, I18n.translate("progress.jar.indexing.methods")); |
| 72 | bridgeMethodIndex.findBridgeMethods(); | 73 | bridgeMethodIndex.findBridgeMethods(); |