harpoon.Backend.MIPS
Class CodeGen

java.lang.Object
  extended by harpoon.Backend.Generic.CodeGen
      extended by harpoon.Backend.Generic.MaxMunchCG
          extended by harpoon.Backend.MIPS.CodeGen

public class CodeGen
extends MaxMunchCG

MIPS.CodeGen is a code-generator for the MIPS II architecture.

Version:
$Id: CodeGen.spec,v 1.6 2004/02/08 01:57:34 cananian Exp $
Author:
Emmett Witchel <witchel@mit.edu>
See Also:
"Kane, MIPS Risc Architecture"

Field Summary
 
Fields inherited from class harpoon.Backend.Generic.MaxMunchCG
first, last
 
Fields inherited from class harpoon.Backend.Generic.CodeGen
frame
 
Constructor Summary
CodeGen(Frame frame, boolean is_elf)
           
 
Method Summary
 List cgg_genCode(Code code, InstrFactory inf)
          Generates assembly code from a harpoon.IR.Tree.Code.
 Instr cgg_genData(Data code, InstrFactory inf)
          Generates assembly code from a harpoon.IR.Tree.Data.
 StackInfo getStackInfo()
           
 Instr procFixup(HMethod hm, Instr instr, int stackspace, Set usedRegisters)
          Fixes up the procedure entry and exit code for a list of instrs, once it is known how many registers and how much stack space is used.
 
Methods inherited from class harpoon.Backend.Generic.MaxMunchCG
_methodPrologue_, cgg_backendEmit, clearDecl, declare, declare, getDerivation, makeTemp
 
Methods inherited from class harpoon.Backend.Generic.CodeGen
debug, declare, emit, endGroup, genCode, genData, prettyPrint, procFixup, startGroup
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeGen

public CodeGen(Frame frame,
               boolean is_elf)
Method Detail

procFixup

public Instr procFixup(HMethod hm,
                       Instr instr,
                       int stackspace,
                       Set usedRegisters)
Description copied from class: CodeGen
Fixes up the procedure entry and exit code for a list of instrs, once it is known how many registers and how much stack space is used.

Specified by:
procFixup in class CodeGen

getStackInfo

public StackInfo getStackInfo()

cgg_genCode

public final List cgg_genCode(Code code,
                              InstrFactory inf)
Generates assembly code from a harpoon.IR.Tree.Code.
modifies: this
effects: Scans tree to find a tiling of Instruction Patterns, calling auxillary methods and data structures as defined in the .spec file. Generates an associated Derivation object as the second element of the returned List.

Specified by:
cgg_genCode in class CodeGen
Parameters:
tree - Set of abstract Tree instructions that form the body of the procedure being compiled.
Returns:
The head of a list of Instrs

cgg_genData

public final Instr cgg_genData(Data code,
                               InstrFactory inf)
Generates assembly code from a harpoon.IR.Tree.Data.
modifies: this
effects: Scans tree to define a layout of Instructions, calling auxillary methods and data structures as defined in the .Spec file

Specified by:
cgg_genData in class CodeGen
Parameters:
tree - Set of abstract Tree instructions that form the body of the data structure being compiled.