示例#1
0
 @Override
 @ExplodeLoop
 public Object executeGeneric(VirtualFrame frame) {
   Object[] argValues = new Object[args.length];
   for (int i = ARG_START_INDEX; i < args.length; i++) {
     argValues[i] = args[i].executeGeneric(frame);
   }
   LLVMFunction function = functionCallNode.executeFunction(frame);
   return chain.executeDispatch(frame, function, argValues);
 }
示例#2
0
 @Override
 public Object executeGeneric(VirtualFrame frame) {
   CompilerDirectives.transferToInterpreter();
   if (functionNode instanceof LLVMFunctionLiteralNode) {
     LLVMFunction function = functionNode.executeFunction(frame);
     CallTarget callTarget = context.getFunction(function);
     if (callTarget == null) {
       NativeFunctionHandle nativeHandle = context.getNativeHandle(function, args);
       if (nativeHandle == null) {
         throw new IllegalStateException("could not find function " + function.getName());
       }
       return replace(getResolvedNativeCall(function, nativeHandle, args)).executeGeneric(frame);
     } else {
       return replace(new LLVMResolvedDirectCallNode(callTarget, args)).executeGeneric(frame);
     }
   } else {
     LLVMFunctionCallChain rootNode = LLVMFunctionCallChainNodeGen.create(context, args);
     return replace(new LLVMFunctionCallChainStartNode(functionNode, rootNode, args))
         .executeGeneric(frame);
   }
 }