scale.backend
Class Marker

java.lang.Object
  extended by scale.backend.Instruction
      extended by scale.backend.Marker
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
AnnulMarker, BeginMarker, BeginMarker, BeginMarker, BeginMarker, BeginMarker, CommentMarker, EndMarker, EndMarker, EndMarker, EndMarker, Label, LineMarker, PrologMarker, PrologMarker, PrologMarker, PrologMarker

public abstract class Marker
extends Instruction

Instances of this class are used to mark places in the instruction stream.

$Id: Marker.java,v 1.24 2006-02-02 22:37:06 burrill Exp $

Copyright 2005 by the Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.

No machine instructions are generated from a Marker instruction. However, assembly language directives may be generated by a Marker.


Constructor Summary
protected Marker()
           
 
Method Summary
 void assembler(Assembler asm, Emit emit)
          Insert the assembler representation of the instruction into the output stream.
 int getExecutionCycles()
          Return the number of cycles that this instruction requires.
 int getOpcode()
          Return the numeric opcode of the instruction.
 boolean independent(Instruction inst, RegisterSet registers)
          Return true if this instruction is independent of the specified instruction.
 int instructionSize()
          Return the number of bytes required for the instruction.
 boolean isMarker()
          Return true if this is a Marker.
 void nullify(RegisterSet rs)
          Mark the instruction as no longer needed.
 void remapDestRegister(int oldReg, int newReg)
          Map the registers defined in the instruction as destinations to the specified register.
 void remapRegisters(int[] map)
          Map the virtual registers referenced in the instruction to the specified real registers.
 void remapSrcRegister(int oldReg, int newReg)
          Map the registers used in the instruction as sources to the specified register.
 void specifyRegisterUsage(RegisterAllocator rs, int index, int strength)
          Specify the registers used by this instruction.
 java.lang.String toString()
           
 
Methods inherited from class scale.backend.Instruction
canBeDeleted, clone, copy, defs, ehash, getBBID, getCopyDest, getCopySrc, getDestRegister, getFunctionalUnit, getLoopNumber, getNext, getPredicate, getPredicates, getSrcRegisters, getTag, isBranch, isCopy, isLabel, isLoad, isMandatory, isPhi, isPredicated, isPredicatedOnTrue, isPrefetch, isSpillInstruction, isSpillLoadPoint, isSpillStorePoint, isStore, markSpillInstruction, mods, nullified, numPredicates, removePredicates, setBBID, setLoopNumber, setMandatory, setNext, setPredicate, setPredicate, setPredicatedOnTrue, setPredicates, setsSpecialReg, setTag, specifyNotSpillLoadPoint, specifySpillStorePoint, uses
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Marker

protected Marker()
Method Detail

remapRegisters

public void remapRegisters(int[] map)
Description copied from class: Instruction
Map the virtual registers referenced in the instruction to the specified real registers. The mapping is specified using an array that is indexed by the virtual register to return the real register.

Specified by:
remapRegisters in class Instruction
Parameters:
map - maps from the virtual register to real register

remapSrcRegister

public void remapSrcRegister(int oldReg,
                             int newReg)
Map the registers used in the instruction as sources to the specified register. If the register is not used as a source register, no change is made.

Specified by:
remapSrcRegister in class Instruction
Parameters:
oldReg - is the previous source register
newReg - is the new source register

remapDestRegister

public void remapDestRegister(int oldReg,
                              int newReg)
Map the registers defined in the instruction as destinations to the specified register. If the register is not used as a destination register, no change is made.

Specified by:
remapDestRegister in class Instruction
Parameters:
oldReg - is the previous destination register
newReg - is the new destination register

getOpcode

public final int getOpcode()
Return the numeric opcode of the instruction. This opcode may be an encoding of the actual instruction opcode.

Specified by:
getOpcode in class Instruction

isMarker

public final boolean isMarker()
Return true if this is a Marker.

Overrides:
isMarker in class Instruction
See Also:
Marker

getExecutionCycles

public int getExecutionCycles()
Return the number of cycles that this instruction requires.

Overrides:
getExecutionCycles in class Instruction

assembler

public void assembler(Assembler asm,
                      Emit emit)
Insert the assembler representation of the instruction into the output stream.

Specified by:
assembler in class Instruction

instructionSize

public int instructionSize()
Description copied from class: Instruction
Return the number of bytes required for the instruction.

Specified by:
instructionSize in class Instruction

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

specifyRegisterUsage

public void specifyRegisterUsage(RegisterAllocator rs,
                                 int index,
                                 int strength)
Specify the registers used by this instruction.

Specified by:
specifyRegisterUsage in class Instruction
Parameters:
rs - is the register set in use
index - is an index associated with the instruction
strength - is the importance of the instruction
See Also:
RegisterAllocator.useRegister(int,int,int), RegisterAllocator.defRegister(int,int)

nullify

public void nullify(RegisterSet rs)
Mark the instruction as no longer needed.

Overrides:
nullify in class Instruction

independent

public boolean independent(Instruction inst,
                           RegisterSet registers)
Return true if this instruction is independent of the specified instruction. If instructions are independent, than one instruction can be moved before or after the other instruction without changing the semantics of the program.

Specified by:
independent in class Instruction
Parameters:
inst - is the specified instruction