org.jikesrvm.compilers.opt.ir
Class IREnumeration.AllInstructionsEnum

java.lang.Object
  extended by org.jikesrvm.compilers.opt.ir.IREnumeration.AllInstructionsEnum
All Implemented Interfaces:
Enumeration<Instruction>, InstructionEnumeration
Enclosing class:
IREnumeration

public static final class IREnumeration.AllInstructionsEnum
extends Object
implements InstructionEnumeration

This class implements an InstructionEnumeration over all instructions for a basic block. This enumeration includes explicit instructions in the IR and implicit phi instructions for heap variables, which are stored only in this lookaside structure.

See Also:
SSADictionary

Field Summary
private  InstructionEnumeration explicitInstructions
          An enumeration of the explicit instructions in the IR for a basic block
private  Iterator<Instruction> implicitInstructions
          An enumeration of the implicit instructions in the IR for a basic block.
private  Instruction labelInstruction
          The label instruction for the basic block - the label is special as we want it to appear in the enumeration before the implicit SSA instructions
 
Constructor Summary
IREnumeration.AllInstructionsEnum(IR ir, BasicBlock block)
          Construct an enumeration for all instructions, both implicit and explicit in the IR, for a given basic block
 
Method Summary
 boolean hasMoreElements()
          Are there more elements in the enumeration?
 Instruction next()
          Get the next instruction in the enumeration
 Instruction nextElement()
          Get the next instruction in the enumeration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

explicitInstructions

private final InstructionEnumeration explicitInstructions
An enumeration of the explicit instructions in the IR for a basic block


implicitInstructions

private final Iterator<Instruction> implicitInstructions
An enumeration of the implicit instructions in the IR for a basic block. These instructions appear only in the SSA dictionary lookaside structure.


labelInstruction

private Instruction labelInstruction
The label instruction for the basic block - the label is special as we want it to appear in the enumeration before the implicit SSA instructions

Constructor Detail

IREnumeration.AllInstructionsEnum

public IREnumeration.AllInstructionsEnum(IR ir,
                                         BasicBlock block)
Construct an enumeration for all instructions, both implicit and explicit in the IR, for a given basic block

Parameters:
block - the basic block whose instructions this enumerates
Method Detail

hasMoreElements

public boolean hasMoreElements()
Are there more elements in the enumeration?

Specified by:
hasMoreElements in interface Enumeration<Instruction>
Returns:
true or false

next

public Instruction next()
Get the next instruction in the enumeration

Specified by:
next in interface InstructionEnumeration
Returns:
the next instruction

nextElement

public Instruction nextElement()
Get the next instruction in the enumeration

Specified by:
nextElement in interface Enumeration<Instruction>
Returns:
the next instruction