scale.j2s
Class ScribbleGen

java.lang.Object
  extended by scale.j2s.ScribbleGen

public class ScribbleGen
extends java.lang.Object

This class processes the Code Attribute for a Java class method and produces a Scribble CFG. We assume that the byte code has been verified. We also assume that no loop in the Java byte code exits with a change in the number of entries in the Java stack.

$Id: ScribbleGen.java,v 1.46 2007-10-04 19:58:14 burrill Exp $

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


Field Summary
static boolean classTrace
          True if traces are to be performed.
 
Constructor Summary
ScribbleGen(Java2Scribble j2s, ClassStuff cs, ProcedureDecl pd, CallGraph cg)
           
 
Method Summary
 void defLocal(int index, VariableDecl fd)
          Define a local variable.
 void generate(MethodInfo method)
          Convert the Java byte codes into Scribble as part of a RoutineDecl.
protected  VariableDecl genTemp(Type t)
          Create a new temporary variable for use by the optimized code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classTrace

public static boolean classTrace
True if traces are to be performed.

Constructor Detail

ScribbleGen

public ScribbleGen(Java2Scribble j2s,
                   ClassStuff cs,
                   ProcedureDecl pd,
                   CallGraph cg)
Parameters:
j2s - contains the global information for the class of this method
cs - is the information about the class containing this method
pd - is the ProcedureDecl for this method
cg - is the CallGraph for this method
Method Detail

genTemp

protected VariableDecl genTemp(Type t)
Create a new temporary variable for use by the optimized code. The variable definition is added to the set of variables for this CFG.


defLocal

public void defLocal(int index,
                     VariableDecl fd)
Define a local variable.

Parameters:
index - is the local variable index
fd - is the definition of the local variable

generate

public void generate(MethodInfo method)
Convert the Java byte codes into Scribble as part of a RoutineDecl.

See Also:
RoutineDecl