|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.MemOpt.PreallocOpt
public abstract class PreallocOpt
Nested Class Summary | |
---|---|
static class |
PreallocOpt.QuadPass
|
static class |
PreallocOpt.SafeCachingCodeFactory
A CachingCodeFactory that ignores all calls to
clear (hence the name). |
static class |
PreallocOpt.TreePass
|
Field Summary | |
---|---|
static boolean |
HACKED_GC
Set this to true only if you use the hacked BDW GC version that has "GC_malloc_prealloc". |
static int |
highBound
|
static int |
lowBound
|
static boolean |
ONLY_SYNC_REMOVAL
Use the incompatibility analysis only to remove syncronizations on the objects that can be preallocated (but don't actually preallocate them). |
static boolean |
PREALLOC_OPT
If true , the compiler uses the static memory
pre-allocation optimization (via
IncompatibilityAnalysis . |
static boolean |
RANGE_DEBUG
If true, we do not preallocate allocation sites whose unique identifier is not between lowBound and
|
Constructor Summary | |
---|---|
PreallocOpt()
|
Method Summary | |
---|---|
static HCodeFactory |
addMemoryPreallocation(Linker linker,
HCodeFactory hcf,
Frame frame)
Add the code that preallocates memory and initializes the static fields that point to the preallocated memory chunks. |
static HData |
getData(HClass hclass,
Frame frame)
|
static HCodeFactory |
getHCFWithEmptyInitCode(HCodeFactory hcf)
Returns a code factory that provides an intermediate representation for the empty body of the preallocated memory initialization. |
static HCodeFactory |
preallocAnalysis(Linker linker,
HCodeFactory hcf,
ClassHierarchy ch,
HMethod mainM,
Set roots,
AllocationStatistics as,
Frame frame)
Executes the IncompatibilityAnalysis and creates
a (QuadSSI) code factory that produces code with the
allocation properties set to reflect the fact that some
allocation sites can use pre-allocated memory space. |
static void |
updateRoots(Set roots,
Linker linker)
Adds to the set of roots the classes/methods that are called by the runtime when the preallocation optimization is used. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean PREALLOC_OPT
true
, the compiler uses the static memory
pre-allocation optimization (via
IncompatibilityAnalysis
. Default is
false
.
public static boolean ONLY_SYNC_REMOVAL
public static boolean RANGE_DEBUG
lowBound and
highBound
. (The unique id is obtained from a
AllocationStatistics
object.
public static int lowBound
public static int highBound
public static boolean HACKED_GC
Constructor Detail |
---|
public PreallocOpt()
Method Detail |
---|
public static void updateRoots(Set roots, Linker linker)
roots
- set of rootslinker
- linker used to get classespublic static HCodeFactory getHCFWithEmptyInitCode(HCodeFactory hcf)
hcf
- Code factory providing the code for the rest of the code
(currently, it has to be quad-with-try).
hcf
parameter, except that it also provides a default, empty body
for the preallocated memory initilaization.public static HCodeFactory preallocAnalysis(Linker linker, HCodeFactory hcf, ClassHierarchy ch, HMethod mainM, Set roots, AllocationStatistics as, Frame frame)
IncompatibilityAnalysis
and creates
a (QuadSSI) code factory that produces code with the
allocation properties set to reflect the fact that some
allocation sites can use pre-allocated memory space. In
addition, it adds static fields to the class named by
PreallocOpt.PREALLOC_MEM_CLASS_NAME
; at runtime,
these fields will point to pre-allocated chunks of memory, one
for each compatibility class found by the analysis.
linker
- linker used to get classeshcf
- initial code factory; it has to be convertible to a
QuadSSI code factory.ch
- class hierarchy for the programmainM
- main method of the programroots
- set of rootsas
- allocation (dynamic) statistics; if
non-null
, the method prints some static and
dynamic statistics.frame
- Backend specific information for compilation
(data size and data layout details). Used only for
statistics; in particular, unused if as
is
null
.
Code
s
where allocation sites that can be pre-allocated have the
attached PreallocAllocationStrategy
.public static HData getData(HClass hclass, Frame frame)
public static HCodeFactory addMemoryPreallocation(Linker linker, HCodeFactory hcf, Frame frame)
linker
- Linker for loading classeshcf
- Code factory for the current vesrion of the program
(without the memory preallocation code).frame
- Backend specific information for compilation
(data size and data layout details).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |