Commit ed9c4a6b authored by Andrey Loskutov's avatar Andrey Loskutov

Use latest ASM version to support Java 10+

parent 23edc025
eclipse.home=D:/work/eclipse-SDK-4.9/eclipse
\ No newline at end of file
...@@ -45,7 +45,7 @@ public class CommentedASMifierClassVisitor extends ASMifier implements ICommente ...@@ -45,7 +45,7 @@ public class CommentedASMifierClassVisitor extends ASMifier implements ICommente
private final ClassNode classNode; private final ClassNode classNode;
private CommentedASMifierClassVisitor(ClassNode classNode, final DecompilerOptions options, String name, int id) { private CommentedASMifierClassVisitor(ClassNode classNode, final DecompilerOptions options, String name, int id) {
super(Opcodes.ASM6, name, id); super(DecompilerOptions.LATEST_ASM_VERSION, name, id);
this.classNode = classNode; this.classNode = classNode;
this.options = options; this.options = options;
showLines = options.modes.get(BCOConstants.F_SHOW_LINE_INFO); showLines = options.modes.get(BCOConstants.F_SHOW_LINE_INFO);
...@@ -320,7 +320,7 @@ public class CommentedASMifierClassVisitor extends ASMifier implements ICommente ...@@ -320,7 +320,7 @@ public class CommentedASMifierClassVisitor extends ASMifier implements ICommente
private ASMifier getDummyVisitor(){ private ASMifier getDummyVisitor(){
if (dummyAnnVisitor == null) { if (dummyAnnVisitor == null) {
dummyAnnVisitor = new ASMifier(Opcodes.ASM6, "", -1) { dummyAnnVisitor = new ASMifier(DecompilerOptions.LATEST_ASM_VERSION, "", -1) {
@Override @Override
public void visitAnnotationEnd() { public void visitAnnotationEnd() {
text.clear(); text.clear();
......
...@@ -44,7 +44,7 @@ public class CommentedClassVisitor extends Textifier implements ICommentedClassV ...@@ -44,7 +44,7 @@ public class CommentedClassVisitor extends Textifier implements ICommentedClassV
private int currentInsn; private int currentInsn;
public CommentedClassVisitor(ClassNode classNode, final DecompilerOptions options) { public CommentedClassVisitor(ClassNode classNode, final DecompilerOptions options) {
super(Opcodes.ASM6); super(DecompilerOptions.LATEST_ASM_VERSION);
this.classNode = classNode; this.classNode = classNode;
this.options = options; this.options = options;
raw = !options.modes.get(BCOConstants.F_SHOW_RAW_BYTECODE); raw = !options.modes.get(BCOConstants.F_SHOW_RAW_BYTECODE);
...@@ -573,7 +573,7 @@ public class CommentedClassVisitor extends Textifier implements ICommentedClassV ...@@ -573,7 +573,7 @@ public class CommentedClassVisitor extends Textifier implements ICommentedClassV
private Textifier getDummyVisitor(){ private Textifier getDummyVisitor(){
if (dummyAnnVisitor == null) { if (dummyAnnVisitor == null) {
dummyAnnVisitor = new Textifier(Opcodes.ASM6) { dummyAnnVisitor = new Textifier(DecompilerOptions.LATEST_ASM_VERSION) {
@Override @Override
public void visitAnnotationEnd() { public void visitAnnotationEnd() {
text.clear(); text.clear();
......
...@@ -13,7 +13,6 @@ import java.util.ArrayList; ...@@ -13,7 +13,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassReader;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.ClassNode; import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.util.Printer; import org.objectweb.asm.util.Printer;
import org.objectweb.asm.util.TraceClassVisitor; import org.objectweb.asm.util.TraceClassVisitor;
...@@ -28,7 +27,7 @@ public class DecompilerHelper { ...@@ -28,7 +27,7 @@ public class DecompilerHelper {
public static DecompiledClass getDecompiledClass(final byte[] bytes, public static DecompiledClass getDecompiledClass(final byte[] bytes,
DecompilerOptions options) throws UnsupportedClassVersionError { DecompilerOptions options) throws UnsupportedClassVersionError {
ClassReader cr = new ClassReader(bytes); ClassReader cr = new ClassReader(bytes);
ClassNode cn = new ClassNode(Opcodes.ASM6); ClassNode cn = new ClassNode(DecompilerOptions.LATEST_ASM_VERSION);
int crFlags = 0; int crFlags = 0;
if(options.modes.get(BCOConstants.F_EXPAND_STACKMAP)) { if(options.modes.get(BCOConstants.F_EXPAND_STACKMAP)) {
crFlags |= ClassReader.EXPAND_FRAMES; crFlags |= ClassReader.EXPAND_FRAMES;
......
...@@ -13,7 +13,7 @@ import org.objectweb.asm.Opcodes; ...@@ -13,7 +13,7 @@ import org.objectweb.asm.Opcodes;
public class DecompilerOptions { public class DecompilerOptions {
public static int LATEST_VERSION = Opcodes.ASM7_EXPERIMENTAL; public static int LATEST_ASM_VERSION = Opcodes.ASM7_EXPERIMENTAL;
public final String fieldFilter; public final String fieldFilter;
public final String methodFilter; public final String methodFilter;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment