org.jikesrvm.compilers.opt
Class LocalCSE.AvExCache

java.lang.Object
  extended by org.jikesrvm.compilers.opt.LocalCSE.AvExCache
Enclosing class:
LocalCSE

protected static final class LocalCSE.AvExCache
extends Object

Implements a cache of Available Expressions


Field Summary
private  ArrayList<LocalCSE.AvailableExpression> cache
          Implementation of the cache
private  boolean doMemory
           
private  OptOptions options
           
 
Constructor Summary
LocalCSE.AvExCache(OptOptions opts, boolean doMem)
           
 
Method Summary
 void eliminate(Instruction s)
          Eliminate all AE tuples that are killed by a given instruction
private  void eliminate(RegisterOperand op)
          Eliminate all AE tuples that contain a given operand
 LocalCSE.AvailableExpression find(Instruction inst)
          Find and return a matching available expression.
 void insert(Instruction inst)
          Insert a new available expression in the cache
 void invalidateAllLoads()
          Eliminate all AE tuples that cache ANY memory location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

private final ArrayList<LocalCSE.AvailableExpression> cache
Implementation of the cache


options

private final OptOptions options

doMemory

private final boolean doMemory
Constructor Detail

LocalCSE.AvExCache

LocalCSE.AvExCache(OptOptions opts,
                   boolean doMem)
Method Detail

find

public LocalCSE.AvailableExpression find(Instruction inst)
Find and return a matching available expression.

Parameters:
inst - the instruction to match
Returns:
the matching AE if found, null otherwise

insert

public void insert(Instruction inst)
Insert a new available expression in the cache

Parameters:
inst - the instruction that defines the AE

eliminate

private void eliminate(RegisterOperand op)
Eliminate all AE tuples that contain a given operand

Parameters:
op - the operand in question

eliminate

public void eliminate(Instruction s)
Eliminate all AE tuples that are killed by a given instruction

Parameters:
s - the store instruction

invalidateAllLoads

public void invalidateAllLoads()
Eliminate all AE tuples that cache ANY memory location.