|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.classloader.InterfaceInvocation
public class InterfaceInvocation
Runtime system mechanisms and data structures to implement interface invocation.
We support two mechanisms:
IMT-based (Alpern, Cocchi, Fink, Grove, and Lieber OOPSLA'01). ITable-based (searched at dispatch time with 1 entry move-to-front cache)
Nested Class Summary | |
---|---|
private static class |
InterfaceInvocation.IMTDict
|
Field Summary |
---|
Fields inherited from interface org.jikesrvm.objectmodel.TIBLayoutConstants |
---|
IMT_METHOD_SLOTS, NEEDS_DYNAMIC_LINK, TIB_ARRAY_ELEMENT_TIB_INDEX, TIB_DOES_IMPLEMENT_INDEX, TIB_FIRST_SPECIALIZED_METHOD_INDEX, TIB_FIRST_VIRTUAL_METHOD_INDEX, TIB_INTERFACE_DISPATCH_TABLE_INDEX, TIB_SUPERCLASS_IDS_INDEX, TIB_TYPE_INDEX |
Constructor Summary | |
---|---|
InterfaceInvocation()
|
Method Summary | |
---|---|
private static InterfaceInvocation.IMTDict |
buildIMTDict(RVMClass klass,
RVMClass[] interfaces)
Build up a description of the IMT contents for the given class. |
private static ITable |
buildITable(RVMClass C,
RVMClass I)
Build a single ITable for the pair of class C and interface I |
static ITable |
findITable(TIB tib,
int id)
Return a reference to the itable for a given class, interface pair We might not have created the iTable yet, in which case we will do that and then return it. |
static int |
getITableIndex(RVMClass klass,
Atom mname,
Atom mdesc)
Return the index of the interface method m in the itable |
static void |
initializeDispatchStructures(RVMClass klass)
Main entrypoint called from RVMClass.instantiate to initialize the interface dispatching data structures for the given class. |
private static void |
installITable(RVMClass C,
RVMClass I)
Build and install an iTable for the given class interface pair (used for iTable miss on searched iTables). |
static ArchitectureSpecific.CodeArray |
invokeInterface(Object target,
int mid)
Resolve an interface method call. |
private static void |
populateIMT(RVMClass klass,
InterfaceInvocation.IMTDict d)
Populate an indirect IMT for C using the IMTDict d |
static void |
unresolvedInvokeinterfaceImplementsTest(int mid,
Object rhsObject)
mid is the dictionary id of an interface method we are trying to invoke
RHStib is the TIB of an object on which we are attempting to invoke it. |
static void |
updateTIBEntry(RVMClass klass,
RVMMethod m)
If there is an an IMT or ITable entry that contains compiled code for the argument method, then update it to contain the current compiled code for the method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InterfaceInvocation()
Method Detail |
---|
public static ArchitectureSpecific.CodeArray invokeInterface(Object target, int mid) throws IncompatibleClassChangeError
target
- object to which interface method is to be appliedmid
- id of the MemberReference for the target interface method.
IncompatibleClassChangeError
public static ITable findITable(TIB tib, int id) throws IncompatibleClassChangeError
tib
- the TIB for the classid
- interface id of the interface sought (NOT dictionary id!!)
IncompatibleClassChangeError
public static void unresolvedInvokeinterfaceImplementsTest(int mid, Object rhsObject) throws IncompatibleClassChangeError
mid
is the dictionary id of an interface method we are trying to invoke
RHStib
is the TIB of an object on which we are attempting to invoke it.
We were unable to resolve the member reference at compile time.
Therefore we must resolve it now and then call invokeinterfaceImplementsTest
with the right LHSclass.
mid
- Dictionary id of the MemberReference
for the target interface method.rhsObject
- The object on which we are attempting to invoke the interface method
IncompatibleClassChangeError
public static void initializeDispatchStructures(RVMClass klass)
klass
- the RVMClass to initialize the dispatch structures for.private static InterfaceInvocation.IMTDict buildIMTDict(RVMClass klass, RVMClass[] interfaces)
klass
- the RVMClass whose IMT we are going to build.
private static void populateIMT(RVMClass klass, InterfaceInvocation.IMTDict d)
private static void installITable(RVMClass C, RVMClass I)
private static ITable buildITable(RVMClass C, RVMClass I)
public static int getITableIndex(RVMClass klass, Atom mname, Atom mdesc)
public static void updateTIBEntry(RVMClass klass, RVMMethod m)
klass
- the RVMClass who's IMT/ITable is being resetm
- the method that needs to be updated.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |