public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { // Make the method invocation static, if possible. if ((programMethod.getAccessFlags() & ClassConstants.ACC_STATIC) == 0 && !ParameterUsageMarker.isParameterUsed(programMethod, 0)) { replaceByStaticInvocation(programClass, invocationOffset, invocationInstruction); } } }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { // Make the method invocation static, if possible. if ((programMethod.getAccessFlags() & ClassConstants.ACC_STATIC) == 0 && !ParameterUsageMarker.isParameterUsed(programMethod, 0)) { replaceByStaticInvocation(programClass, invocationOffset, invocationInstruction); } } }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { // Make the method invocation static, if possible. if ((programMethod.getAccessFlags() & ClassConstants.ACC_STATIC) == 0 && !ParameterUsageMarker.isParameterUsed(programMethod, 0)) { replaceByStaticInvocation(programClass, invocationOffset, invocationInstruction); } } }
public void visitParameter(Clazz clazz, Member member, int parameterIndex, int parameterCount, int parameterOffset, int parameterSize, String parameterType, Clazz referencedClass) { ParameterVisitor parameterVisitor = ParameterUsageMarker.isParameterUsed((Method)member, parameterOffset) ? usedParameterVisitor : unusedParameterVisitor; if (parameterVisitor != null) { parameterVisitor.visitParameter(clazz, member, parameterIndex, parameterCount, parameterOffset, parameterSize, parameterType, referencedClass); } } }
public void visitParameter(Clazz clazz, Member member, int parameterIndex, int parameterCount, int parameterOffset, int parameterSize, String parameterType, Clazz referencedClass) { ParameterVisitor parameterVisitor = ParameterUsageMarker.isParameterUsed((Method)member, parameterOffset) ? usedParameterVisitor : unusedParameterVisitor; if (parameterVisitor != null) { parameterVisitor.visitParameter(clazz, member, parameterIndex, parameterCount, parameterOffset, parameterSize, parameterType, referencedClass); } } }
public void visitParameter(Clazz clazz, Member member, int parameterIndex, int parameterCount, int parameterOffset, int parameterSize, String parameterType, Clazz referencedClass) { ParameterVisitor parameterVisitor = ParameterUsageMarker.isParameterUsed((Method)member, parameterOffset) ? usedParameterVisitor : unusedParameterVisitor; if (parameterVisitor != null) { parameterVisitor.visitParameter(clazz, member, parameterIndex, parameterCount, parameterOffset, parameterSize, parameterType, referencedClass); } } }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { // Is the 'this' parameter being used? if (!ParameterUsageMarker.isParameterUsed(programMethod, 0)) { // Make the method static. programMethod.u2accessFlags = (programMethod.getAccessFlags() & ~ClassConstants.INTERNAL_ACC_FINAL) | ClassConstants.INTERNAL_ACC_STATIC; // Visit the method, if required. if (extraStaticMemberVisitor != null) { extraStaticMemberVisitor.visitProgramMethod(programClass, programMethod); } } } }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { // Is the 'this' parameter being used? if (!ParameterUsageMarker.isParameterUsed(programMethod, 0)) { // Make the method static. programMethod.u2accessFlags = (programMethod.getAccessFlags() & ~ClassConstants.ACC_FINAL) | ClassConstants.ACC_STATIC; // Visit the method, if required. if (extraStaticMemberVisitor != null) { extraStaticMemberVisitor.visitProgramMethod(programClass, programMethod); } } } }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { // Is the 'this' parameter being used? if (!ParameterUsageMarker.isParameterUsed(programMethod, 0)) { // Make the method static. programMethod.u2accessFlags = (programMethod.getAccessFlags() & ~ClassConstants.ACC_FINAL) | ClassConstants.ACC_STATIC; // Visit the method, if required. if (extraStaticMemberVisitor != null) { extraStaticMemberVisitor.visitProgramMethod(programClass, programMethod); } } } }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { // Is the 'this' parameter being used? if (!ParameterUsageMarker.isParameterUsed(programMethod, 0)) { // Make the method static. programMethod.u2accessFlags = (programMethod.getAccessFlags() & ~ClassConstants.ACC_FINAL) | ClassConstants.ACC_STATIC; // Visit the method, if required. if (extraStaticMemberVisitor != null) { extraStaticMemberVisitor.visitProgramMethod(programClass, programMethod); } } } }
public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { // Get the total size of the parameters. int parameterSize = ParameterUsageMarker.getParameterSize(programMethod); // Make the method invocation static, if possible. if ((programMethod.getAccessFlags() & ClassConstants.INTERNAL_ACC_STATIC) == 0 && !ParameterUsageMarker.isParameterUsed(programMethod, 0)) { replaceByStaticInvocation(programClass, invocationOffset, invocationInstruction); } // Remove unused parameters. for (int index = 0; index < parameterSize; index++) { if (!ParameterUsageMarker.isParameterUsed(programMethod, index)) { TracedStack stack = partialEvaluator.getStackBefore(invocationOffset); int stackIndex = stack.size() - parameterSize + index; if (DEBUG) { System.out.println(" ["+invocationOffset+"] Ignoring parameter #"+index+" of "+programClass.getName()+"."+programMethod.getName(programClass)+programMethod.getDescriptor(programClass)+"] (stack entry #"+stackIndex+" ["+stack.getBottom(stackIndex)+"])"); System.out.println(" Full stack: "+stack); } markStackSimplificationBefore(invocationOffset, stackIndex); } } } }
if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))
if (ParameterUsageMarker.isParameterUsed(method, parameterIndex))