harpoon.Backend.Runtime1
Class Runtime

java.lang.Object
  extended by harpoon.Backend.Generic.Runtime
      extended by harpoon.Backend.Runtime1.Runtime
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
RealtimeRuntime, Runtime, Runtime

public class Runtime
extends Runtime
implements Serializable

Runtime1.Runtime is a no-frills implementation of the runtime abstract class.

Version:
$Id: Runtime.java,v 1.11 2003/10/21 00:41:08 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Nested Class Summary
protected static class Runtime.ExtraClazInfo
          provides a means for a subclass to add extra fields to DataClaz.
 
Nested classes/interfaces inherited from class harpoon.Backend.Generic.Runtime
Runtime.ObjectBuilder, Runtime.TreeBuilder
 
Field Summary
protected  AllocationStrategy as
           
protected  CallGraph cg
           
protected  ClassHierarchy ch
           
protected  Frame frame
           
protected  HMethod main
           
protected  Runtime.ObjectBuilder ob
           
protected  List staticInitializers
           
 
Fields inherited from class harpoon.Backend.Generic.Runtime
configurationSet
 
Constructor Summary
Runtime(Frame frame, AllocationStrategy as, HMethod main, boolean prependUnderscore)
          Creates a new Runtime1.Runtime.
Runtime(Frame frame, AllocationStrategy as, HMethod main, boolean prependUnderscore, ObjectBuilder.RootOracle rootOracle)
          Creates a new Runtime1.Runtime.
 
Method Summary
 List<HData> classData(HClass hc)
          Returns a list of HDatas which are needed for the given class.
protected  Runtime.ExtraClazInfo getExtraClazInfo()
          A means for a subclass to set this.
 NameMap getNameMap()
          Returns a NameMap valid for this Generic.Runtime.
 TreeBuilder getTreeBuilder()
          Returns a TreeBuilder object for this Generic.Runtime.
protected  Runtime.ObjectBuilder initObjectBuilder(ObjectBuilder.RootOracle ro)
           
protected  TreeBuilder initTreeBuilder()
           
 HCodeFactory nativeTreeCodeFactory(HCodeFactory hcf)
          This code factory hook allows the runtime to return runtime-specific stubs for native methods --- or any other method which the runtime wishes to reimplement.
 String resourcePath(String basename)
          Prefixes a runtime-specific path onto the specific resource name, so that transformations can refer to runtime-specific properties files in a uniform manner.
 Collection runtimeCallableMethods()
          Return a Set of HMethods and HClasses which are referenced / callable by code in the runtime implementation (and should therefore be included in every class hierarchy).
 void setCallGraph(CallGraph cg)
          Sets the CallGraph to use for this Generic.Runtime.
 void setClassHierarchy(ClassHierarchy ch)
          Sets the ClassHierarchy to use for this Generic.Runtime.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frame

protected final Frame frame

main

protected final HMethod main

ch

protected ClassHierarchy ch

cg

protected CallGraph cg

as

protected final AllocationStrategy as

ob

protected final Runtime.ObjectBuilder ob

staticInitializers

protected List staticInitializers
Constructor Detail

Runtime

public Runtime(Frame frame,
               AllocationStrategy as,
               HMethod main,
               boolean prependUnderscore)
Creates a new Runtime1.Runtime.


Runtime

public Runtime(Frame frame,
               AllocationStrategy as,
               HMethod main,
               boolean prependUnderscore,
               ObjectBuilder.RootOracle rootOracle)
Creates a new Runtime1.Runtime.

Method Detail

initObjectBuilder

protected Runtime.ObjectBuilder initObjectBuilder(ObjectBuilder.RootOracle ro)

getTreeBuilder

public TreeBuilder getTreeBuilder()
Description copied from class: Runtime
Returns a TreeBuilder object for this Generic.Runtime.

Specified by:
getTreeBuilder in class Runtime

getNameMap

public NameMap getNameMap()
Description copied from class: Runtime
Returns a NameMap valid for this Generic.Runtime.

Specified by:
getNameMap in class Runtime

resourcePath

public String resourcePath(String basename)
Description copied from class: Runtime
Prefixes a runtime-specific path onto the specific resource name, so that transformations can refer to runtime-specific properties files in a uniform manner.

Specified by:
resourcePath in class Runtime

setCallGraph

public void setCallGraph(CallGraph cg)
Description copied from class: Runtime
Sets the CallGraph to use for this Generic.Runtime. Some runtime options do not require a call graph, and thus do not require that this method ever be called. However, for those that do, this method must be called at least once before the TreeBuilder or classData are used to generate tree form. It may be called multiple times if transformations cause the call graph to change.

Overrides:
setCallGraph in class Runtime

setClassHierarchy

public void setClassHierarchy(ClassHierarchy ch)
Description copied from class: Runtime
Sets the ClassHierarchy to use for this Generic.Runtime. This method must be called at least once before the TreeBuilder or classData are used to generate tree form. It may be called multiple times if transformations cause the class hierarchy to change.

Overrides:
setClassHierarchy in class Runtime

initTreeBuilder

protected TreeBuilder initTreeBuilder()

nativeTreeCodeFactory

public HCodeFactory nativeTreeCodeFactory(HCodeFactory hcf)
Description copied from class: Runtime
This code factory hook allows the runtime to return runtime-specific stubs for native methods --- or any other method which the runtime wishes to reimplement. The default implementation just passes the given code factory through without modification.

The code factory returned by this method should return a null for methods which the output routine should skip. For example, if stubs are not needed for native methods, then the code factory should return null when convert() is called on a native method (just as the standard code factories do).

The code factory given should produce tree form. The returned code factory should also produce tree form; the tree form need not be canonicalized or optimized.

Overrides:
nativeTreeCodeFactory in class Runtime

runtimeCallableMethods

public Collection runtimeCallableMethods()
Description copied from class: Runtime
Return a Set of HMethods and HClasses which are referenced / callable by code in the runtime implementation (and should therefore be included in every class hierarchy).

Specified by:
runtimeCallableMethods in class Runtime

classData

public List<HData> classData(HClass hc)
Description copied from class: Runtime
Returns a list of HDatas which are needed for the given class.

Specified by:
classData in class Runtime

getExtraClazInfo

protected Runtime.ExtraClazInfo getExtraClazInfo()
A means for a subclass to set this.