public class GenericProc extends MethodProc
| Modifier and Type | Field and Description |
|---|---|
static java.lang.invoke.MethodHandle |
applyToConsumerGP |
protected MethodProc[] |
methods |
applyToConsumerDefaultMP, argTypes, NO_MATCH, NO_MATCH_AMBIGUOUS, NO_MATCH_BAD_TYPE, NO_MATCH_GUARD_FALSE, NO_MATCH_TOO_FEW_ARGS, NO_MATCH_TOO_MANY_ARGS, NO_MATCH_UNUSED_KEYWORD, THROW_ON_EXCEPTIONapplyToObject, noArgsapplyMethodType, applyToConsumerDefault, applyToConsumerMethod, applyToObjectDefault, applyToObjectMethod, compilerKey, compilerXKey, inlineIfConstantSymbol, validateApplyKey, validateXApplyKeynameKey| Constructor and Description |
|---|
GenericProc() |
GenericProc(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(MethodProc method) |
protected void |
addAll(MethodProc[] procs) |
void |
addAtEnd(MethodProc method) |
static java.lang.Object |
applyToConsumerGP(Procedure proc,
CallContext ctx) |
MethodProc |
getMethod(int i) |
int |
getMethodCount() |
int |
isApplicable(Type[] args,
Type restType)
Test if method is applicable to an invocation with given arguments.
|
static GenericProc |
make(java.lang.Object[] args)
Create a GenericProc from one or more methods, plus properties.
|
static GenericProc |
makeWithoutSorting(java.lang.Object... args) |
int |
numArgs()
Return
minArgs()|(maxArgs<<12). |
void |
setProperties(java.lang.Object[] args) |
void |
setProperty(Keyword key,
java.lang.Object value) |
applyToConsumerDefaultMP, getParameterType, matchFailAsException, mostSpecific, numParameters, overrideEquivalent, resolveParameterTypesapplyToObjectapply0, apply1, apply2, apply3, apply4, applyL, applyN, applyToConsumerDefault, applyToObjectDefault, checkArgCount, checkBadCode, getApplyMethod, getApplyToConsumerMethod, getApplyToObjectMethod, getReturnType, getSetter, getSourceLocation, isSideEffectFree, lookupApplyHandle, maxArgs, maxArgs, minArgs, minArgs, set0, set1, setN, setSetter, setSourceLocation, toStringgetName, getProperty, getSymbol, removeProperty, setName, setProperty, setProperty, setSymbolprotected MethodProc[] methods
public static final java.lang.invoke.MethodHandle applyToConsumerGP
public GenericProc(java.lang.String name)
public GenericProc()
public int getMethodCount()
public MethodProc getMethod(int i)
public int numArgs()
ProcedureminArgs()|(maxArgs<<12).
We use a single virtual function to reduce the number of methods
in the system, as well as the number of virtual method table entries.
We shift by 12 so the number can normally be represented using a
sipush instruction, without requiring a constant pool entry.protected void addAll(MethodProc[] procs)
public void addAtEnd(MethodProc method)
public void add(MethodProc method)
public int isApplicable(Type[] args, Type restType)
MethodProcisApplicable in class MethodProcargs - array of known "single" arguments.restType - If null, the arguments are fully specified by argTypes.
If non-null, there may be an unknown number of extra arguments
of the given restType. This is used for splices, where we usually
don't know at compile-time how many argument values we have.public static java.lang.Object applyToConsumerGP(Procedure proc, CallContext ctx) throws java.lang.Throwable
java.lang.Throwablepublic void setProperty(Keyword key, java.lang.Object value)
public final void setProperties(java.lang.Object[] args)
public static GenericProc make(java.lang.Object[] args)
public static GenericProc makeWithoutSorting(java.lang.Object... args)