harpoon.Analysis.Realtime
Class RealtimeAllocationStrategy

java.lang.Object
  extended by harpoon.Backend.Runtime1.AllocationStrategy
      extended by harpoon.Backend.Runtime1.MallocAllocationStrategy
          extended by harpoon.Analysis.Realtime.RealtimeAllocationStrategy
All Implemented Interfaces:
Serializable

public class RealtimeAllocationStrategy
extends MallocAllocationStrategy

RealtimeAllocationStrategy makes all memory allocations to go through RTJ_malloc. If DEBUG_REF is turned on, then it calls RTJ_malloc_ref(size, fileNumber, "fileName"). The const char* "fileName" must be emitted in a separate area, so emitStrings must be called later in the file to emit that data.

Author:
Wes Beebee <wbeebee@mit.edu>
See Also:
Serialized Form

Field Summary
 
Fields inherited from class harpoon.Backend.Runtime1.MallocAllocationStrategy
frame
 
Constructor Summary
RealtimeAllocationStrategy(Frame f)
          Creates a RealtimeAllocationStrategy.
 
Method Summary
static Stm emitStrings(TreeFactory tf, HCodeElement src)
          Emit all of the const char*'s used so far in the file and flush the list.
 Exp memAlloc(TreeFactory tf, HCodeElement src, DerivationGenerator dg, AllocationInformation.AllocationProperties ap, Exp length)
          Produces the Tree code corresponding to a memory allocation.
static Label stringLabel(String s)
          Return a label corresponding to the string s.
 
Methods inherited from class harpoon.Backend.Runtime1.MallocAllocationStrategy
buildAllocCall, DECLARE, DECLARE
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RealtimeAllocationStrategy

public RealtimeAllocationStrategy(Frame f)
Creates a RealtimeAllocationStrategy.

Method Detail

memAlloc

public Exp memAlloc(TreeFactory tf,
                    HCodeElement src,
                    DerivationGenerator dg,
                    AllocationInformation.AllocationProperties ap,
                    Exp length)
Produces the Tree code corresponding to a memory allocation.

Overrides:
memAlloc in class MallocAllocationStrategy

stringLabel

public static Label stringLabel(String s)
Return a label corresponding to the string s. Available only if DEBUG_REF is turned on.


emitStrings

public static Stm emitStrings(TreeFactory tf,
                              HCodeElement src)
Emit all of the const char*'s used so far in the file and flush the list.