harpoon.Analysis.MemOpt
Class PreallocAllocationStrategy
java.lang.Object
harpoon.Backend.Runtime1.AllocationStrategy
harpoon.Backend.Runtime1.MallocAllocationStrategy
harpoon.Backend.Runtime1.BDWAllocationStrategy
harpoon.Analysis.MemOpt.PreallocAllocationStrategy
- All Implemented Interfaces:
- Serializable
public class PreallocAllocationStrategy
- extends BDWAllocationStrategy
PreallocAllocationStrategy
is the allocation strategy
for the Static Memory Preallocation Optimization (via Ovy's
Incompatibility Analysis). When asked to generate code that
allocates memory for an allocation site, it behaves as follows:
- If the
AllocationProperties
object for that
allocation site indicates that the memory space has been
preallocated, then generate code that simply reads the static
variable that points to the pre-allocated chunk of memory.
- Otherwise, use the standard allocation from
BDWAllocationStrategy
(yes, the preallocation
optimization currently works only with BDW).
- Version:
- $Id: PreallocAllocationStrategy.java,v 1.7 2003/03/07 20:57:20 salcianu Exp $
- Author:
- Alexandru Salcianu <salcianu@MIT.edu>
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PreallocAllocationStrategy
public PreallocAllocationStrategy(Frame f)
- Creates a
PreallocAllocationStrategy
.
memAlloc
public Exp memAlloc(TreeFactory tf,
HCodeElement source,
DerivationGenerator dg,
AllocationInformation.AllocationProperties ap,
Exp length)
- Description copied from class:
AllocationStrategy
- Return a
Tree.Exp
created with the given
TreeFactory
that returns a pointer to a piece of
memory length
bytes long.
- Overrides:
memAlloc
in class BDWAllocationStrategy