|
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.CMethod
org.multijava.mjc.CSourceMethod
org.multijava.mjc.CSourceFilteredDispatcherMethod
This class represents a special dispatcher method for superclass method invocations whose caller is an external method and whose target is the same external generic function to which the caller belongs [see Clifton-01, Figure 24, case s-e4]. The special dispatcher filters the applicable methods to just include those whose receiver type is a proper superclass of the caller's receiver type.
| Field Summary | |
private int |
number
A unique integer for this filtered dispatcher within the host generic function collection. |
private CClass |
receiverSubclass
Only multimethods in the same generic function as target and whose receiver type is a proper supertype of
this will be considered by the generated dispatch code. |
private CSourceMethod |
target
Only multimethods in the same generic function as this and whose receiver type is a proper supertype of receiverSubclass will be considered by the generated
dispatch code. |
| Fields inherited from class org.multijava.mjc.CSourceMethod |
|
| Fields inherited from class org.multijava.mjc.CMethod |
declarationContext, generatefrom, needsPrivacyModifierRemoved, specArgs, synthetic, topConcreteMethod |
| 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 | |
CSourceFilteredDispatcherMethod(CSourceMethod target,
CSourceGFCollection host,
CClass receiverSubclass,
int number)
Creates a new CSourceFilteredDispatcherMethod instance. |
|
| Method Summary | |
void |
genGenFuncInvocation(CodeSequence code,
boolean nonVirtual)
Generates a sequence of bytecode for invoking this method, assuming appropriate argument values have already been pushed to the JVM stack. |
ArrayList |
genMethodInfo()
Generates the method info record for the .class file. |
String |
ident()
|
protected void |
plantBodyBytecode(CodeSequence code)
Plants the bytecode for a dispatcher method that dynamically selects the appropriate multimethod body from the generic function to which target belongs, filtered by receivers that are proper supertypes
of receiverSubclass. |
void |
plantFunctionRef(CodeSequence code)
Generates bytecode to put a reference to the external function field for the external generic function
on the JVM stack. |
| Methods inherited from class org.multijava.mjc.CMember |
access, addModifiers, deprecated, getCClass, getCCompilationUnit, getField, getIdent, getJavaName, getOwnerName, getQualNameWithSeparator, hasDefaultAccess, hasProtectedVisibilityIn, host, isAccessibleFrom, isDeclaredNonNull, isDeprecated, isFinal, isLocalTo, isPrivate, isProtected, isPublic, isStatic, modifiers, owner, qualifiedName, 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 |
| Field Detail |
private final CSourceMethod target
receiverSubclass will be considered by the generated
dispatch code.
private final CClass receiverSubclass
target and whose receiver type is a proper supertype of
this will be considered by the generated dispatch code.
private final int number
ident()| Constructor Detail |
public CSourceFilteredDispatcherMethod(CSourceMethod target,
CSourceGFCollection host,
CClass receiverSubclass,
int number)
CSourceFilteredDispatcherMethod instance.
target - the top method of the target generic function of
the dispatcherhost - the CSourceGFCollection containing
target and the dispatcherreceiverSubclass - only methods of the generic function whose
receiver type is a proper supertype of the given class
will be considered applicable by the dispatcher| Method Detail |
public String ident()
ident in class CMemberpublic void plantFunctionRef(CodeSequence code)
function field for the external generic function
on the JVM stack. Overridden here to plant a self reference
since for a local superclass method invocation on an external
generic function this is the last dispatcher in
the chain of responsibility.
plantFunctionRef in class CSourceMethod
public void genGenFuncInvocation(CodeSequence code,
boolean nonVirtual)
genGenFuncInvocation in class CMethodcode - the code sequencenonVirtual - force non-virtual dispatching if possible (ignored if
this method belongs to an interface or is external)public ArrayList genMethodInfo()
genMethodInfo in class CSourceMethodprotected void plantBodyBytecode(CodeSequence code)
target belongs, filtered by receivers that are proper supertypes
of receiverSubclass.
plantBodyBytecode in class CSourceMethod
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||