org.apache.commons.nabla.forward.trimming
Class BytecodeTrimmer

java.lang.Object
  extended by org.apache.commons.nabla.forward.trimming.BytecodeTrimmer
Direct Known Subclasses:
DLoadPop2Trimmer, SwappedDloadTrimmer, SwappedDstoreTrimmer

public abstract class BytecodeTrimmer
extends Object

Base class for code trimmers.

Version:
$Id$

Constructor Summary
protected BytecodeTrimmer(int lookahead)
          Simple constructor.
 
Method Summary
 void trim(org.objectweb.asm.tree.InsnList instructions)
          Trim a list of instructions.
protected abstract  boolean trimWindow(org.objectweb.asm.tree.InsnList instructions, org.objectweb.asm.tree.AbstractInsnNode[] window)
          Trim the current window of lookahead instructions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BytecodeTrimmer

protected BytecodeTrimmer(int lookahead)
Simple constructor.

Parameters:
lookahead - number of lookahead instructions
Method Detail

trim

public void trim(org.objectweb.asm.tree.InsnList instructions)
Trim a list of instructions.

Parameters:
instructions - list of instructions to optimize

trimWindow

protected abstract boolean trimWindow(org.objectweb.asm.tree.InsnList instructions,
                                      org.objectweb.asm.tree.AbstractInsnNode[] window)
Trim the current window of lookahead instructions.

Parameters:
instructions - complete instructions list of instructions to trim
window - current instructions window (belongs to the list)
Returns:
true if instructions and window have been updated and are ready for next iteration


Copyright © 2008-2012 The Apache Software Foundation. All Rights Reserved.