|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.inlining.InvalidationDatabase
public final class InvalidationDatabase
This class holds the dependencies that define invalidation requirements for the opt compiled methods.
Currently we only support 2 kinds of dependencies: The set of compiled method id's that depend on a RVMMethod not being overridden. The set of compiled method id's that depend on a RVMClass having no subclasses
Note we track by compiled method ids instead of pointers to compiled methods because we don't have weak pointers. We don't want the invalidaton database to keep code alive! This would be an ideal use of weak references if we had them.
TODO: In the future, we should think about implementing a general dependency mechanism. See Chambers, Dean, Grove in ICSE-17 (1995) for one possible design and pointers to related work.
Nested Class Summary | |
---|---|
(package private) static class |
InvalidationDatabase.MethodSet
The following defines a set of methods that share a common "key" |
Field Summary | |
---|---|
private HashMapRVM<RVMMethod,InvalidationDatabase.MethodSet> |
nonOverriddenHash
A mapping from RVMMethod to MethodSet: holds the set of methods which depend on a particular method being "final" |
private HashMapRVM<RVMClass,InvalidationDatabase.MethodSet> |
noSubclassHash
A mapping from RVMClass to MethodSet: holds the set of methods which depend on a particular class being "final" |
Constructor Summary | |
---|---|
InvalidationDatabase()
|
Method Summary | ||
---|---|---|
void |
addNoSubclassDependency(RVMClass source,
int dependent_cmid)
Record that if a particular RVMClass ever has a subclass, then the CompiledMethod encoded by the cmid must be invalidated. |
|
void |
addNotOverriddenDependency(RVMMethod source,
int dependent_cmid)
Record that if a particular RVMMethod method is ever overridden, then the CompiledMethod encoded by the cmid must be invalidated. |
|
private
|
findOrCreateMethodSet(HashMapRVM<T,InvalidationDatabase.MethodSet> hash,
T key)
Look up the MethodSet corresponding to a given key in the database. |
|
Iterator<Integer> |
invalidatedByOverriddenMethod(RVMMethod m)
Returns an iteration of CMID's (compiled method ids) that are dependent on the argument RVMMethod not being overridden. |
|
Iterator<Integer> |
invalidatedBySubclass(RVMClass m)
Returns an iteration of CMID's (compiled method ids) that are dependent on the argument RVMMethod not having any subclasses. |
|
void |
removeNoSubclassDependency(RVMClass source)
Delete all NoSubclass dependencies on the argument RVMClass |
|
void |
removeNoSubclassDependency(RVMClass source,
int dependent_cmid)
Delete a NoSubclassDependency. |
|
void |
removeNotOverriddenDependency(RVMMethod source)
Delete all NotOverridden dependencies on the argument RVMMethod |
|
void |
removeNotOverriddenDependency(RVMMethod source,
int dependent_cmid)
Delete a NotOverriddenDependency. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final HashMapRVM<RVMMethod,InvalidationDatabase.MethodSet> nonOverriddenHash
private final HashMapRVM<RVMClass,InvalidationDatabase.MethodSet> noSubclassHash
Constructor Detail |
---|
public InvalidationDatabase()
Method Detail |
---|
public Iterator<Integer> invalidatedByOverriddenMethod(RVMMethod m)
null
will be returned.
NOTE: null
is used instead of EmptyIterator.getInstance
as part of delicate dance to avoid recursive classloading.
m
- a method that can be overridden
null
public void addNotOverriddenDependency(RVMMethod source, int dependent_cmid)
public void removeNotOverriddenDependency(RVMMethod source, int dependent_cmid)
public void removeNotOverriddenDependency(RVMMethod source)
public Iterator<Integer> invalidatedBySubclass(RVMClass m)
null
will be returned.
NOTE: null
is used instead of EmptyIterator.getInstance
as part of delicate dance to avoid recursive classloading.
m
- a method that can be overridden
null
public void addNoSubclassDependency(RVMClass source, int dependent_cmid)
public void removeNoSubclassDependency(RVMClass source, int dependent_cmid)
public void removeNoSubclassDependency(RVMClass source)
private <T> InvalidationDatabase.MethodSet findOrCreateMethodSet(HashMapRVM<T,InvalidationDatabase.MethodSet> hash, T key)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |