Exemple #1
0
 private static void popParams(CodeAttr code, LambdaExp lexp, int[] incValues, boolean toArray) {
   Variable vars = lexp.getVarScope().firstVar();
   Declaration decls = lexp.firstDecl();
   if (vars != null && vars.getName() == "this") vars = vars.nextVar();
   if (vars != null && vars.getName() == "$ctx") vars = vars.nextVar();
   if (vars != null && vars.getName() == "argsArray") {
     if (toArray) {
       popParams(code, 0, 1, null, decls, vars);
       return;
     }
     vars = vars.nextVar();
   }
   popParams(code, 0, lexp.min_args, incValues, decls, vars);
 }
Exemple #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);
     }
   }
 }