public ClassVisitor createClassVisitor() { return new AllMethodVisitor( new AllAttributeVisitor( new EscapingClassMarker())); } };
public ClassVisitor createClassVisitor() { return new AllMethodVisitor( new AllAttributeVisitor( new EscapingClassMarker())); } };
public ClassVisitor createClassVisitor() { return new AllMethodVisitor( new AllAttributeVisitor( new EscapingClassMarker())); } };
/** * Clears any JSE preverification information from the program classes. */ private void clearPreverification() { programClassPool.classesAccept( new ClassVersionFilter(ClassConstants.CLASS_VERSION_1_6, new AllMethodVisitor( new AllAttributeVisitor( new NamedAttributeDeleter(ClassConstants.ATTR_StackMapTable))))); }
/** * Clears any JSE preverification information from the program classes. */ private void clearPreverification() { programClassPool.classesAccept( new ClassVersionFilter(ClassConstants.CLASS_VERSION_1_6, new AllMethodVisitor( new AllAttributeVisitor( new NamedAttributeDeleter(ClassConstants.ATTR_StackMapTable))))); }
/** * Clears any JSE preverification information from the program classes. */ private void clearPreverification() { programClassPool.classesAccept( new ClassVersionFilter(ClassConstants.CLASS_VERSION_1_6, new AllMethodVisitor( new AllAttributeVisitor( new NamedAttributeDeleter(ClassConstants.ATTR_StackMapTable))))); }
/** * Trims the line number table attributes of all program classes. */ private void trimLineNumbers() { programClassPool.classesAccept(new AllAttributeVisitor(true, new LineNumberTableAttributeTrimmer())); }
/** * Trims the line number table attributes of all program classes. */ private void trimLineNumbers() { programClassPool.classesAccept(new AllAttributeVisitor(true, new LineNumberTableAttributeTrimmer())); }
/** * Trims the line number table attributes of all program classes. */ private void trimLineNumbers() { programClassPool.classesAccept(new AllAttributeVisitor(true, new LineNumberTableAttributeTrimmer())); }
public void visitProgramClass(ProgramClass programClass) { hasDefaultMethods = false; implClasses.clear(); // Collect all implementations of the interface. programClass.hierarchyAccept(false, false, false, true, new ProgramClassFilter( new ClassCollector(implClasses))); programClass.accept( new AllMethodVisitor( new MemberAccessFilter(0, ClassConstants.ACC_STATIC, new AllAttributeVisitor(this)))); if (hasDefaultMethods) { // Shrink the constant pool of unused constants. programClass.accept(new ConstantPoolShrinker()); } }
public void visitProgramClass(ProgramClass programClass) { hasDefaultMethods = false; implClasses.clear(); // Collect all implementations of the interface. programClass.hierarchyAccept(false, false, false, true, new ProgramClassFilter( new ClassCollector(implClasses))); programClass.accept( new AllMethodVisitor( new MemberAccessFilter(0, ClassConstants.ACC_STATIC, new AllAttributeVisitor(this)))); if (hasDefaultMethods) { // Shrink the constant pool of unused constants. programClass.accept(new ConstantPoolShrinker()); } }
public void visitProgramClass(ProgramClass programClass) { hasDefaultMethods = false; implClasses.clear(); // Collect all implementations of the interface. programClass.hierarchyAccept(false, false, false, true, new ProgramClassFilter( new ClassCollector(implClasses))); programClass.accept( new AllMethodVisitor( new MemberAccessFilter(0, ClassConstants.ACC_STATIC, new AllAttributeVisitor(this)))); if (hasDefaultMethods) { // Shrink the constant pool of unused constants. programClass.accept(new ConstantPoolShrinker()); } }
public void visitProgramClass(ProgramClass programClass) { constantPoolEditor = new ConstantPoolEditor(programClass); // Visit all methods that have "NEWARRAY" instructions. programClass.methodsAccept( new AllAttributeVisitor( new ArrayInitializationFilter( this))); }
public void visitProgramClass(ProgramClass programClass) { constantPoolEditor = new ConstantPoolEditor(programClass); // Visit all methods that have "NEWARRAY" instructions. programClass.methodsAccept( new AllAttributeVisitor( new ArrayInitializationFilter( this))); }
public void visitProgramClass(ProgramClass programClass) { constantPoolEditor = new ConstantPoolEditor(programClass); // Visit all methods that have "NEWARRAY" instructions. programClass.methodsAccept( new AllAttributeVisitor( new ArrayInitializationFilter( this))); }
/** * Performs preverification of the given program class pool. */ public void execute(ClassPool programClassPool) { // Clean up any old visitor info. programClassPool.classesAccept(new ClassCleaner()); // Preverify all methods. // Classes for JME must be preverified. // Classes for JSE 6 may optionally be preverified. // Classes for JSE 7 or higher must be preverified. programClassPool.classesAccept( new ClassVersionFilter(configuration.microEdition ? ClassConstants.CLASS_VERSION_1_0 : ClassConstants.CLASS_VERSION_1_6, new AllMethodVisitor( new AllAttributeVisitor( new CodePreverifier(configuration.microEdition))))); } }
/** * Performs preverification of the given program class pool. */ public void execute(ClassPool programClassPool) { // Clean up any old visitor info. programClassPool.classesAccept(new ClassCleaner()); // Preverify all methods. // Classes for JME must be preverified. // Classes for JSE 6 may optionally be preverified. // Classes for JSE 7 or higher must be preverified. programClassPool.classesAccept( new ClassVersionFilter(configuration.microEdition ? ClassConstants.CLASS_VERSION_1_0 : ClassConstants.CLASS_VERSION_1_6, new AllMethodVisitor( new AllAttributeVisitor( new CodePreverifier(configuration.microEdition))))); } }
/** * Performs preverification of the given program class pool. */ public void execute(ClassPool programClassPool) { // Clean up any old visitor info. programClassPool.classesAccept(new ClassCleaner()); // Preverify all methods. // Classes for JME must be preverified. // Classes for JSE 6 may optionally be preverified. // Classes for JSE 7 or higher must be preverified. programClassPool.classesAccept( new ClassVersionFilter(configuration.microEdition ? ClassConstants.CLASS_VERSION_1_0 : ClassConstants.CLASS_VERSION_1_6, new AllMethodVisitor( new AllAttributeVisitor( new CodePreverifier(configuration.microEdition))))); } }
public void resetValue(Clazz clazz, Field field) { int accessFlags = field.getAccessFlags(); value = null; // See if we can initialize the static field with a constant value. if ((accessFlags & ClassConstants.ACC_STATIC) != 0) { field.accept(clazz, new AllAttributeVisitor(this)); } // Otherwise initialize a non-final field with the default value. // Conservatively, even a final field needs to be initialized with the // default value, because it may be accessed before it is set. if (value == null && (SideEffectInstructionChecker.OPTIMIZE_CONSERVATIVELY || (accessFlags & ClassConstants.ACC_FINAL) == 0)) { // Otherwise initialize the non-final field with the default value. value = INITIAL_VALUE_FACTORY.createValue(field.getDescriptor(clazz)); } }
public void resetValue(Clazz clazz, Field field) { int accessFlags = field.getAccessFlags(); value = null; // See if we can initialize the static field with a constant value. if ((accessFlags & ClassConstants.ACC_STATIC) != 0) { field.accept(clazz, new AllAttributeVisitor(this)); } // Otherwise initialize a non-final field with the default value. // Conservatively, even a final field needs to be initialized with the // default value, because it may be accessed before it is set. if (value == null && (SideEffectInstructionChecker.OPTIMIZE_CONSERVATIVELY || (accessFlags & ClassConstants.ACC_FINAL) == 0)) { // Otherwise initialize the non-final field with the default value. value = INITIAL_VALUE_FACTORY.createValue(field.getDescriptor(clazz)); } }