public final class SpecializationDatabase extends Object
The overall design is very similar to that of the InvalidationDatabase (see InvalidationDatabase.java) In this database, the key is the RVMMethod object of the source method and the value is a method set. The method set is a list of specialized versions of the method pointed by the key. Specialized versions are represented by using the SpecializedMethod class. There is no provision for removing/deleting method versions as classes are never unloaded and the ClassLoader.compiledMethods[] is never cleaned.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
SpecializationDatabase.MethodSet<T>
The following defines a set of methods that share a common "key"
|
Modifier and Type | Field and Description |
---|---|
private static HashSetRVM<SpecializedMethod> |
deferredMethods |
private static boolean |
specializationInProgress |
private static ImmutableEntryHashMapRVM<RVMMethod,SpecializationDatabase.MethodSet<RVMMethod>> |
specialVersionsHash |
Constructor and Description |
---|
SpecializationDatabase() |
Modifier and Type | Method and Description |
---|---|
static void |
doDeferredSpecializations()
Drain the queue of methods waiting for specialized code
generation.
|
private static <T> SpecializationDatabase.MethodSet<T> |
findOrCreateMethodSet(ImmutableEntryHashMapRVM<T,SpecializationDatabase.MethodSet<T>> hash,
T key)
Looks up the MethodSet corresponding to a given key in the database.
|
(package private) static int |
getSpecialVersionCount(RVMMethod m) |
(package private) static Iterator<SpecializedMethod> |
getSpecialVersions(RVMMethod m) |
private static void |
registerCompiledMethod(SpecializedMethod m) |
(package private) static void |
registerSpecialVersion(SpecializedMethod spMethod)
Records a new specialized method in this database.
|
private static boolean specializationInProgress
private static final HashSetRVM<SpecializedMethod> deferredMethods
private static final ImmutableEntryHashMapRVM<RVMMethod,SpecializationDatabase.MethodSet<RVMMethod>> specialVersionsHash
public SpecializationDatabase()
public static void doDeferredSpecializations()
private static void registerCompiledMethod(SpecializedMethod m)
static Iterator<SpecializedMethod> getSpecialVersions(RVMMethod m)
m
- the method whose specialized methods are queriednull
if no specialized versionsstatic int getSpecialVersionCount(RVMMethod m)
static void registerSpecialVersion(SpecializedMethod spMethod)
doDeferredSpecializations()
spMethod
- the method to registerprivate static <T> SpecializationDatabase.MethodSet<T> findOrCreateMethodSet(ImmutableEntryHashMapRVM<T,SpecializationDatabase.MethodSet<T>> hash, T key)
T
- type of the key in the databasehash
- the databasekey
- the key