|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.mjc.CMember
org.multijava.mjc.CClass
org.multijava.mjc.CSourceClass
org.multijava.mjc.CSourceDispatcherClass
This class represents an inner dispatcher class for a collection of multimethods of the same generic function declared in a single lexical context.
| Nested Class Summary |
| Nested classes inherited from class org.multijava.mjc.CClass |
CClass.NoDupStrategy, CClass.Observer |
| Field Summary | |
protected CAmbiguousDispatcherClass |
ambiguousDispatcherClass
The ambiguous-method dispatcher class for this generic function. |
protected CSourceDispatcherMethod |
dispatcherMethod
|
protected CDispatcherSignature |
dispatcherSig
The $signature interface for this generic function. |
private boolean |
infoCompleted
Indicates whether the info needed for code generation has been completed. |
private int |
number
The unique number of this within it's outer class, used to construct the identifier and qualified name of this. |
private CSourceClass |
outer
|
private TokenReference |
where
|
| Fields inherited from class org.multijava.mjc.CSourceClass |
|
| Fields inherited from class org.multijava.mjc.CClass |
CLS_UNDEFINED, dispClassTypes, methods |
| Fields inherited from class org.multijava.mjc.CMember |
|
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
CSourceDispatcherClass(Main compiler,
CSourceClass outer,
TokenReference where,
CSourceDispatcherMethod dispatcherMethod)
|
|
| Method Summary | |
protected CAmbiguousDispatcherClass |
ambiguousDispatcherClass()
Returns the ambiguous-method dispatcher class for this generic function. |
CClass |
anchorClass()
|
private void |
completeClassInfo()
Lazily completes the information necessary to generate the bytecode for the dispatcher class represented by this. |
private void |
completeClassInfo(Main compiler,
TokenReference where)
Generates the $signature interface and (if RMJ) the ambiguous-method dispatcher class for this generic function and then calls completeClassInfo(). |
private CMethod |
dispatcherConstructor()
Returns the appropriate constructor for this dispatcher class. |
protected CDispatcherSignature |
dispatcherSignature()
Returns the $signature interface for this generic function. |
CSourceMethod |
functionAccessorMethod()
Creates a synchronized accessor method for the function field for this dispatcher's generic function. |
CSourceField |
functionField()
Creates a field data structure representing the function field for this dispatcher's generic function. |
int |
functionNumber()
|
void |
genCode(Destination destination)
Generate a class file for the class represented by this. |
protected void |
genGenericFunctions(ArrayList accum)
Accumulates an array of all the required gf_info data structures for this. |
String |
ident()
Gives the identifier for this host, or null for a compilation unit. |
protected CSourceField |
outersDispatcherField()
Returns a field to be added to the outer class for storing a reference to a singleton instance of this, or returns null if the outer class is the anchor. |
private String |
outersDispatcherFieldIdent()
|
void |
plantCORInitialization(CodeSequence code)
Plants the bytecode to add this to the appropriate chain-of-responsibility and store a reference in a field of the outer class. |
void |
plantFunctionRef(CodeSequence code)
Generates bytecode to put a reference to the external function field for the external generic function
on the JVM stack. |
private void |
plantGetAnchorClassObject(CodeSequence code)
|
private void |
plantGetFunctionField(CodeSequence code)
|
void |
plantOldFunctionRef(CodeSequence code,
boolean forSuper,
boolean fromOuter)
Plants bytecode to load the oldFunction field of this dispatcher class. |
private void |
plantSetFunctionField(CodeSequence code)
|
private void |
plantSetOutersDispatcherField(CodeSequence code)
|
String |
qualifiedName()
|
void |
rmjAnnotate(RMJAnnotation rmjInfo)
Provide an annotation for any dispatcher classes (RMJ only) |
| Methods inherited from class org.multijava.mjc.CMember |
access, addModifiers, deprecated, getCCompilationUnit, getField, getIdent, getJavaName, getMethod, getOwnerName, getQualNameWithSeparator, hasDefaultAccess, host, isAccessibleFrom, isDeclaredNonNull, isDeprecated, isFinal, isLocalTo, isPrivate, isProtected, isPublic, isStatic, modifiers, owner, setModifiers |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.multijava.mjc.CMemberHost |
host, isAccessibleFrom |
| Field Detail |
private int number
private CSourceClass outer
private TokenReference where
protected final CSourceDispatcherMethod dispatcherMethod
protected CDispatcherSignature dispatcherSig
protected CAmbiguousDispatcherClass ambiguousDispatcherClass
private boolean infoCompleted
completeClassInfo()| Constructor Detail |
public CSourceDispatcherClass(Main compiler,
CSourceClass outer,
TokenReference where,
CSourceDispatcherMethod dispatcherMethod)
| Method Detail |
private void completeClassInfo(Main compiler,
TokenReference where)
completeClassInfo().
requires dispatcherMethod.isTopDispatcherInLattice();
private void completeClassInfo()
private CMethod dispatcherConstructor()
Object(). Otherwise the
constructor sets the oldFunction field of this
dispatcher to the next dispatcher in the
chain-of-responsibility.
requires dispatcherSig != null;
public String ident()
CMemberHost
ident in interface CMemberHostident in class CMemberpublic String qualifiedName()
qualifiedName in class CClassprotected CDispatcherSignature dispatcherSignature()
protected CAmbiguousDispatcherClass ambiguousDispatcherClass()
protected CSourceField outersDispatcherField()
private String outersDispatcherFieldIdent()
public void genCode(Destination destination)
throws IOException,
ClassFileFormatException
genCode in class CSourceClassIOException
ClassFileFormatExceptionpublic void plantFunctionRef(CodeSequence code)
function field for the external generic function
on the JVM stack.
requires dispatcherMethod.isTopDispatcherInLattice(); requires_redundantly dispatcherSig != null;
public CSourceMethod functionAccessorMethod()
requires dispatcherMethod.isTopDispatcherInLattice(); requires_redundantly dispatcherSig != null;
public CSourceField functionField()
requires dispatcherMethod.isTopDispatcherInLattice(); requires_redundantly dispatcherSig != null;
public void plantOldFunctionRef(CodeSequence code,
boolean forSuper,
boolean fromOuter)
requires !dispatcherMethod.isTopDispatcherInLattice(); requires_redundantly dispatcherSig == null;
code - the code sequence to add the bytecode toforSuper - if true, then this is for a super send, which,
under RMJ, should start from the oldSuperFunction
rather than oldFunctionfromOuter - if true, then generates a reference that works from the
outer class context, otherwise generates a reference that
works from within the dispatcher classpublic void plantCORInitialization(CodeSequence code)
private void plantSetOutersDispatcherField(CodeSequence code)
private void plantGetFunctionField(CodeSequence code)
private void plantSetFunctionField(CodeSequence code)
private void plantGetAnchorClassObject(CodeSequence code)
public CClass anchorClass()
public int functionNumber()
protected void genGenericFunctions(ArrayList accum)
genGenericFunctions in class CClasspublic void rmjAnnotate(RMJAnnotation rmjInfo)
rmjAnnotate in class CClass
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||