org.apache.commons.nabla.algorithmic.forward.trimming
Class SwappedDloadTrimmer

java.lang.Object
  extended by org.apache.commons.nabla.algorithmic.forward.trimming.BytecodeTrimmer
      extended by org.apache.commons.nabla.algorithmic.forward.trimming.SwappedDloadTrimmer

public class SwappedDloadTrimmer
extends BytecodeTrimmer

Trimmer replacing (DLOAD i, DLOAD j, DUP2_X2, POP2) with (DLOAD j, DLOAD i).


Method Summary
static BytecodeTrimmer getInstance()
          Get the singleton instance.
protected  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 org.apache.commons.nabla.algorithmic.forward.trimming.BytecodeTrimmer
trim
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static BytecodeTrimmer getInstance()
Get the singleton instance.

We use here the Initialization on Demand Holder idiom.

Returns:
the singleton instance

trimWindow

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

Specified by:
trimWindow in class BytecodeTrimmer
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-2009 The Apache Software Foundation. All Rights Reserved.