harpoon.IR.Assem
Class InstrGroup

java.lang.Object
  extended by harpoon.IR.Assem.InstrGroup

public class InstrGroup
extends Object

InstrGroup collects a group of assembly instructions together so that they can be viewed as a single atomic element of the code. This allows for differing levels of abstraction as required by various compiler passes. Each set of instructions collected by an InstrGroup must collectively form a single-entry single-exit region.

Version:
$Id: InstrGroup.java,v 1.6 2004/02/08 01:55:08 cananian Exp $
Author:
Felix S. Klock II <pnkfelix@mit.edu>

Nested Class Summary
static class InstrGroup.Type
          InstrGroup.Type is associated with a collection of InstrGroups for a given Assem.Code.
 
Field Summary
static InstrGroup.Type AGGREGATE
          groups code such as double word moves where we do not want to allow one half of the location to be assigned to hold the 2nd half.
static InstrGroup.Type DELAY_SLOT
          groups code with special delay slot instructions...
static InstrGroup.Type NO_REORDER
          groups code such as local labels (1f/1:).
static InstrGroup.Type NO_SPILL
          groups code where we cannot insert spill code (such as aggregates where spill code would destroy effect of virtual DUMMY instructions added in).
 
Constructor Summary
InstrGroup(InstrGroup.Type type)
          Creates a InstrGroup.
InstrGroup(InstrGroup.Type type, InstrGroup container)
          Creates a InstrGroup contained in contained.
 
Method Summary
 InstrGroup getContainer()
          Returns the InstrGroup containing this, or null if this is not contained in any super group.
 boolean hasContainer()
          Returns true if this is contained in a super group, else false.
 void setEntry(Instr entry)
          Sets the entry point for a group of instructions.
 void setExit(Instr exit)
          Sets the exit point for this group of instructions.
 boolean subgroupOf(InstrGroup group)
          Returns true if this is (reflexively) contained in group.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_REORDER

public static InstrGroup.Type NO_REORDER
groups code such as local labels (1f/1:).


AGGREGATE

public static InstrGroup.Type AGGREGATE
groups code such as double word moves where we do not want to allow one half of the location to be assigned to hold the 2nd half.


NO_SPILL

public static InstrGroup.Type NO_SPILL
groups code where we cannot insert spill code (such as aggregates where spill code would destroy effect of virtual DUMMY instructions added in). Note that it is legal to insert spill code BEFORE the group, just not between instructions contained within the group.


DELAY_SLOT

public static InstrGroup.Type DELAY_SLOT
groups code with special delay slot instructions... (usable?)

Constructor Detail

InstrGroup

public InstrGroup(InstrGroup.Type type)
Creates a InstrGroup.


InstrGroup

public InstrGroup(InstrGroup.Type type,
                  InstrGroup container)
Creates a InstrGroup contained in contained.

Method Detail

toString

public String toString()
Overrides:
toString in class Object

hasContainer

public boolean hasContainer()
Returns true if this is contained in a super group, else false.


getContainer

public InstrGroup getContainer()
Returns the InstrGroup containing this, or null if this is not contained in any super group.


subgroupOf

public boolean subgroupOf(InstrGroup group)
Returns true if this is (reflexively) contained in group.


setEntry

public void setEntry(Instr entry)
Sets the entry point for a group of instructions. Should be called once (and only once), before setExit is called.


setExit

public void setExit(Instr exit)
Sets the exit point for this group of instructions. Should be called once (and only once). Note that for a given InstrGroup(fact, a), after setExit(b) has been called, it should be the case for the code associated with fact: .