org.jikesrvm.compilers.opt.instrsched
Class ResourceMap

java.lang.Object
  extended by org.jikesrvm.compilers.opt.instrsched.ResourceMap

final class ResourceMap
extends Object

Resource usage map representation Used by the scheduler to accommodate resource patterns

See Also:
OperatorClass, Operator

Field Summary
private  int[] rumap
          GROWABLE Resource Usage map.
private  int size
          Current size of the RU map.
private static int VERBOSE
           
 
Constructor Summary
ResourceMap()
          Creates new resource map.
ResourceMap(int length)
          Creates new resource map with desired initial length.
 
Method Summary
private static void debug(String s)
           
private  void grow(int s)
          Grows the RU map to a given size.
 boolean schedule(Instruction i, int time)
          Reserves resources for given instruction at given time.
private  boolean schedule(int[] usage, int time)
          Binds resources for given resource usage pattern at given time.
private static String toBinaryPad32(int value)
           
 String toString()
          Returns a string representation of the resource map.
 void unschedule(Instruction i)
          Frees resources for given instruction.
private  void unschedule(int[] usage, int time)
          Unbinds resources for given resource usage pattern at given time.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERBOSE

private static final int VERBOSE
See Also:
Constant Field Values

rumap

private int[] rumap
GROWABLE Resource Usage map.


size

private int size
Current size of the RU map.

Constructor Detail

ResourceMap

public ResourceMap()
Creates new resource map.


ResourceMap

public ResourceMap(int length)
Creates new resource map with desired initial length.

Parameters:
length - desired initial length of the resource map
Method Detail

debug

private static void debug(String s)

toBinaryPad32

private static String toBinaryPad32(int value)

grow

private void grow(int s)
Grows the RU map to a given size. For internal use only.


schedule

public boolean schedule(Instruction i,
                        int time)
Reserves resources for given instruction at given time.

Parameters:
i - instruction
time - time to schedule
Returns:
true if succeeded, false if there was a conflict
See Also:
unschedule(Instruction)

unschedule

public void unschedule(Instruction i)
Frees resources for given instruction.

Parameters:
i - instruction
See Also:
schedule(Instruction,int)

toString

public String toString()
Returns a string representation of the resource map.

Overrides:
toString in class Object
Returns:
a string representation of the resource map

schedule

private boolean schedule(int[] usage,
                         int time)
Binds resources for given resource usage pattern at given time.

Parameters:
usage -
time -
Returns:
false if there's a resource conflict, true otherwise

unschedule

private void unschedule(int[] usage,
                        int time)
Unbinds resources for given resource usage pattern at given time.

Parameters:
usage -
time -