示例#1
0
 /** Only used for inline- and tail-calls. */
 private static void pushArgs(
     LambdaExp lexp, Expression[] args, int[] incValues, Compilation comp) {
   Declaration param = lexp.firstDecl();
   int args_length = args.length;
   for (int i = 0; i < args_length; ++i) {
     Expression arg = args[i];
     if (param.ignorable()) arg.compile(comp, Target.Ignore);
     else if (incValues != null
         && (incValues[i] = SetExp.canUseInc(arg, param)) != SetExp.BAD_SHORT) ;
     else arg.compileWithPosition(comp, StackTarget.getInstance(param.getType()));
     param = param.nextDecl();
   }
 }
示例#2
0
 // Recursive helper function.
 private static void popParams(
     CodeAttr code, int paramNo, int count, int[] incValues, Declaration decl, Variable vars) {
   if (count > 0) {
     count--;
     popParams(
         code,
         paramNo + 1,
         count,
         incValues,
         decl.nextDecl(),
         decl.getVariable() == null ? vars : vars.nextVar());
     if (!decl.ignorable()) {
       if (incValues != null && incValues[paramNo] != SetExp.BAD_SHORT)
         code.emitInc(vars, (short) incValues[paramNo]);
       else code.emitStore(vars);
     }
   }
 }