gnu.kawa.reflect

Class Invoke

Implemented Interfaces:
CanInline, Named

public class Invoke
extends ProcedureN
implements CanInline

Field Summary

static Invoke
invoke
static Invoke
invokeSpecial
static Invoke
invokeStatic
static Invoke
make

Fields inherited from class gnu.mapping.ProcedureN

noArgs

Constructor Summary

Invoke(String name, char kind)
Invoke(String name, char kind, Language language)

Method Summary

void
apply(Object[] args, CallContext ctx)
void
apply(CallContext ctx)
Object
applyN(Object[] args)
protected static Object
applyN(Invoke thisProc, Object[] args)
protected PrimProcedure[]
getMethods(ClassType ctype, String mname, Expression[] args, int margsLength, int argsStartIndex, int objIndex, ClassType caller)
static PrimProcedure
getStaticMethod(ClassType type, String name, Expression[] args)
Expression
inline(ApplyExp exp, ExpWalker walker)
static Expression
inlineClassName(ApplyExp exp, int carg, InlineCalls walker)
Resolve class specifier to ClassType at inline time.
static Object
invoke$V(Object[] args)
static Object
invokeStatic$V(Object[] args)
static Object
make$V(Object[] args)
static ApplyExp
makeInvokeStatic(ClassType type, String name, Expression[] args)
Return an ApplyExp that will call a method with given arguments.
int
numArgs()

Methods inherited from class gnu.mapping.ProcedureN

apply0, apply1, apply2, apply3, apply4, applyN

Methods inherited from class gnu.mapping.Procedure

apply, apply, apply0, apply1, apply2, apply3, apply4, applyN, check0, check1, check2, check3, check4, checkArgCount, checkN, getName, getProperty, getSetter, getSymbol, match0, match1, match2, match3, match4, matchN, maxArgs, minArgs, name, numArgs, removeProperty, set0, set1, setN, setName, setProperty, setProperty, setSetter, setSymbol, toString

Field Details

invoke

public static final Invoke invoke

invokeSpecial

public static final Invoke invokeSpecial

invokeStatic

public static final Invoke invokeStatic

make

public static final Invoke make

Constructor Details

Invoke

public Invoke(String name,
              char kind)

Invoke

public Invoke(String name,
              char kind,
              Language language)

Method Details

apply

public void apply(Object[] args,
                  CallContext ctx)
            throws Throwable

apply

public void apply(CallContext ctx)
            throws Throwable
Overrides:
apply in interface Procedure

applyN

public Object applyN(Object[] args)
            throws Throwable
Overrides:
applyN in interface ProcedureN

applyN

protected static Object applyN(Invoke thisProc,
                               Object[] args)
            throws Throwable

getMethods

protected PrimProcedure[] getMethods(ClassType ctype,
                                     String mname,
                                     Expression[] args,
                                     int margsLength,
                                     int argsStartIndex,
                                     int objIndex,
                                     ClassType caller)

getStaticMethod

public static PrimProcedure getStaticMethod(ClassType type,
                                            String name,
                                            Expression[] args)

inline

public Expression inline(ApplyExp exp,
                         ExpWalker walker)
Specified by:
inline in interface CanInline

inlineClassName

public static Expression inlineClassName(ApplyExp exp,
                                         int carg,
                                         InlineCalls walker)
Resolve class specifier to ClassType at inline time. This is an optimization to avoid having a module-level binding created for the class name.

invoke$V

public static Object invoke$V(Object[] args)
            throws Throwable

invokeStatic$V

public static Object invokeStatic$V(Object[] args)
            throws Throwable

make$V

public static Object make$V(Object[] args)
            throws Throwable

makeInvokeStatic

public static ApplyExp makeInvokeStatic(ClassType type,
                                        String name,
                                        Expression[] args)
Return an ApplyExp that will call a method with given arguments.
Parameters:
type - the class containing the method we want to call.
name - the name of the method we want to call
args - the arguments to the call
Returns:
an ApplyExp representing the call

numArgs

public int numArgs()
Overrides:
numArgs in interface Procedure