|
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.CBinaryMethod
This class represents a loaded (already compiled) class method.
| Field Summary | |
private CAmbiguousDispatcherClass |
ambiguousDispatcherClass
|
private CDispatcherSignature |
dispatcherSig
|
private int |
functionNumber
The unique number of the overloaded external generic function to which this belongs, or Short.MAX_VALUE if this does not belong to an external generic function. |
private static int |
TOPS_INIT_SIZE
|
private static int |
topsNextPos
|
private static CBinaryMethod[] |
unresolvedTops
|
private static int |
UNSW_INIT_SIZE
|
private static CBinaryMethod[] |
unswallowed
|
private static int |
unswNextPos
|
| 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 | |
|
CBinaryMethod(CClass host,
MethodInfo methodInfo,
CContextType declarationContext)
Constructs a method |
protected |
CBinaryMethod(MemberAccess acc,
MethodInfo methodInfo,
CContextType declarationContext)
Constructs a method |
| Method Summary | |
CAmbiguousDispatcherClass |
ambiguousDispatcherClass()
Returns the ambiguous-method dispatcher class for this. |
CClass |
anchorClass()
Returns the $anchor class for this generic function. |
private static CClassType[] |
buildExceptionTypes(MethodInfo methodInfo)
|
private static CSpecializedType[] |
buildParameterTypes(CClass host,
MethodInfo methodInfo)
|
private static CClass |
buildReceiverClass(CClass host,
MethodInfo methodInfo)
|
private static CType |
buildReturnType(CClass host,
MethodInfo methodInfo)
|
private static CTypeVariable[] |
buildTypeParameter(CClass host,
MethodInfo methodInfo)
|
void |
checkTypes(CContextType context)
|
CDispatcherSignature |
dispatcherSignature()
Returns the $signature class for this. |
int |
functionNumber()
Returns the function field number for this generic function within its $anchor class. |
private static String |
getCorrectSignature(CClass host,
MethodInfo methodInfo)
Simple convenience method which returns the appropriate method signature stored in the given methodInfo depending on whether Java
generics are turned on or off in the current compilation session. |
void |
plantFunctionRef(CodeSequence code)
Generates bytecode to put a reference to the external function field for the external generic function
on the JVM stack. |
void |
plantOldFunctionRef(CodeSequence code,
boolean forSuper,
boolean fromOuter)
Generates bytecode to put a reference to the oldFunction field for the external generic function
on the JVM stack. |
private static void |
registerNew(CBinaryMethod self)
Registers that the newly created binary method self has not had its top method resolved or its
receiver swallowed. |
void |
registerVisibleTypes()
Registers the types visible in the signature of this. |
protected static void |
resolveTops()
Resolves the top methods of all binary methods. |
protected static void |
swallowReceivers()
Swallows the receivers of all external methods read from bytecode. |
| Methods inherited from class org.multijava.mjc.CMember |
access, addModifiers, deprecated, getCClass, getCCompilationUnit, getField, getIdent, getJavaName, getOwnerName, getQualNameWithSeparator, hasDefaultAccess, hasProtectedVisibilityIn, host, ident, 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 static final int TOPS_INIT_SIZE
private static int topsNextPos
private static CBinaryMethod[] unresolvedTops
private static final int UNSW_INIT_SIZE
private static int unswNextPos
private static CBinaryMethod[] unswallowed
private final int functionNumber
private CDispatcherSignature dispatcherSig
private CAmbiguousDispatcherClass ambiguousDispatcherClass
| Constructor Detail |
public CBinaryMethod(CClass host,
MethodInfo methodInfo,
CContextType declarationContext)
host - the host of this methodmethodInfo - a multimethod info from a class filedeclarationContext - the context in which this method is declared
protected CBinaryMethod(MemberAccess acc,
MethodInfo methodInfo,
CContextType declarationContext)
acc - the member access for this methodmethodInfo - a multimethod info from a class filedeclarationContext - the context in which this method is declared| Method Detail |
private static CClass buildReceiverClass(CClass host,
MethodInfo methodInfo)
private static String getCorrectSignature(CClass host,
MethodInfo methodInfo)
methodInfo depending on whether Java
generics are turned on or off in the current compilation session.
methodInfo - The information representing this method as parsed
from a *.class file.
private static CType buildReturnType(CClass host,
MethodInfo methodInfo)
private static CTypeVariable[] buildTypeParameter(CClass host,
MethodInfo methodInfo)
private static CSpecializedType[] buildParameterTypes(CClass host,
MethodInfo methodInfo)
private static CClassType[] buildExceptionTypes(MethodInfo methodInfo)
public void registerVisibleTypes()
public void plantFunctionRef(CodeSequence code)
function field for the external generic function
on the JVM stack.
also requires this.isExternal();
public void plantOldFunctionRef(CodeSequence code,
boolean forSuper,
boolean fromOuter)
oldFunction field for the external generic function
on the JVM stack.
also requires this.isExternal();
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 CDispatcherSignature dispatcherSignature()
also requires this.isExternal();
public CAmbiguousDispatcherClass ambiguousDispatcherClass()
also requires this.isExternal();
public CClass anchorClass()
also requires this.isExternal();
public int functionNumber()
also requires this.isExternal();
private static void registerNew(CBinaryMethod self)
self has not had its top method resolved or its
receiver swallowed. Called from the constructor of this
class.
protected static void resolveTops()
throws PositionedError
PositionedError
public void checkTypes(CContextType context)
throws UnpositionedError
UnpositionedErrorprotected static void swallowReceivers()
|
mjc | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||