Search in sources :

Example 1 with IMT

use of org.jikesrvm.objectmodel.IMT in project JikesRVM by JikesRVM.

the class InterfaceInvocation method updateTIBEntry.

/**
 * 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.
 *
 * @param klass the RVMClass who's IMT/ITable is being reset
 * @param m the method that needs to be updated.
 */
public static void updateTIBEntry(RVMClass klass, RVMMethod m) {
    TIB tib = klass.getTypeInformationBlock();
    if (VM.BuildForIMTInterfaceInvocation) {
        RVMMethod[] map = klass.noIMTConflictMap;
        if (map != null) {
            for (int i = 0; i < IMT_METHOD_SLOTS; i++) {
                if (map[i] == m) {
                    IMT imt = tib.getImt();
                    imt.set(i, m.getCurrentEntryCodeArray());
                    // all done -- a method is in at most 1 IMT slot
                    return;
                }
            }
        }
    } else if (VM.BuildForITableInterfaceInvocation) {
        if (tib.getITableArray() != null) {
            ITableArray iTables = tib.getITableArray();
            Atom name = m.getName();
            Atom desc = m.getDescriptor();
            for (int i = 0; i < iTables.length(); i++) {
                ITable iTable = iTables.get(i);
                if (iTable != null) {
                    RVMClass I = iTable.getInterfaceClass();
                    RVMMethod[] interfaceMethods = I.getDeclaredMethods();
                    for (RVMMethod im : interfaceMethods) {
                        if (im.getName() == name && im.getDescriptor() == desc) {
                            iTable.set(getITableIndex(I, name, desc), m.getCurrentEntryCodeArray());
                        }
                    }
                }
            }
        }
    }
}
Also used : IMT(org.jikesrvm.objectmodel.IMT) ITableArray(org.jikesrvm.objectmodel.ITableArray) ITable(org.jikesrvm.objectmodel.ITable) TIB(org.jikesrvm.objectmodel.TIB) Entrypoint(org.vmmagic.pragma.Entrypoint)

Example 2 with IMT

use of org.jikesrvm.objectmodel.IMT in project JikesRVM by JikesRVM.

the class InterfaceInvocation method populateIMT.

private static void populateIMT(RVMClass klass, IMTDict d) {
    TIB tib = klass.getTypeInformationBlock();
    IMT IMT = MemoryManager.newIMT();
    klass.setIMT(IMT);
    d.populateIMT(klass, tib, IMT);
    tib.setImt(IMT);
}
Also used : IMT(org.jikesrvm.objectmodel.IMT) TIB(org.jikesrvm.objectmodel.TIB)

Aggregations

IMT (org.jikesrvm.objectmodel.IMT)2 TIB (org.jikesrvm.objectmodel.TIB)2 ITable (org.jikesrvm.objectmodel.ITable)1 ITableArray (org.jikesrvm.objectmodel.ITableArray)1 Entrypoint (org.vmmagic.pragma.Entrypoint)1