A primitive Procedure implemented by a plain Java method.
PrimProcedure
public PrimProcedure(String className,
String methodName,
int numArgs)
PrimProcedure
public PrimProcedure(Method method)
PrimProcedure
public PrimProcedure(Method method,
char mode,
Language language)
PrimProcedure
public PrimProcedure(int op_code,
ClassType classtype,
String name,
Type retType,
Type[] argTypes)
PrimProcedure
public PrimProcedure(int opcode,
Type retType,
Type[] argTypes)
PrimProcedure
public PrimProcedure(java.lang.reflect.Method method,
Language language)
compileInvoke
public static void compileInvoke(Compilation comp,
Method method,
Target target,
boolean isTailCall,
int op_code,
Type stackType)
Emit the actual invoke operation, after arguments have been pushed.
Does whatever magic is needed to pass the result to target,
including passing CallContext or special handling of ConsumerTarget.
getMethod
public Method getMethod()
getParameterTypes
public final Type[] getParameterTypes()
getProcedureClass
public static Class getProcedureClass(Object pproc)
getReturnType
public Type getReturnType()
getStaticFlag
public final boolean getStaticFlag()
True if there is no 'this' parameter.
getVerboseName
public String getVerboseName()
isConstructor
public final boolean isConstructor()
isSpecial
public boolean isSpecial()
makeBuiltinBinary
public static PrimProcedure makeBuiltinBinary(int opcode,
Type type)
numArgs
public int numArgs()
The (minimum, number) of arguments.
Doesn't not count implicit CallContext argument.
Does count 'this' argument for non-static methods.
Does count an implicit staticLink argument for constructor.
- numArgs in interface Procedure
opcode
public final int opcode()
print
public void print(java.io.PrintWriter ps)
setReturnType
public void setReturnType(Type retType)
takesContext
public boolean takesContext()
takesContext
public static boolean takesContext(Method method)
takesTarget
public boolean takesTarget()
Whether we are passed an argument for the 'target' / 'receiver' / 'this'.
Normally this is false for static methods and true for non-static
methods. However, we may need to be able to call a static method using
object.name(args...)
(Java syntax) or
(invoke object 'name args...)
(Scheme syntax).
This includes when the object
is implied.
In this case we need to ignore the first argument's value.
takesVarArgs
public boolean takesVarArgs()
Return true iff the last parameter is a "rest" argument.