/** * Performs subroutine inlining of the given program class pool. */ public void execute(ClassPool programClassPool) { // Clean up any old visitor info. programClassPool.classesAccept(new ClassCleaner()); // Inline all subroutines. ClassVisitor inliner = new AllMethodVisitor( new AllAttributeVisitor( new CodeSubroutineInliner())); // In Java Standard Edition, only class files from Java 6 or higher // should be preverified. if (!configuration.microEdition && !configuration.android) { inliner = new ClassVersionFilter(ClassConstants.CLASS_VERSION_1_6, inliner); } programClassPool.classesAccept(inliner); } }
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // DEBUG = // clazz.getName().equals("abc/Def") && // method.getName(clazz).equals("abc"); // CodeAttributeComposer.DEBUG = DEBUG; // TODO: Remove this when the subroutine inliner has stabilized. // Catch any unexpected exceptions from the actual visiting method. try { // Process the code. visitCodeAttribute0(clazz, method, codeAttribute); } catch (RuntimeException ex) { System.err.println("Unexpected error while inlining subroutines:"); System.err.println(" Class = ["+clazz.getName()+"]"); System.err.println(" Method = ["+method.getName(clazz)+method.getDescriptor(clazz)+"]"); System.err.println(" Exception = ["+ex.getClass().getName()+"] ("+ex.getMessage()+")"); if (DEBUG) { method.accept(clazz, new ClassPrinter()); } throw ex; } }
inlineSubroutine(clazz, method, codeAttribute,
if (!containsSubroutines(codeAttribute))
inlineSubroutine(clazz, method, codeAttribute,
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // DEBUG = // clazz.getName().equals("abc/Def") && // method.getName(clazz).equals("abc"); // TODO: Remove this when the subroutine inliner has stabilized. // Catch any unexpected exceptions from the actual visiting method. try { // Process the code. visitCodeAttribute0(clazz, method, codeAttribute); } catch (RuntimeException ex) { System.err.println("Unexpected error while inlining subroutines:"); System.err.println(" Class = ["+clazz.getName()+"]"); System.err.println(" Method = ["+method.getName(clazz)+method.getDescriptor(clazz)+"]"); System.err.println(" Exception = ["+ex.getClass().getName()+"] ("+ex.getMessage()+")"); if (DEBUG) { method.accept(clazz, new ClassPrinter()); } throw ex; } }
/** * Performs subroutine inlining of the given program class pool. */ public void execute(ClassPool programClassPool) { // Clean up any old visitor info. programClassPool.classesAccept(new ClassCleaner()); // Inline all subroutines. ClassVisitor inliner = new AllMethodVisitor( new AllAttributeVisitor( new CodeSubroutineInliner())); // In Java Standard Edition, only class files from Java 6 or higher // should be preverified. if (!configuration.microEdition && !configuration.android) { inliner = new ClassVersionFilter(ClassConstants.CLASS_VERSION_1_6, inliner); } programClassPool.classesAccept(inliner); } }
inlineSubroutine(clazz, method, codeAttribute,
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // DEBUG = // clazz.getName().equals("abc/Def") && // method.getName(clazz).equals("abc"); // CodeAttributeComposer.DEBUG = DEBUG; // TODO: Remove this when the subroutine inliner has stabilized. // Catch any unexpected exceptions from the actual visiting method. try { // Process the code. visitCodeAttribute0(clazz, method, codeAttribute); } catch (RuntimeException ex) { System.err.println("Unexpected error while inlining subroutines:"); System.err.println(" Class = ["+clazz.getName()+"]"); System.err.println(" Method = ["+method.getName(clazz)+method.getDescriptor(clazz)+"]"); System.err.println(" Exception = ["+ex.getClass().getName()+"] ("+ex.getMessage()+")"); if (DEBUG) { method.accept(clazz, new ClassPrinter()); } throw ex; } }
/** * Performs subroutine inlining of the given program class pool. */ public void execute(ClassPool programClassPool) { // Clean up any old visitor info. programClassPool.classesAccept(new ClassCleaner()); // Inline all subroutines. ClassVisitor inliner = new AllMethodVisitor( new AllAttributeVisitor( new CodeSubroutineInliner())); // In Java Standard Edition, only class files from Java 6 or higher // should be preverified. if (!configuration.microEdition) { inliner = new ClassVersionFilter(ClassConstants.INTERNAL_CLASS_VERSION_1_6, Integer.MAX_VALUE, inliner); } programClassPool.classesAccept(inliner); } }
inlineSubroutine(clazz, method, codeAttribute,
public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute) { // DEBUG = // clazz.getName().equals("abc/Def") && // method.getName(clazz).equals("abc"); // CodeAttributeComposer.DEBUG = DEBUG; // TODO: Remove this when the subroutine inliner has stabilized. // Catch any unexpected exceptions from the actual visiting method. try { // Process the code. visitCodeAttribute0(clazz, method, codeAttribute); } catch (RuntimeException ex) { System.err.println("Unexpected error while inlining subroutines:"); System.err.println(" Class = ["+clazz.getName()+"]"); System.err.println(" Method = ["+method.getName(clazz)+method.getDescriptor(clazz)+"]"); System.err.println(" Exception = ["+ex.getClass().getName()+"] ("+ex.getMessage()+")"); if (DEBUG) { method.accept(clazz, new ClassPrinter()); } throw ex; } }
/** * Performs subroutine inlining of the given program class pool. */ public void execute(ClassPool programClassPool) { // Clean up any old visitor info. programClassPool.classesAccept(new ClassCleaner()); // Inline all subroutines. ClassVisitor inliner = new AllMethodVisitor( new AllAttributeVisitor( new CodeSubroutineInliner())); // In Java Standard Edition, only class files from Java 6 or higher // should be preverified. if (!configuration.microEdition && !configuration.android) { inliner = new ClassVersionFilter(ClassConstants.CLASS_VERSION_1_6, inliner); } programClassPool.classesAccept(inliner); } }