org.apache.commons.nabla.forward.analysis
Class TrackingValue

java.lang.Object
  extended by org.apache.commons.nabla.forward.analysis.TrackingValue
All Implemented Interfaces:
org.objectweb.asm.tree.analysis.Value

public class TrackingValue
extends Object
implements org.objectweb.asm.tree.analysis.Value

A value that keep track of both instructions producing and consuming it.

Version:
$Id$

Field Summary
static TrackingValue UNINITIALIZED_VALUE
          Special value for uninitialized values.
 
Constructor Summary
TrackingValue(org.objectweb.asm.Type type)
          Build a new value without any link to instructions.
TrackingValue(org.objectweb.asm.Type type, org.objectweb.asm.tree.AbstractInsnNode producer)
          Build a new value produced by a specified instruction.
 
Method Summary
 void addConsumer(org.objectweb.asm.tree.AbstractInsnNode consumer)
          Add a consumer for this value.
 void addProducer(org.objectweb.asm.tree.AbstractInsnNode producer)
          Add a producer for this value.
 Set<org.objectweb.asm.tree.AbstractInsnNode> getConsumers()
          Get the consumers for this value and all values it is merged with.
 Set<org.objectweb.asm.tree.AbstractInsnNode> getProducers()
          Get the producers for this value and all values it is merged with.
 int getSize()
          
 org.objectweb.asm.Type getType()
          Get the value type.
static void merge(TrackingValue value1, TrackingValue value2)
          Merge two instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNINITIALIZED_VALUE

public static final TrackingValue UNINITIALIZED_VALUE
Special value for uninitialized values.

Constructor Detail

TrackingValue

public TrackingValue(org.objectweb.asm.Type type)
Build a new value without any link to instructions.

Parameters:
type - value type

TrackingValue

public TrackingValue(org.objectweb.asm.Type type,
                     org.objectweb.asm.tree.AbstractInsnNode producer)
Build a new value produced by a specified instruction.

Parameters:
type - value type
producer - producer for this value
Method Detail

getType

public org.objectweb.asm.Type getType()
Get the value type.

Returns:
value type

getSize

public int getSize()

Specified by:
getSize in interface org.objectweb.asm.tree.analysis.Value

addConsumer

public void addConsumer(org.objectweb.asm.tree.AbstractInsnNode consumer)
Add a consumer for this value.

Parameters:
consumer - consumer for this value

getConsumers

public Set<org.objectweb.asm.tree.AbstractInsnNode> getConsumers()
Get the consumers for this value and all values it is merged with.

Returns:
the instructions consuming either this value or the values it has been merged with

addProducer

public void addProducer(org.objectweb.asm.tree.AbstractInsnNode producer)
Add a producer for this value.

Parameters:
producer - producer for this value

getProducers

public Set<org.objectweb.asm.tree.AbstractInsnNode> getProducers()
Get the producers for this value and all values it is merged with.

Returns:
the instructions producing either this value or the values it has been merged with

merge

public static void merge(TrackingValue value1,
                         TrackingValue value2)
Merge two instances.

Once merged, values share the same producers and consumers sets.

Parameters:
value1 - first value to merge
value2 - second value to merge


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