org.jikesrvm.compilers.opt.inlining
Class InterfaceHierarchy

java.lang.Object
  extended by org.jikesrvm.compilers.opt.inlining.InterfaceHierarchy

public class InterfaceHierarchy
extends Object

This class holds, for each interface, the set of initialized classes that implement the interface.


Field Summary
private static ImmutableEntryHashMapRVM<RVMClass,ImmutableEntryHashSetRVM<RVMClass>> interfaceMapping
          a mapping from RVMClass (an interface) to a set of classes that claim to implement this interface.
 
Constructor Summary
InterfaceHierarchy()
           
 
Method Summary
private static ImmutableEntryHashSetRVM<RVMClass> allImplementors(RVMClass I)
          Return the set of all classes known to implement interface I.
private static ImmutableEntryHashSetRVM<RVMClass> allSubClasses(RVMClass C)
          Return the set of all classes known to extend C
private static ImmutableEntryHashSetRVM<RVMClass> findOrCreateSet(RVMClass I)
          Return the set of classes that implement a given interface.
static RVMMethod getUniqueImplementation(RVMMethod foo)
          If, in the current class hierarchy, there is exactly one method that defines the interface method foo, then return the unique implementation.
private static void noteImplements(RVMClass c, RVMClass I)
          Note that class c implements interface I;
static void notifyClassInitialized(RVMClass c)
          Notify this dictionary that a new class has been initialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

interfaceMapping

private static final ImmutableEntryHashMapRVM<RVMClass,ImmutableEntryHashSetRVM<RVMClass>> interfaceMapping
a mapping from RVMClass (an interface) to a set of classes that claim to implement this interface.

Constructor Detail

InterfaceHierarchy

public InterfaceHierarchy()
Method Detail

notifyClassInitialized

public static void notifyClassInitialized(RVMClass c)
Notify this dictionary that a new class has been initialized. This method updates the dictionary to record the interface implementors.


noteImplements

private static void noteImplements(RVMClass c,
                                   RVMClass I)
Note that class c implements interface I;


findOrCreateSet

private static ImmutableEntryHashSetRVM<RVMClass> findOrCreateSet(RVMClass I)
Return the set of classes that implement a given interface. Create a set if none found.


allImplementors

private static ImmutableEntryHashSetRVM<RVMClass> allImplementors(RVMClass I)
Return the set of all classes known to implement interface I.


allSubClasses

private static ImmutableEntryHashSetRVM<RVMClass> allSubClasses(RVMClass C)
Return the set of all classes known to extend C


getUniqueImplementation

public static RVMMethod getUniqueImplementation(RVMMethod foo)
If, in the current class hierarchy, there is exactly one method that defines the interface method foo, then return the unique implementation. If there is not a unique implementation, return null.