org.apache.commons.nabla.algorithmic.forward.instructions
Class Dup2X2Transformer1

java.lang.Object
  extended by org.apache.commons.nabla.algorithmic.forward.instructions.Dup2X2Transformer1
All Implemented Interfaces:
InstructionsTransformer

public class Dup2X2Transformer1
extends Object
implements InstructionsTransformer

Differentiation transformer for DUP2_X2 instructions.

DUP2_X2 instructions are replaced by instructions that duplicate the two parts of a differential pair on stack.


Method Summary
static InstructionsTransformer getInstance()
          Get the singleton instance.
 org.objectweb.asm.tree.InsnList getReplacement(org.objectweb.asm.tree.AbstractInsnNode insn, MethodDifferentiator methodDifferentiator)
          Get the replacement instructions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static InstructionsTransformer getInstance()
Get the singleton instance.

We use here the Initialization on Demand Holder idiom.

Returns:
the singleton instance

getReplacement

public org.objectweb.asm.tree.InsnList getReplacement(org.objectweb.asm.tree.AbstractInsnNode insn,
                                                      MethodDifferentiator methodDifferentiator)
                                               throws DifferentiationException
Get the replacement instructions.

Specified by:
getReplacement in interface InstructionsTransformer
Parameters:
insn - original instruction
methodDifferentiator - method differentiator driving this transformer
Returns:
replacement instructions
Throws:
DifferentiationException - if the method differentiator cannot provide a temporary variable


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