Search in sources :

Example 1 with SendIR

use of com.googlecode.aviator.code.interpreter.ir.SendIR in project aviatorscript by killme2008.

the class InterpretCodeGenerator method onMethodInvoke.

@Override
public void onMethodInvoke(final Token<?> lookhead) {
    final MethodMetaData methodMetaData = this.methodMetaDataStack.pop();
    @SuppressWarnings("unchecked") final List<FunctionArgument> params = lookhead != null ? (List<FunctionArgument>) lookhead.getMeta(Constants.PARAMS_META, Collections.EMPTY_LIST) : Collections.<FunctionArgument>emptyList();
    if (this.instance.getOptionValue(Options.CAPTURE_FUNCTION_ARGS).bool) {
        int funcId = getNextFuncInvocationId();
        getFuncsArgs().put(funcId, Collections.unmodifiableList(params));
        methodMetaData.funcId = funcId;
    }
    emit(new SendIR(methodMetaData.methodName, methodMetaData.parameterCount, methodMetaData.token.getMeta(Constants.UNPACK_ARGS, false), methodMetaData.funcId, new SourceInfo(this.sourceFile, methodMetaData.token.getLineNo())));
}
Also used : SendIR(com.googlecode.aviator.code.interpreter.ir.SendIR) SourceInfo(com.googlecode.aviator.code.interpreter.ir.SourceInfo) MethodMetaData(com.googlecode.aviator.code.asm.ASMCodeGenerator.MethodMetaData) FunctionArgument(com.googlecode.aviator.runtime.FunctionArgument)

Aggregations

MethodMetaData (com.googlecode.aviator.code.asm.ASMCodeGenerator.MethodMetaData)1 SendIR (com.googlecode.aviator.code.interpreter.ir.SendIR)1 SourceInfo (com.googlecode.aviator.code.interpreter.ir.SourceInfo)1 FunctionArgument (com.googlecode.aviator.runtime.FunctionArgument)1