harpoon.Backend.Generic
Class RuntimeInformation

java.lang.Object
  extended by harpoon.Backend.Generic.RuntimeInformation
Direct Known Subclasses:
JLSRuntimeInformation, RuntimeInformation

public abstract class RuntimeInformation
extends Object

RuntimeInformation is an abstract encapsulation of analysis information about native methods as executed by a particular runtime system. Examples of runtime systems include Sun's JDK 1.1, JDK1.2, or JDK1.3; GNU classpath, and etc. Note that there may be additional behaviors introduced by the particular Generic.Runtime the code is executed by: native code executed via the Java Native Interface may have additional behaviors due to the particular implementation of the JNI being used. JNI implementations are typically tied to a particular JVM; for example Sun's JDKs, Transvirtual's Kaffe, or our own FLEX native code runtime implementation.

Generic.RuntimeInformation class is designed to use inheritance and proxy-ing to intelligently represent common behaviors. Behaviors discovered missing from an implementation should be added to the most general appropriate class (which may be either a superclass of the instance used, or a class proxied by the instance or its superclasses) in order to reduce code duplication. The root Generic.RuntimeInformation class should always be kept completely abstract.

Version:
$Id: RuntimeInformation.java,v 1.2 2002/02/25 21:01:28 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
JDK11RuntimeImplementation, JDK12RuntimeImplementation

Field Summary
 Linker linker
          The Linker to use for all non-primitive elements of the returned Sets.
 
Constructor Summary
protected RuntimeInformation(Linker linker)
           
 
Method Summary
abstract  Set baseClasses()
          Returns the set of basic classes which may be referenced in some way by the runtime (for example, as the component type of an array).
abstract  Set initiallyCallableMethods()
          Returns the set of methods called during the initialization of the runtime system.
abstract  Set methodsCallableFrom(HMethod m)
          Returns the set of methods called during the execution of the specified method.
protected  Set union(Set s1, Set s2)
          Convenience method to union two sets, either or both of which may be unmodifiable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

linker

public final Linker linker
The Linker to use for all non-primitive elements of the returned Sets.

Constructor Detail

RuntimeInformation

protected RuntimeInformation(Linker linker)
Method Detail

initiallyCallableMethods

public abstract Set initiallyCallableMethods()
Returns the set of methods called during the initialization of the runtime system. These methods are called before the "main" method of the program. Instantiation of any classes during the runtime system initialization should be indicated via inclusion of an appropriate HConstructor in the set of callable methods.

Returns:
a Set of HMethods.

methodsCallableFrom

public abstract Set methodsCallableFrom(HMethod m)
Returns the set of methods called during the execution of the specified method. The method may or may not be native; a particular run-time may do something "tricky" during the execution of an otherwise normal method which can be described by the results of this call. The specified method may not be null. To indicate that a particular method may cause the instantiation of one of more classes, appropriate HConstructors should be included in the returned set.

Returns:
a Set of HMethods.

baseClasses

public abstract Set baseClasses()
Returns the set of basic classes which may be referenced in some way by the runtime (for example, as the component type of an array). This does not include classes which may be instantiated by the runtime, constructors for which ought to be included as callable methods instead of including them in the result set from this method. The only classes I can think of that ought to be included in this set are the 8 primitive type classes, which are sometimes referenced via reflection (as opposed to instantiation) via the java.lang.Class.forName() method; feel free to extend your implementation if I happen to be missing some possibilities.

Returns:
a Set of HClasses.

union

protected final Set union(Set s1,
                          Set s2)
Convenience method to union two sets, either or both of which may be unmodifiable. If either set is modifiable, it adds the contents of the other to it and returns the modified set. If neither is modifiable, it creates a new modifiable set and adds both sets to it before returning it.