Changeset 11893


Ignore:
Timestamp:
05/18/09 18:02:39 (14 years ago)
Author:
ehuelsmann
Message:

As per Ville's request, upload the progress
with respect to the deletion of the execute methods.

Location:
branches/fewer-executes/abcl/src/org/armedbear/lisp
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/AbstractArray.java

    r11711 r11893  
    236236                StringOutputStream stream = new StringOutputStream();
    237237                thread.execute(Symbol.OUTPUT_OBJECT.getSymbolFunction(),
    238                                AREF(index), stream);
     238                               new LispObject[] { AREF(index), stream });
    239239                sb.append(stream.getString().getStringValue());
    240240            } else
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Autoload.java

    r11791 r11893  
    151151            return fileName;
    152152        return symbol.getName().toLowerCase();
    153     }
    154 
    155     @Override
    156     public LispObject execute() throws ConditionThrowable
    157     {
    158         load();
    159         return symbol.execute();
    160     }
    161 
    162     @Override
    163     public LispObject execute(LispObject arg) throws ConditionThrowable
    164     {
    165         load();
    166         return symbol.execute(arg);
    167     }
    168 
    169     @Override
    170     public LispObject execute(LispObject first, LispObject second)
    171         throws ConditionThrowable
    172     {
    173         load();
    174         return symbol.execute(first, second);
    175     }
    176 
    177     @Override
    178     public LispObject execute(LispObject first, LispObject second,
    179                               LispObject third)
    180         throws ConditionThrowable
    181     {
    182         load();
    183         return symbol.execute(first, second, third);
    184     }
    185 
    186     @Override
    187     public LispObject execute(LispObject first, LispObject second,
    188                               LispObject third, LispObject fourth)
    189         throws ConditionThrowable
    190     {
    191         load();
    192         return symbol.execute(first, second, third, fourth);
    193     }
    194 
    195     @Override
    196     public LispObject execute(LispObject first, LispObject second,
    197                               LispObject third, LispObject fourth,
    198                               LispObject fifth)
    199         throws ConditionThrowable
    200     {
    201         load();
    202         return symbol.execute(first, second, third, fourth, fifth);
    203     }
    204 
    205     @Override
    206     public LispObject execute(LispObject first, LispObject second,
    207                               LispObject third, LispObject fourth,
    208                               LispObject fifth, LispObject sixth)
    209         throws ConditionThrowable
    210     {
    211         load();
    212         return symbol.execute(first, second, third, fourth, fifth, sixth);
    213     }
    214 
    215     @Override
    216     public LispObject execute(LispObject first, LispObject second,
    217                               LispObject third, LispObject fourth,
    218                               LispObject fifth, LispObject sixth,
    219                               LispObject seventh)
    220         throws ConditionThrowable
    221     {
    222         load();
    223         return symbol.execute(first, second, third, fourth, fifth, sixth,
    224                               seventh);
    225     }
    226 
    227     @Override
    228     public LispObject execute(LispObject first, LispObject second,
    229                               LispObject third, LispObject fourth,
    230                               LispObject fifth, LispObject sixth,
    231                               LispObject seventh, LispObject eighth)
    232         throws ConditionThrowable
    233     {
    234         load();
    235         return symbol.execute(first, second, third, fourth, fifth, sixth,
    236                               seventh, eighth);
    237153    }
    238154
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Closure.java

    r11778 r11893  
    372372  }
    373373
    374   @Override
    375   public LispObject execute() throws ConditionThrowable
    376   {
    377     if (arity == 0)
    378       {
    379         return progn(executionBody, environment,
    380                      LispThread.currentThread());
    381       }
    382     else
    383       return execute(new LispObject[0]);
    384   }
    385    
    386374  private final LispObject bindParametersAndExecute(LispObject... objects)
    387375  throws ConditionThrowable
     
    428416  {
    429417    return execute(objects);
    430   }
    431 
    432   @Override
    433   public LispObject execute(LispObject arg) throws ConditionThrowable
    434   {
    435     if (minArgs == 1)
    436       {
    437         return bindParametersAndExecute(arg);
    438       }
    439     else
    440       {
    441         return invokeArrayExecute(arg);
    442       }
    443   }
    444 
    445   @Override
    446   public LispObject execute(LispObject first, LispObject second)
    447     throws ConditionThrowable
    448   {
    449     if (minArgs == 2)
    450       {
    451         return bindParametersAndExecute(first, second);
    452       }
    453     else
    454       {
    455         return invokeArrayExecute(first, second);
    456       }
    457   }
    458 
    459   @Override
    460   public LispObject execute(LispObject first, LispObject second,
    461                             LispObject third)
    462     throws ConditionThrowable
    463   {
    464     if (minArgs == 3)
    465       {
    466         return bindParametersAndExecute(first, second, third);
    467       }
    468     else
    469       {
    470         return invokeArrayExecute(first, second, third);
    471       }
    472   }
    473 
    474   @Override
    475   public LispObject execute(LispObject first, LispObject second,
    476                             LispObject third, LispObject fourth)
    477     throws ConditionThrowable
    478   {
    479     if (minArgs == 4)
    480       {
    481         return bindParametersAndExecute(first, second, third, fourth);
    482       }
    483     else
    484       {
    485         return invokeArrayExecute(first, second, third, fourth);
    486       }
    487   }
    488 
    489   @Override
    490   public LispObject execute(LispObject first, LispObject second,
    491                             LispObject third, LispObject fourth,
    492                             LispObject fifth)
    493     throws ConditionThrowable
    494   {
    495     if (minArgs == 5)
    496       {
    497         return bindParametersAndExecute(first, second, third, fourth,
    498                                         fifth);
    499       }
    500     else
    501       {
    502         return invokeArrayExecute(first, second, third, fourth, fifth);
    503       }
    504   }
    505 
    506   @Override
    507   public LispObject execute(LispObject first, LispObject second,
    508                             LispObject third, LispObject fourth,
    509                             LispObject fifth, LispObject sixth)
    510     throws ConditionThrowable
    511   {
    512     if (minArgs == 6)
    513       {
    514         return bindParametersAndExecute(first, second, third, fourth,
    515                                         fifth, sixth);
    516       }
    517     else
    518       {
    519         return invokeArrayExecute(first, second, third, fourth, fifth,
    520                                   sixth);
    521       }
    522   }
    523 
    524   @Override
    525   public LispObject execute(LispObject first, LispObject second,
    526                             LispObject third, LispObject fourth,
    527                             LispObject fifth, LispObject sixth,
    528                             LispObject seventh)
    529     throws ConditionThrowable
    530   {
    531     if (minArgs == 7)
    532       {
    533         return bindParametersAndExecute(first, second, third, fourth,
    534                                fifth, sixth, seventh);
    535       }
    536     else
    537       {
    538         return invokeArrayExecute(first, second, third, fourth, fifth,
    539                                   sixth, seventh);
    540       }
    541   }
    542 
    543   @Override
    544   public LispObject execute(LispObject first, LispObject second,
    545                             LispObject third, LispObject fourth,
    546                             LispObject fifth, LispObject sixth,
    547                             LispObject seventh, LispObject eighth)
    548     throws ConditionThrowable
    549   {
    550     if (minArgs == 8)
    551       {
    552         return bindParametersAndExecute(first, second, third, fourth,
    553                                fifth, sixth, seventh, eighth);
    554       }
    555     else
    556       {
    557         return invokeArrayExecute(first, second, third, fourth, fifth,
    558                                   sixth, seventh, eighth);
    559       }
    560418  }
    561419
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/CompiledFunction.java

    r11488 r11893  
    6161
    6262    @Override
    63     public LispObject execute() throws ConditionThrowable
    64     {
    65         LispObject[] args = new LispObject[0];
    66         return execute(args);
    67     }
    68 
    69     @Override
    70     public LispObject execute(LispObject arg) throws ConditionThrowable
    71     {
    72         LispObject[] args = new LispObject[1];
    73         args[0] = arg;
    74         return execute(args);
    75     }
    76 
    77     @Override
    78     public LispObject execute(LispObject first, LispObject second)
    79         throws ConditionThrowable
    80     {
    81         LispObject[] args = new LispObject[2];
    82         args[0] = first;
    83         args[1] = second;
    84         return execute(args);
    85     }
    86 
    87     @Override
    88     public LispObject execute(LispObject first, LispObject second,
    89                               LispObject third)
    90         throws ConditionThrowable
    91     {
    92         LispObject[] args = new LispObject[3];
    93         args[0] = first;
    94         args[1] = second;
    95         args[2] = third;
    96         return execute(args);
    97     }
    98 
    99     @Override
    100     public LispObject execute(LispObject first, LispObject second,
    101                               LispObject third, LispObject fourth)
    102         throws ConditionThrowable
    103     {
    104         LispObject[] args = new LispObject[4];
    105         args[0] = first;
    106         args[1] = second;
    107         args[2] = third;
    108         args[3] = fourth;
    109         return execute(args);
    110     }
    111 
    112     @Override
    113     public LispObject execute(LispObject first, LispObject second,
    114                               LispObject third, LispObject fourth,
    115                               LispObject fifth)
    116         throws ConditionThrowable
    117     {
    118         LispObject[] args = new LispObject[5];
    119         args[0] = first;
    120         args[1] = second;
    121         args[2] = third;
    122         args[3] = fourth;
    123         args[4] = fifth;
    124         return execute(args);
    125     }
    126 
    127     @Override
    128     public LispObject execute(LispObject first, LispObject second,
    129                               LispObject third, LispObject fourth,
    130                               LispObject fifth, LispObject sixth)
    131         throws ConditionThrowable
    132     {
    133         LispObject[] args = new LispObject[6];
    134         args[0] = first;
    135         args[1] = second;
    136         args[2] = third;
    137         args[3] = fourth;
    138         args[4] = fifth;
    139         args[5] = sixth;
    140         return execute(args);
    141     }
    142 
    143     @Override
    144     public LispObject execute(LispObject first, LispObject second,
    145                               LispObject third, LispObject fourth,
    146                               LispObject fifth, LispObject sixth,
    147                               LispObject seventh)
    148         throws ConditionThrowable
    149     {
    150         LispObject[] args = new LispObject[7];
    151         args[0] = first;
    152         args[1] = second;
    153         args[2] = third;
    154         args[3] = fourth;
    155         args[4] = fifth;
    156         args[5] = sixth;
    157         args[6] = seventh;
    158         return execute(args);
    159     }
    160 
    161     @Override
    162     public LispObject execute(LispObject first, LispObject second,
    163                               LispObject third, LispObject fourth,
    164                               LispObject fifth, LispObject sixth,
    165                               LispObject seventh, LispObject eighth)
    166         throws ConditionThrowable
    167     {
    168         LispObject[] args = new LispObject[8];
    169         args[0] = first;
    170         args[1] = second;
    171         args[2] = third;
    172         args[3] = fourth;
    173         args[4] = fifth;
    174         args[5] = sixth;
    175         args[6] = seventh;
    176         args[7] = eighth;
    177         return execute(args);
    178     }
    179 
    180     @Override
    18163    public LispObject execute(LispObject[] args) throws ConditionThrowable
    18264    {
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Condition.java

    r11488 r11893  
    198198          {
    199199            StringOutputStream stream = new StringOutputStream();
    200             Symbol.APPLY.execute(formatControl, stream, getFormatArguments());
     200            Symbol.APPLY.execute(new LispObject[] { formatControl, stream, getFormatArguments() });
    201201            return stream.getString().getStringValue();
    202202          }
     
    206206            if (f == null || f instanceof Autoload)
    207207              return format(formatControl, getFormatArguments());
    208             return Symbol.APPLY.execute(f, NIL, formatControl, getFormatArguments()).getStringValue();
     208            return Symbol.APPLY.execute(new LispObject[] { f, NIL, formatControl, getFormatArguments() }).getStringValue();
    209209          }
    210210      }
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Cons.java

    r11754 r11893  
    468468      }
    469469    return array;
    470   }
    471 
    472   @Override
    473   public LispObject execute() throws ConditionThrowable
    474   {
    475     if (car == Symbol.LAMBDA)
    476       {
    477         Closure closure = new Closure(this, new Environment());
    478         return closure.execute();
    479       }
    480     return signalExecutionError();
    481   }
    482 
    483   @Override
    484   public LispObject execute(LispObject arg) throws ConditionThrowable
    485   {
    486     if (car == Symbol.LAMBDA)
    487       {
    488         Closure closure = new Closure(this, new Environment());
    489         return closure.execute(arg);
    490       }
    491     return signalExecutionError();
    492   }
    493 
    494   @Override
    495   public LispObject execute(LispObject first, LispObject second)
    496     throws ConditionThrowable
    497   {
    498     if (car == Symbol.LAMBDA)
    499       {
    500         Closure closure = new Closure(this, new Environment());
    501         return closure.execute(first, second);
    502       }
    503     return signalExecutionError();
    504   }
    505 
    506   @Override
    507   public LispObject execute(LispObject first, LispObject second,
    508                             LispObject third)
    509     throws ConditionThrowable
    510   {
    511     if (car == Symbol.LAMBDA)
    512       {
    513         Closure closure = new Closure(this, new Environment());
    514         return closure.execute(first, second, third);
    515       }
    516     return signalExecutionError();
    517   }
    518 
    519   @Override
    520   public LispObject execute(LispObject first, LispObject second,
    521                             LispObject third, LispObject fourth)
    522     throws ConditionThrowable
    523   {
    524     if (car == Symbol.LAMBDA)
    525       {
    526         Closure closure = new Closure(this, new Environment());
    527         return closure.execute(first, second, third, fourth);
    528       }
    529     return signalExecutionError();
    530   }
    531 
    532   @Override
    533   public LispObject execute(LispObject first, LispObject second,
    534                             LispObject third, LispObject fourth,
    535                             LispObject fifth)
    536     throws ConditionThrowable
    537   {
    538     if (car == Symbol.LAMBDA)
    539       {
    540         Closure closure = new Closure(this, new Environment());
    541         return closure.execute(first, second, third, fourth, fifth);
    542       }
    543     return signalExecutionError();
    544   }
    545 
    546   @Override
    547   public LispObject execute(LispObject first, LispObject second,
    548                             LispObject third, LispObject fourth,
    549                             LispObject fifth, LispObject sixth)
    550     throws ConditionThrowable
    551   {
    552     if (car == Symbol.LAMBDA)
    553       {
    554         Closure closure = new Closure(this, new Environment());
    555         return closure.execute(first, second, third, fourth, fifth, sixth);
    556       }
    557     return signalExecutionError();
    558   }
    559 
    560   @Override
    561   public LispObject execute(LispObject first, LispObject second,
    562                             LispObject third, LispObject fourth,
    563                             LispObject fifth, LispObject sixth,
    564                             LispObject seventh)
    565     throws ConditionThrowable
    566   {
    567     if (car == Symbol.LAMBDA)
    568       {
    569         Closure closure = new Closure(this, new Environment());
    570         return closure.execute(first, second, third, fourth, fifth, sixth,
    571                                seventh);
    572       }
    573     return signalExecutionError();
    574   }
    575 
    576   @Override
    577   public LispObject execute(LispObject first, LispObject second,
    578                             LispObject third, LispObject fourth,
    579                             LispObject fifth, LispObject sixth,
    580                             LispObject seventh, LispObject eighth)
    581     throws ConditionThrowable
    582   {
    583     if (car == Symbol.LAMBDA)
    584       {
    585         Closure closure = new Closure(this, new Environment());
    586         return closure.execute(first, second, third, fourth, fifth, sixth,
    587                                seventh, eighth);
    588       }
    589     return signalExecutionError();
    590470  }
    591471
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/DispatchMacroFunction.java

    r11488 r11893  
    6363
    6464    @Override
    65     public LispObject execute(LispObject first, LispObject second,
    66                               LispObject third)
     65    public LispObject execute(LispObject[] args)
    6766        throws ConditionThrowable
    6867    {
    69         Stream stream = inSynonymOf(first);
    70         char c = LispCharacter.getValue(second);
     68        if (args.length != 3)
     69            return error(new WrongNumberOfArgumentsException(this));
     70       
     71        Stream stream = inSynonymOf(args[0]);
     72        char c = LispCharacter.getValue(args[1]);
    7173        int n;
    72         if (third == NIL)
     74        if (args[2] == NIL)
    7375            n = -1;
    7476        else
    75             n = Fixnum.getValue(third);
     77            n = Fixnum.getValue(args[2]);
    7678        return execute(stream, c, n);
    7779    }
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Function.java

    r11698 r11893  
    181181        propertyList = putf(propertyList, Symbol.CLASS_BYTES,
    182182                            new JavaObject(bytes));
    183     }
    184 
    185     @Override
    186     public LispObject execute() throws ConditionThrowable
    187     {
    188         return error(new WrongNumberOfArgumentsException(this));
    189     }
    190 
    191     @Override
    192     public LispObject execute(LispObject arg) throws ConditionThrowable
    193     {
    194         return error(new WrongNumberOfArgumentsException(this));
    195     }
    196 
    197     @Override
    198     public LispObject execute(LispObject first, LispObject second)
    199         throws ConditionThrowable
    200     {
    201         return error(new WrongNumberOfArgumentsException(this));
    202     }
    203 
    204     @Override
    205     public LispObject execute(LispObject first, LispObject second,
    206                               LispObject third)
    207         throws ConditionThrowable
    208     {
    209         return error(new WrongNumberOfArgumentsException(this));
    210     }
    211 
    212     @Override
    213     public LispObject execute(LispObject first, LispObject second,
    214                               LispObject third, LispObject fourth)
    215         throws ConditionThrowable
    216     {
    217         return error(new WrongNumberOfArgumentsException(this));
    218     }
    219 
    220     @Override
    221     public LispObject execute(LispObject first, LispObject second,
    222                               LispObject third, LispObject fourth,
    223                               LispObject fifth)
    224         throws ConditionThrowable
    225     {
    226         return error(new WrongNumberOfArgumentsException(this));
    227     }
    228 
    229     @Override
    230     public LispObject execute(LispObject first, LispObject second,
    231                               LispObject third, LispObject fourth,
    232                               LispObject fifth, LispObject sixth)
    233         throws ConditionThrowable
    234     {
    235         return error(new WrongNumberOfArgumentsException(this));
    236     }
    237 
    238     @Override
    239     public LispObject execute(LispObject first, LispObject second,
    240                               LispObject third, LispObject fourth,
    241                               LispObject fifth, LispObject sixth,
    242                               LispObject seventh)
    243         throws ConditionThrowable
    244     {
    245         return error(new WrongNumberOfArgumentsException(this));
    246     }
    247 
    248     @Override
    249     public LispObject execute(LispObject first, LispObject second,
    250                               LispObject third, LispObject fourth,
    251                               LispObject fifth, LispObject sixth,
    252                               LispObject seventh, LispObject eighth)
    253         throws ConditionThrowable
    254     {
    255         return error(new WrongNumberOfArgumentsException(this));
    256183    }
    257184
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/HashTable.java

    r11711 r11893  
    280280        while (e != null)
    281281          {
    282             function.execute(e.key, e.value);
     282            function.execute(new LispObject[] { e.key, e.value });
    283283            e = e.next;
    284284          }
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Interpreter.java

    r11745 r11893  
    336336            LispObject tplFun = TOP_LEVEL_LOOP.getSymbolFunction();
    337337            if (tplFun instanceof Function) {
    338                 thread.execute(tplFun);
     338                thread.execute(new LispObject[] { tplFun });
    339339                return;
    340340            }
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/JProxy.java

    r11859 r11893  
    188188      Object retVal =
    189189    LispThread.currentThread().execute
    190     (Symbol.APPLY, function, lispArgs.reverse()).javaInstance();
     190    (Symbol.APPLY, new LispObject[] { function, lispArgs.reverse() }).javaInstance();
    191191      //(function.execute(lispArgs)).javaInstance();
    192192      /* DOES NOT WORK due to autoboxing!
     
    201201      new Primitive("%jmake-invocation-handler", PACKAGE_JAVA, false,
    202202                    "function") {
    203    
     203            @Override
    204204          public LispObject execute(LispObject[] args) throws ConditionThrowable {
    205205            int length = args.length;
     
    217217      new Primitive("%jmake-proxy", PACKAGE_JAVA, false,
    218218                    "interface invocation-handler") {
    219    
     219            @Override
    220220          public LispObject execute(final LispObject[] args) throws ConditionThrowable {
    221221            int length = args.length;
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Java.java

    r11834 r11893  
    400400            else
    401401                Symbol.SIGNAL.execute(
    402                     condition,
    403                     Keyword.CAUSE,
    404                     JavaObject.getInstance(t),
    405                     Keyword.FORMAT_CONTROL,
    406                     new SimpleString(getMessage(t)));
     402                        new LispObject[] {
     403                                condition,
     404                                Keyword.CAUSE,
     405                                JavaObject.getInstance(t),
     406                                Keyword.FORMAT_CONTROL,
     407                                new SimpleString(getMessage(t)) });
    407408        }
    408409        // Not reached.
     
    465466                else
    466467                    Symbol.SIGNAL.execute(
    467                         condition,
    468                         Keyword.CAUSE,
    469                         JavaObject.getInstance(t),
    470                         Keyword.FORMAT_CONTROL,
    471                         new SimpleString(getMessage(t)));
     468                        new LispObject[] {
     469                                condition,
     470                                Keyword.CAUSE,
     471                                JavaObject.getInstance(t),
     472                                Keyword.FORMAT_CONTROL,
     473                                new SimpleString(getMessage(t)) });
    472474            }
    473475            // Not reached.
     
    519521            else
    520522                Symbol.SIGNAL.execute(
    521                     condition,
    522                     Keyword.CAUSE,
    523                     JavaObject.getInstance(t),
    524                     Keyword.FORMAT_CONTROL,
    525                     new SimpleString(getMessage(t)));
     523                        new LispObject[] {
     524                                condition,
     525                                Keyword.CAUSE,
     526                                JavaObject.getInstance(t),
     527                                Keyword.FORMAT_CONTROL,
     528                                new SimpleString(getMessage(t)) });
    526529        }
    527530        // Not reached.
     
    577580                else
    578581                    Symbol.SIGNAL.execute(
    579                         condition,
    580                         Keyword.CAUSE,
    581                         JavaObject.getInstance(t),
    582                         Keyword.FORMAT_CONTROL,
    583                         new SimpleString(getMessage(t)));
     582                        new LispObject[] {
     583                                condition,
     584                                Keyword.CAUSE,
     585                                JavaObject.getInstance(t),
     586                                Keyword.FORMAT_CONTROL,
     587                                new SimpleString(getMessage(t)) });
    584588            }
    585589            // Not reached.
     
    659663            else
    660664                Symbol.SIGNAL.execute(
    661                     condition,
    662                     Keyword.CAUSE,
    663                     JavaObject.getInstance(t),
    664                     Keyword.FORMAT_CONTROL,
    665                     new SimpleString(getMessage(t)));
     665                        new LispObject[] {
     666                                condition,
     667                                Keyword.CAUSE,
     668                                JavaObject.getInstance(t),
     669                                Keyword.FORMAT_CONTROL,
     670                                new SimpleString(getMessage(t)) });
    666671        }
    667672        // Not reached.
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/JavaException.java

    r11488 r11893  
    9494        public LispObject execute(LispObject arg) throws ConditionThrowable
    9595        {
    96             return Symbol.STD_SLOT_VALUE.execute(arg, Symbol.CAUSE);
     96            return Symbol.STD_SLOT_VALUE.execute(new LispObject[] { arg, Symbol.CAUSE });
    9797        }
    9898    };
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Lisp.java

    r11883 r11893  
    141141    try
    142142      {
    143         switch (args.length)
    144           {
    145           case 0:
    146             result = fun.execute();
    147             break;
    148           case 1:
    149             result = fun.execute(args[0]);
    150             break;
    151           case 2:
    152             result = fun.execute(args[0], args[1]);
    153             break;
    154           case 3:
    155             result = fun.execute(args[0], args[1], args[2]);
    156             break;
    157           case 4:
    158             result = fun.execute(args[0], args[1], args[2], args[3]);
    159             break;
    160           case 5:
    161             result = fun.execute(args[0], args[1], args[2], args[3],
    162                                  args[4]);
    163             break;
    164           case 6:
    165             result = fun.execute(args[0], args[1], args[2], args[3],
    166                                  args[4], args[5]);
    167             break;
    168           case 7:
    169             result = fun.execute(args[0], args[1], args[2], args[3],
    170                                  args[4], args[5], args[6]);
    171             break;
    172           case 8:
    173             result = fun.execute(args[0], args[1], args[2], args[3],
    174                                  args[4], args[5], args[6], args[7]);
    175             break;
    176           default:
    177             result = fun.execute(args);
    178             break;
    179           }
     143        return fun.execute(args);
    180144      }
    181145    finally
     
    183147        thread.setStack(stack);
    184148      }
    185     return result;
    186149  }
    187150
     
    240203                LispObject hook =
    241204                  coerceToFunction(Symbol.MACROEXPAND_HOOK.symbolValue(thread));
    242                 return thread.setValues(hook.execute(expander, form, env),
     205                return thread.setValues(hook.execute(new LispObject[] {expander, form, env} ),
    243206                                        T);
    244207              }
     
    274237        try
    275238          {
    276             result = thread.execute(Symbol.EVAL.getSymbolFunction(), object);
     239            result = thread.execute(Symbol.EVAL.getSymbolFunction(),
     240                        new LispObject[] { object });
    277241          }
    278242        catch (OutOfMemoryError e)
     
    335299    throws ConditionThrowable
    336300  {
    337     return Symbol.ERROR.execute(condition);
     301    return Symbol.ERROR.execute(new LispObject[] { condition });
    338302  }
    339303
     
    341305    throws ConditionThrowable
    342306  {
    343     return Symbol.ERROR.execute(condition, Keyword.FORMAT_CONTROL, message);
     307    return Symbol.ERROR.execute(new LispObject[] { condition, Keyword.FORMAT_CONTROL, message });
    344308  }
    345309
     
    361325  {
    362326    setInterrupted(false);
    363     Symbol.BREAK.getSymbolFunction().execute();
     327    Symbol.BREAK.getSymbolFunction().execute(new LispObject[0]);
    364328    setInterrupted(false);
    365329  }
     
    466430    throws ConditionThrowable
    467431  {
    468     if (args == NIL)
    469       return thread.execute(function);
    470     LispObject first = eval(args.car(), env, thread);
    471     args = ((Cons)args).cdr;
    472     if (args == NIL)
    473       {
    474         thread._values = null;
    475         return thread.execute(function, first);
    476       }
    477     LispObject second = eval(args.car(), env, thread);
    478     args = ((Cons)args).cdr;
    479     if (args == NIL)
    480       {
    481         thread._values = null;
    482         return thread.execute(function, first, second);
    483       }
    484     LispObject third = eval(args.car(), env, thread);
    485     args = ((Cons)args).cdr;
    486     if (args == NIL)
    487       {
    488         thread._values = null;
    489         return thread.execute(function, first, second, third);
    490       }
    491     LispObject fourth = eval(args.car(), env, thread);
    492     args = ((Cons)args).cdr;
    493     if (args == NIL)
    494       {
    495         thread._values = null;
    496         return thread.execute(function, first, second, third, fourth);
    497       }
    498     LispObject fifth = eval(args.car(), env, thread);
    499     args = ((Cons)args).cdr;
    500     if (args == NIL)
    501       {
    502         thread._values = null;
    503         return thread.execute(function, first, second, third, fourth, fifth);
    504       }
    505     LispObject sixth = eval(args.car(), env, thread);
    506     args = ((Cons)args).cdr;
    507     if (args == NIL)
    508       {
    509         thread._values = null;
    510         return thread.execute(function, first, second, third, fourth, fifth,
    511                               sixth);
    512       }
    513     LispObject seventh = eval(args.car(), env, thread);
    514     args = ((Cons)args).cdr;
    515     if (args == NIL)
    516       {
    517         thread._values = null;
    518         return thread.execute(function, first, second, third, fourth, fifth,
    519                               sixth, seventh);
    520       }
    521     LispObject eighth = eval(args.car(), env, thread);
    522     args = ((Cons)args).cdr;
    523     if (args == NIL)
    524       {
    525         thread._values = null;
    526         return thread.execute(function, first, second, third, fourth, fifth,
    527                               sixth, seventh, eighth);
    528       }
    529     // More than CALL_REGISTERS_MAX arguments.
    530     final int length = args.length() + CALL_REGISTERS_MAX;
     432    final int length = args.length();
    531433    LispObject[] array = new LispObject[length];
    532     array[0] = first;
    533     array[1] = second;
    534     array[2] = third;
    535     array[3] = fourth;
    536     array[4] = fifth;
    537     array[5] = sixth;
    538     array[6] = seventh;
    539     array[7] = eighth;
    540     for (int i = CALL_REGISTERS_MAX; i < length; i++)
     434    for (int i = 0; i < length; i++)
    541435      {
    542436        array[i] = eval(args.car(), env, thread);
     
    783677    thread._values = null;
    784678    if (values == null)
    785       return thread.execute(coerceToFunction(function), result);
     679      return thread.execute(coerceToFunction(function),
     680              new LispObject[] { result });
    786681    else
    787682      return funcall(coerceToFunction(function), values, thread);
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/LispObject.java

    r11834 r11893  
    647647  }
    648648
    649   public LispObject execute() throws ConditionThrowable
    650   {
    651     return type_error(this, Symbol.FUNCTION);
    652   }
    653 
    654   public LispObject execute(LispObject arg) throws ConditionThrowable
    655   {
    656     return type_error(this, Symbol.FUNCTION);
    657   }
    658 
    659   public LispObject execute(LispObject first, LispObject second)
    660     throws ConditionThrowable
    661   {
    662     return type_error(this, Symbol.FUNCTION);
    663   }
    664 
    665   public LispObject execute(LispObject first, LispObject second,
    666                             LispObject third)
    667     throws ConditionThrowable
    668   {
    669     return type_error(this, Symbol.FUNCTION);
    670   }
    671 
    672   public LispObject execute(LispObject first, LispObject second,
    673                             LispObject third, LispObject fourth)
    674     throws ConditionThrowable
    675   {
    676     return type_error(this, Symbol.FUNCTION);
    677   }
    678 
    679   public LispObject execute(LispObject first, LispObject second,
    680                             LispObject third, LispObject fourth,
    681                             LispObject fifth)
    682     throws ConditionThrowable
    683   {
    684     return type_error(this, Symbol.FUNCTION);
    685   }
    686 
    687   public LispObject execute(LispObject first, LispObject second,
    688                             LispObject third, LispObject fourth,
    689                             LispObject fifth, LispObject sixth)
    690     throws ConditionThrowable
    691   {
    692     return type_error(this, Symbol.FUNCTION);
    693   }
    694 
    695   public LispObject execute(LispObject first, LispObject second,
    696                             LispObject third, LispObject fourth,
    697                             LispObject fifth, LispObject sixth,
    698                             LispObject seventh)
    699     throws ConditionThrowable
    700   {
    701     return type_error(this, Symbol.FUNCTION);
    702   }
    703 
    704   public LispObject execute(LispObject first, LispObject second,
    705                             LispObject third, LispObject fourth,
    706                             LispObject fifth, LispObject sixth,
    707                             LispObject seventh, LispObject eighth)
    708     throws ConditionThrowable
    709   {
    710     return type_error(this, Symbol.FUNCTION);
    711   }
    712 
    713649  public LispObject execute(LispObject[] args) throws ConditionThrowable
    714650  {
     
    719655  public LispObject dispatch(LispObject[] args) throws ConditionThrowable
    720656  {
    721     switch (args.length)
    722       {
    723       case 0:
    724         return execute();
    725       case 1:
    726         return execute(args[0]);
    727       case 2:
    728         return execute(args[0], args[1]);
    729       case 3:
    730         return execute(args[0], args[1], args[2]);
    731       case 4:
    732         return execute(args[0], args[1], args[2], args[3]);
    733       case 5:
    734         return execute(args[0], args[1], args[2], args[3], args[4]);
    735       case 6:
    736         return execute(args[0], args[1], args[2], args[3], args[4],
    737                        args[5]);
    738       case 7:
    739         return execute(args[0], args[1], args[2], args[3], args[4],
    740                        args[5], args[6]);
    741       case 8:
    742         return execute(args[0], args[1], args[2], args[3], args[4],
    743                        args[5], args[6], args[7]);
    744       default:
    745         return type_error(this, Symbol.FUNCTION);
    746       }
     657    return type_error(this, Symbol.FUNCTION);
    747658  }
    748659
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/LispThread.java

    r11754 r11893  
    586586    }
    587587
    588     @Override
    589     public LispObject execute(LispObject function) throws ConditionThrowable
    590     {
    591         if (use_fast_calls)
    592             return function.execute();
    593 
    594         LispObject oldStack = stack;
    595         pushStackFrame(function);
    596         try {
    597             return function.execute();
    598         }
    599         finally {
    600             if (profiling && sampling) {
    601                 if (sampleNow)
    602                     Profiler.sample(this);
    603             }
    604             stack = oldStack;
    605         }
    606     }
    607 
    608     @Override
    609     public LispObject execute(LispObject function, LispObject arg)
    610         throws ConditionThrowable
    611     {
    612         if (use_fast_calls)
    613             return function.execute(arg);
    614 
    615         LispObject oldStack = stack;
    616         pushStackFrame(function, arg);
    617         try {
    618             return function.execute(arg);
    619         }
    620         finally {
    621             if (profiling && sampling) {
    622                 if (sampleNow)
    623                     Profiler.sample(this);
    624             }
    625             stack = oldStack;
    626         }
    627     }
    628 
    629     @Override
    630     public LispObject execute(LispObject function, LispObject first,
    631                               LispObject second)
    632         throws ConditionThrowable
    633     {
    634         if (use_fast_calls)
    635             return function.execute(first, second);
    636 
    637         LispObject oldStack = stack;
    638         pushStackFrame(function, first, second);
    639         try {
    640             return function.execute(first, second);
    641         }
    642         finally {
    643             if (profiling && sampling) {
    644                 if (sampleNow)
    645                     Profiler.sample(this);
    646             }
    647             stack = oldStack;
    648         }
    649     }
    650 
    651     @Override
    652     public LispObject execute(LispObject function, LispObject first,
    653                               LispObject second, LispObject third)
    654         throws ConditionThrowable
    655     {
    656         if (use_fast_calls)
    657             return function.execute(first, second, third);
    658 
    659         LispObject oldStack = stack;
    660         pushStackFrame(function, first, second, third);
    661         try {
    662             return function.execute(first, second, third);
    663         }
    664         finally {
    665             if (profiling && sampling) {
    666                 if (sampleNow)
    667                     Profiler.sample(this);
    668             }
    669             stack = oldStack;
    670         }
    671     }
    672 
    673     @Override
    674     public LispObject execute(LispObject function, LispObject first,
    675                               LispObject second, LispObject third,
    676                               LispObject fourth)
    677         throws ConditionThrowable
    678     {
    679         if (use_fast_calls)
    680             return function.execute(first, second, third, fourth);
    681 
    682         LispObject oldStack = stack;
    683         LispObject[] args = new LispObject[4];
    684         args[0] = first;
    685         args[1] = second;
    686         args[2] = third;
    687         args[3] = fourth;
    688         pushStackFrame(function, args);
    689         try {
    690             return function.execute(first, second, third, fourth);
    691         }
    692         finally {
    693             if (profiling && sampling) {
    694                 if (sampleNow)
    695                     Profiler.sample(this);
    696             }
    697             stack = oldStack;
    698         }
    699     }
    700 
    701     @Override
    702     public LispObject execute(LispObject function, LispObject first,
    703                               LispObject second, LispObject third,
    704                               LispObject fourth, LispObject fifth)
    705         throws ConditionThrowable
    706     {
    707         if (use_fast_calls)
    708             return function.execute(first, second, third, fourth, fifth);
    709 
    710         LispObject oldStack = stack;
    711         LispObject[] args = new LispObject[5];
    712         args[0] = first;
    713         args[1] = second;
    714         args[2] = third;
    715         args[3] = fourth;
    716         args[4] = fifth;
    717         pushStackFrame(function, args);
    718         try {
    719             return function.execute(first, second, third, fourth, fifth);
    720         }
    721         finally {
    722             if (profiling && sampling) {
    723                 if (sampleNow)
    724                     Profiler.sample(this);
    725             }
    726             stack = oldStack;
    727         }
    728     }
    729 
    730     @Override
    731     public LispObject execute(LispObject function, LispObject first,
    732                               LispObject second, LispObject third,
    733                               LispObject fourth, LispObject fifth,
    734                               LispObject sixth)
    735         throws ConditionThrowable
    736     {
    737         if (use_fast_calls)
    738             return function.execute(first, second, third, fourth, fifth, sixth);
    739 
    740         LispObject oldStack = stack;
    741         LispObject[] args = new LispObject[6];
    742         args[0] = first;
    743         args[1] = second;
    744         args[2] = third;
    745         args[3] = fourth;
    746         args[4] = fifth;
    747         args[5] = sixth;
    748         pushStackFrame(function, args);
    749         try {
    750             return function.execute(first, second, third, fourth, fifth, sixth);
    751         }
    752         finally {
    753             if (profiling && sampling) {
    754                 if (sampleNow)
    755                     Profiler.sample(this);
    756             }
    757             stack = oldStack;
    758         }
    759     }
    760 
    761     @Override
    762     public LispObject execute(LispObject function, LispObject first,
    763                               LispObject second, LispObject third,
    764                               LispObject fourth, LispObject fifth,
    765                               LispObject sixth, LispObject seventh)
    766         throws ConditionThrowable
    767     {
    768         if (use_fast_calls)
    769             return function.execute(first, second, third, fourth, fifth, sixth,
    770                                     seventh);
    771 
    772         LispObject oldStack = stack;
    773         LispObject[] args = new LispObject[7];
    774         args[0] = first;
    775         args[1] = second;
    776         args[2] = third;
    777         args[3] = fourth;
    778         args[4] = fifth;
    779         args[5] = sixth;
    780         args[6] = seventh;
    781         pushStackFrame(function, args);
    782         try {
    783             return function.execute(first, second, third, fourth, fifth, sixth,
    784                                     seventh);
    785         }
    786         finally {
    787             if (profiling && sampling) {
    788                 if (sampleNow)
    789                     Profiler.sample(this);
    790             }
    791             stack = oldStack;
    792         }
    793     }
    794 
    795     public LispObject execute(LispObject function, LispObject first,
    796                               LispObject second, LispObject third,
    797                               LispObject fourth, LispObject fifth,
    798                               LispObject sixth, LispObject seventh,
    799                               LispObject eighth)
    800         throws ConditionThrowable
    801     {
    802         if (use_fast_calls)
    803             return function.execute(first, second, third, fourth, fifth, sixth,
    804                                     seventh, eighth);
    805 
    806         LispObject oldStack = stack;
    807         LispObject[] args = new LispObject[8];
    808         args[0] = first;
    809         args[1] = second;
    810         args[2] = third;
    811         args[3] = fourth;
    812         args[4] = fifth;
    813         args[5] = sixth;
    814         args[6] = seventh;
    815         args[7] = eighth;
    816         pushStackFrame(function, args);
    817         try {
    818             return function.execute(first, second, third, fourth, fifth, sixth,
    819                                     seventh, eighth);
    820         }
    821         finally {
    822             if (profiling && sampling) {
    823                 if (sampleNow)
    824                     Profiler.sample(this);
    825             }
    826             stack = oldStack;
    827         }
    828     }
    829 
    830588    public LispObject execute(LispObject function, LispObject[] args)
    831589        throws ConditionThrowable
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/LogicalPathname.java

    r11754 r11893  
    100100                    version = Keyword.NEWEST;
    101101                else
    102                     version = PACKAGE_CL.intern("PARSE-INTEGER").execute(new SimpleString(v));
     102                    version = PACKAGE_CL.intern("PARSE-INTEGER")
     103                            .execute(new LispObject[] { new SimpleString(v) });
    103104            } else {
    104105                String t = rest;
     
    140141        throws ConditionThrowable
    141142    {
    142         return (Pathname) Symbol.TRANSLATE_LOGICAL_PATHNAME.execute(pathname);
     143        return (Pathname) Symbol.TRANSLATE_LOGICAL_PATHNAME
     144                .execute(new LispObject[] { pathname });
    143145    }
    144146
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/MacroObject.java

    r11711 r11893  
    4949
    5050  @Override
    51   public LispObject execute() throws ConditionThrowable
    52   {
    53     return error(new UndefinedFunction(name));
    54   }
    55 
    56   @Override
    57   public LispObject execute(LispObject arg) throws ConditionThrowable
    58   {
    59     return error(new UndefinedFunction(name));
    60   }
    61 
    62   @Override
    63   public LispObject execute(LispObject first, LispObject second)
    64     throws ConditionThrowable
    65   {
    66     return error(new UndefinedFunction(name));
    67   }
    68 
    69   @Override
    70   public LispObject execute(LispObject first, LispObject second,
    71                             LispObject third)
    72     throws ConditionThrowable
    73   {
    74     return error(new UndefinedFunction(name));
    75   }
    76 
    77   @Override
    78   public LispObject execute(LispObject first, LispObject second,
    79                             LispObject third, LispObject fourth)
    80     throws ConditionThrowable
    81   {
    82     return error(new UndefinedFunction(name));
    83   }
    84 
    85   @Override
    86   public LispObject execute(LispObject first, LispObject second,
    87                             LispObject third, LispObject fourth,
    88                             LispObject fifth)
    89     throws ConditionThrowable
    90   {
    91     return error(new UndefinedFunction(name));
    92   }
    93 
    94   @Override
    95   public LispObject execute(LispObject first, LispObject second,
    96                             LispObject third, LispObject fourth,
    97                             LispObject fifth, LispObject sixth)
    98     throws ConditionThrowable
    99   {
    100     return error(new UndefinedFunction(name));
    101   }
    102 
    103   @Override
    104   public LispObject execute(LispObject first, LispObject second,
    105                             LispObject third, LispObject fourth,
    106                             LispObject fifth, LispObject sixth,
    107                             LispObject seventh)
    108     throws ConditionThrowable
    109   {
    110     return error(new UndefinedFunction(name));
    111   }
    112 
    113   @Override
    114   public LispObject execute(LispObject first, LispObject second,
    115                             LispObject third, LispObject fourth,
    116                             LispObject fifth, LispObject sixth,
    117                             LispObject seventh, LispObject eighth)
    118     throws ConditionThrowable
    119   {
    120     return error(new UndefinedFunction(name));
    121   }
    122 
    123   @Override
    12451  public LispObject execute(LispObject[] args) throws ConditionThrowable
    12552  {
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Primitive.java

    r11488 r11893  
    9494    }
    9595
    96     @Override
    9796    public LispObject execute() throws ConditionThrowable
    9897    {
    99         LispObject[] args = new LispObject[0];
    100         return execute(args);
     98        return error(new WrongNumberOfArgumentsException(this));
    10199    }
    102100
    103     @Override
    104101    public LispObject execute(LispObject arg) throws ConditionThrowable
    105102    {
    106         LispObject[] args = new LispObject[1];
    107         args[0] = arg;
    108         return execute(args);
     103        return error(new WrongNumberOfArgumentsException(this));
    109104    }
    110105
    111     @Override
    112106    public LispObject execute(LispObject first, LispObject second)
    113107        throws ConditionThrowable
    114108    {
    115         LispObject[] args = new LispObject[2];
    116         args[0] = first;
    117         args[1] = second;
    118         return execute(args);
     109        return error(new WrongNumberOfArgumentsException(this));
    119110    }
    120111
    121     @Override
    122112    public LispObject execute(LispObject first, LispObject second,
    123113                              LispObject third)
    124114        throws ConditionThrowable
    125115    {
    126         LispObject[] args = new LispObject[3];
    127         args[0] = first;
    128         args[1] = second;
    129         args[2] = third;
    130         return execute(args);
     116        return error(new WrongNumberOfArgumentsException(this));
    131117    }
    132118
    133     @Override
    134119    public LispObject execute(LispObject first, LispObject second,
    135120                              LispObject third, LispObject fourth)
    136121        throws ConditionThrowable
    137122    {
    138         LispObject[] args = new LispObject[4];
    139         args[0] = first;
    140         args[1] = second;
    141         args[2] = third;
    142         args[3] = fourth;
    143         return execute(args);
     123        return error(new WrongNumberOfArgumentsException(this));
    144124    }
    145125
    146     @Override
    147126    public LispObject execute(LispObject first, LispObject second,
    148127                              LispObject third, LispObject fourth,
     
    150129        throws ConditionThrowable
    151130    {
    152         LispObject[] args = new LispObject[5];
    153         args[0] = first;
    154         args[1] = second;
    155         args[2] = third;
    156         args[3] = fourth;
    157         args[4] = fifth;
    158         return execute(args);
     131        return error(new WrongNumberOfArgumentsException(this));
    159132    }
    160133
    161     @Override
    162134    public LispObject execute(LispObject first, LispObject second,
    163135                              LispObject third, LispObject fourth,
     
    165137        throws ConditionThrowable
    166138    {
    167         LispObject[] args = new LispObject[6];
    168         args[0] = first;
    169         args[1] = second;
    170         args[2] = third;
    171         args[3] = fourth;
    172         args[4] = fifth;
    173         args[5] = sixth;
    174         return execute(args);
     139        return error(new WrongNumberOfArgumentsException(this));
    175140    }
    176141
    177     @Override
    178142    public LispObject execute(LispObject first, LispObject second,
    179143                              LispObject third, LispObject fourth,
     
    182146        throws ConditionThrowable
    183147    {
    184         LispObject[] args = new LispObject[7];
    185         args[0] = first;
    186         args[1] = second;
    187         args[2] = third;
    188         args[3] = fourth;
    189         args[4] = fifth;
    190         args[5] = sixth;
    191         args[6] = seventh;
    192         return execute(args);
     148        return error(new WrongNumberOfArgumentsException(this));
    193149    }
    194150
    195     @Override
    196151    public LispObject execute(LispObject first, LispObject second,
    197152                              LispObject third, LispObject fourth,
     
    200155        throws ConditionThrowable
    201156    {
    202         LispObject[] args = new LispObject[8];
    203         args[0] = first;
    204         args[1] = second;
    205         args[2] = third;
    206         args[3] = fourth;
    207         args[4] = fifth;
    208         args[5] = sixth;
    209         args[6] = seventh;
    210         args[7] = eighth;
    211         return execute(args);
     157        return error(new WrongNumberOfArgumentsException(this));
    212158    }
     159
     160    @Override
     161    public LispObject execute(LispObject[] args) throws ConditionThrowable
     162    {
     163      switch (args.length)
     164        {
     165          case 0:
     166            return execute();
     167          case 1:
     168            return execute(args[0]);
     169          case 2:
     170            return execute(args[0], args[1]);
     171          case 3:
     172            return execute(args[0], args[1], args[2]);
     173          case 4:
     174            return execute(args[0], args[1], args[2], args[3]);
     175          case 5:
     176            return execute(args[0], args[1], args[2], args[3], args[4]);
     177          case 6:
     178            return execute(args[0], args[1], args[2], args[3], args[4],
     179                           args[5]);
     180          case 7:
     181            return execute(args[0], args[1], args[2], args[3], args[4],
     182                           args[5], args[6]);
     183          case 8:
     184            return execute(args[0], args[1], args[2], args[3], args[4],
     185                           args[5], args[6], args[7]);
     186          default:
     187            return error(new WrongNumberOfArgumentsException(this));
     188        }
     189    }
     190
    213191}
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Primitives.java

    r11883 r11893  
    4949      }
    5050      @Override
    51       public LispObject execute(LispObject arg) throws ConditionThrowable
    52       {
    53         if (arg.numberp())
    54           return arg;
    55         return type_error(arg, Symbol.NUMBER);
    56       }
    57       @Override
    58       public LispObject execute(LispObject first, LispObject second)
    59         throws ConditionThrowable
    60       {
    61         return first.multiplyBy(second);
    62       }
    63       @Override
    6451      public LispObject execute(LispObject[] args) throws ConditionThrowable
    6552      {
     
    7663    {
    7764      @Override
    78       public LispObject execute() throws ConditionThrowable
    79       {
    80         return error(new WrongNumberOfArgumentsException(this));
    81       }
    82       @Override
    83       public LispObject execute(LispObject arg) throws ConditionThrowable
    84       {
    85         return Fixnum.ONE.divideBy(arg);
    86       }
    87       @Override
    88       public LispObject execute(LispObject first, LispObject second)
    89         throws ConditionThrowable
    90       {
    91         return first.divideBy(second);
    92       }
    93       @Override
    9465      public LispObject execute(LispObject[] args) throws ConditionThrowable
    9566      {
     67        if (args.length == 0)
     68          return error(new WrongNumberOfArgumentsException(this));
     69
    9670        LispObject result = args[0];
    9771        for (int i = 1; i < args.length; i++)
     
    10680    {
    10781      @Override
    108       public LispObject execute() throws ConditionThrowable
    109       {
    110         return error(new WrongNumberOfArgumentsException(this));
    111       }
    112       @Override
    113       public LispObject execute(LispObject arg) throws ConditionThrowable
    114       {
    115         if (arg.realp())
    116           return arg;
    117         return type_error(arg, Symbol.REAL);
    118       }
    119       @Override
    120       public LispObject execute(LispObject first, LispObject second)
    121         throws ConditionThrowable
    122       {
    123         return first.isLessThan(second) ? first : second;
    124       }
    125       @Override
    12682      public LispObject execute(LispObject[] args) throws ConditionThrowable
    12783      {
     84        if (args.length == 0)
     85          return error(new WrongNumberOfArgumentsException(this));
    12886        LispObject result = args[0];
    12987        if (!result.realp())
     
    143101    {
    144102      @Override
    145       public LispObject execute() throws ConditionThrowable
    146       {
    147         return error(new WrongNumberOfArgumentsException(this));
    148       }
    149       @Override
    150       public LispObject execute(LispObject arg) throws ConditionThrowable
    151       {
    152         if (arg.realp())
    153           return arg;
    154         return type_error(arg, Symbol.REAL);
    155       }
    156       @Override
    157       public LispObject execute(LispObject first, LispObject second)
    158         throws ConditionThrowable
    159       {
    160         return first.isGreaterThan(second) ? first : second;
    161       }
    162       @Override
    163103      public LispObject execute(LispObject[] args) throws ConditionThrowable
    164104      {
     105        if (args.length == 0)
     106          return error(new WrongNumberOfArgumentsException(this));
    165107        LispObject result = args[0];
    166108        if (!result.realp())
     
    355297    new Primitive(Symbol.VALUES, "&rest object")
    356298    {
    357       @Override
    358       public LispObject execute()
    359       {
    360         return LispThread.currentThread().setValues();
    361       }
    362       @Override
    363       public LispObject execute(LispObject arg)
    364       {
    365         return LispThread.currentThread().setValues(arg);
    366       }
    367       @Override
    368       public LispObject execute(LispObject first, LispObject second)
    369       {
    370         return LispThread.currentThread().setValues(first, second);
    371       }
    372       @Override
    373       public LispObject execute(LispObject first, LispObject second,
    374                                 LispObject third)
    375       {
    376         return LispThread.currentThread().setValues(first, second, third);
    377       }
    378       @Override
    379       public LispObject execute(LispObject first, LispObject second,
    380                                 LispObject third, LispObject fourth)
    381       {
    382         return LispThread.currentThread().setValues(first, second, third,
    383                                                     fourth);
    384       }
    385299      @Override
    386300      public LispObject execute(LispObject[] args)
     
    634548    {
    635549      @Override
    636       public LispObject execute()
    637       {
    638         return Fixnum.ZERO;
    639       }
    640       @Override
    641       public LispObject execute(LispObject arg) throws ConditionThrowable
    642       {
    643         if (arg.numberp())
    644           return arg;
    645         return type_error(arg, Symbol.NUMBER);
    646       }
    647       @Override
    648       public LispObject execute(LispObject first, LispObject second)
    649         throws ConditionThrowable
    650       {
    651         return first.add(second);
    652       }
    653       @Override
    654       public LispObject execute(LispObject first, LispObject second,
    655                                 LispObject third)
    656         throws ConditionThrowable
    657       {
    658         return first.add(second).add(third);
    659       }
    660       @Override
    661550      public LispObject execute(LispObject[] args) throws ConditionThrowable
    662551      {
     
    685574    {
    686575      @Override
    687       public LispObject execute() throws ConditionThrowable
    688       {
    689         return error(new WrongNumberOfArgumentsException(this));
    690       }
    691       @Override
    692       public LispObject execute(LispObject arg) throws ConditionThrowable
    693       {
    694         return arg.negate();
    695       }
    696       @Override
    697       public LispObject execute(LispObject first, LispObject second)
    698         throws ConditionThrowable
    699       {
    700         return first.subtract(second);
    701       }
    702       @Override
    703576      public LispObject execute(LispObject[] args) throws ConditionThrowable
    704577      {
     578        if (args.length == 0)
     579          return error(new WrongNumberOfArgumentsException(this));
     580        if (args.length == 1)
     581          return args[0].negate();
    705582        LispObject result = args[0];
    706583        for (int i = 1; i < args.length; i++)
     
    944821    {
    945822      @Override
    946       public LispObject execute()
    947       {
    948         return NIL;
    949       }
    950       @Override
    951       public LispObject execute(LispObject arg)
    952       {
    953         return arg;
    954       }
    955       @Override
    956       public LispObject execute(LispObject first, LispObject second)
    957         throws ConditionThrowable
    958       {
    959         if (first == NIL)
    960           return second;
    961         // APPEND is required to copy its first argument.
    962         Cons result = new Cons(first.car());
    963         Cons splice = result;
    964         first = first.cdr();
    965         while (first != NIL)
    966           {
    967             Cons temp = new Cons(first.car());
    968             splice.cdr = temp;
    969             splice = temp;
    970             first = first.cdr();
    971           }
    972         splice.cdr = second;
    973         return result;
    974       }
    975       @Override
    976       public LispObject execute(LispObject first, LispObject second,
    977                                 LispObject third)
    978         throws ConditionThrowable
    979       {
    980         if (first == NIL)
    981           return execute(second, third);
    982         Cons result = new Cons(first.car());
    983         Cons splice = result;
    984         first = first.cdr();
    985         while (first != NIL)
    986           {
    987             Cons temp = new Cons(first.car());
    988             splice.cdr = temp;
    989             splice = temp;
    990             first = first.cdr();
    991           }
    992         while (second != NIL)
    993           {
    994             Cons temp = new Cons(second.car());
    995             splice.cdr = temp;
    996             splice = temp;
    997             second = second.cdr();
    998           }
    999         splice.cdr = third;
    1000         return result;
    1001       }
    1002       @Override
    1003823      public LispObject execute(LispObject[] args) throws ConditionThrowable
    1004824      {
     825        if (args.length == 0)
     826            return NIL;
     827
     828        if (args.length == 1)
     829            return args[0];
     830
    1005831        Cons result = null;
    1006832        Cons splice = null;
     
    1047873    {
    1048874      @Override
    1049       public LispObject execute()
    1050       {
    1051         return NIL;
    1052       }
    1053       @Override
    1054       public LispObject execute(LispObject arg)
    1055       {
    1056         return arg;
    1057       }
    1058       @Override
    1059       public LispObject execute(LispObject first, LispObject second)
    1060         throws ConditionThrowable
    1061       {
    1062         if (first == NIL)
    1063           return second;
    1064         if (first instanceof Cons)
    1065           {
    1066             LispObject result = first;
    1067             Cons splice = null;
    1068             while (first instanceof Cons)
    1069               {
    1070                 splice = (Cons) first;
    1071                 first = splice.cdr;
    1072               }
    1073             splice.cdr = second;
    1074             return result;
    1075           }
    1076         return type_error(first, Symbol.LIST);
    1077       }
    1078       @Override
    1079875      public LispObject execute(LispObject[] array) throws ConditionThrowable
    1080876      {
     877        if (array.length == 0)
     878            return NIL;
     879        if (array.length == 1)
     880            return array[0];
     881
    1081882        LispObject result = null;
    1082883        Cons splice = null;
     
    1123924    {
    1124925      @Override
    1125       public LispObject execute() throws ConditionThrowable
    1126       {
    1127         return error(new WrongNumberOfArgumentsException(this));
    1128       }
    1129       @Override
    1130       public LispObject execute(LispObject arg)
    1131       {
    1132         return T;
    1133       }
    1134       @Override
    1135       public LispObject execute(LispObject first, LispObject second)
    1136         throws ConditionThrowable
    1137       {
    1138         return first.isEqualTo(second) ? T : NIL;
    1139       }
    1140       @Override
    1141       public LispObject execute(LispObject first, LispObject second,
    1142                                 LispObject third)
    1143         throws ConditionThrowable
    1144       {
    1145         if (first.isEqualTo(second) && second.isEqualTo(third))
    1146           return T;
    1147         else
    1148           return NIL;
    1149       }
    1150       @Override
    1151926      public LispObject execute(LispObject[] array) throws ConditionThrowable
    1152927      {
     928        if (array.length == 0)
     929          return error(new WrongNumberOfArgumentsException(this));
    1153930        final int length = array.length;
    1154931        final LispObject obj = array[0];
     
    16121389                if (currentSource == Keyword.TOP_LEVEL)
    16131390                  {
    1614                     Symbol.STYLE_WARN.execute(new SimpleString("redefining ~S at top level"),
    1615                                               arg);
     1391                    Symbol.STYLE_WARN
     1392                            .execute(new LispObject[] { new SimpleString("redefining ~S at top level"), arg });
    16161393
    16171394                  }
     
    16221399                    try
    16231400                      {
    1624                         Symbol.STYLE_WARN.execute(new SimpleString("redefining ~S in ~S"),
    1625                                                   arg, currentSource);
     1401                        Symbol.STYLE_WARN
     1402                                .execute(new LispObject[] { new SimpleString("redefining ~S in ~S"),
     1403                                                            arg, currentSource });
    16261404                      }
    16271405                    finally
     
    16571435        if (definition instanceof Function)
    16581436          {
    1659             Symbol.FSET.execute(name, definition, NIL,
    1660                                 ((Function)definition).getLambdaList());
     1437            Symbol.FSET.execute(new LispObject[] { name, definition, NIL,
     1438                                                   ((Function)definition).getLambdaList() });
    16611439            return name;
    16621440          }
     
    24782256    new Primitive(Symbol.FUNCALL, "function &rest args")
    24792257    {
    2480       @Override
    2481       public LispObject execute() throws ConditionThrowable
    2482       {
    2483         return error(new WrongNumberOfArgumentsException(this));
    2484       }
    2485       @Override
    2486       public LispObject execute(LispObject arg) throws ConditionThrowable
    2487       {
    2488         return LispThread.currentThread().execute(arg);
    2489       }
    2490       @Override
    2491       public LispObject execute(LispObject first, LispObject second)
    2492         throws ConditionThrowable
    2493       {
    2494         return LispThread.currentThread().execute(first, second);
    2495       }
    2496       @Override
    2497       public LispObject execute(LispObject first, LispObject second,
    2498                                 LispObject third)
    2499         throws ConditionThrowable
    2500       {
    2501         return LispThread.currentThread().execute(first, second, third);
    2502       }
    2503       @Override
    2504       public LispObject execute(LispObject first, LispObject second,
    2505                                 LispObject third, LispObject fourth)
    2506         throws ConditionThrowable
    2507       {
    2508         return LispThread.currentThread().execute(first, second, third,
    2509                                                   fourth);
    2510       }
    2511       @Override
    2512       public LispObject execute(LispObject first, LispObject second,
    2513                                 LispObject third, LispObject fourth,
    2514                                 LispObject fifth)
    2515         throws ConditionThrowable
    2516       {
    2517         return LispThread.currentThread().execute(first, second, third,
    2518                                                   fourth, fifth);
    2519       }
    2520       @Override
    2521       public LispObject execute(LispObject first, LispObject second,
    2522                                 LispObject third, LispObject fourth,
    2523                                 LispObject fifth, LispObject sixth)
    2524         throws ConditionThrowable
    2525       {
    2526         return LispThread.currentThread().execute(first, second, third,
    2527                                                   fourth, fifth, sixth);
    2528       }
    2529       @Override
    2530       public LispObject execute(LispObject first, LispObject second,
    2531                                 LispObject third, LispObject fourth,
    2532                                 LispObject fifth, LispObject sixth,
    2533                                 LispObject seventh)
    2534         throws ConditionThrowable
    2535       {
    2536         return LispThread.currentThread().execute(first, second, third,
    2537                                                   fourth, fifth, sixth,
    2538                                                   seventh);
    2539       }
    2540       @Override
    2541       public LispObject execute(LispObject first, LispObject second,
    2542                                 LispObject third, LispObject fourth,
    2543                                 LispObject fifth, LispObject sixth,
    2544                                 LispObject seventh, LispObject eigth)
    2545         throws ConditionThrowable
    2546       {
    2547         return LispThread.currentThread().execute(first, second, third,
    2548                                                   fourth, fifth, sixth,
    2549                                                   seventh, eigth);
    2550       }
     2258      // We don't need to implement the other execute() primitives,
     2259      // because we're overriding Primitive's default dispatching below
    25512260      @Override
    25522261      public LispObject execute(LispObject[] args) throws ConditionThrowable
    25532262      {
    25542263        final int length = args.length - 1; // Number of arguments.
    2555         if (length == 8)
    2556           {
    2557             return LispThread.currentThread().execute(args[0], args[1],
    2558                                                       args[2], args[3],
    2559                                                       args[4], args[5],
    2560                                                       args[6], args[7],
    2561                                                       args[8]);
    2562           }
    2563         else
    2564           {
    2565             LispObject[] newArgs = new LispObject[length];
    2566             System.arraycopy(args, 1, newArgs, 0, length);
    2567             return LispThread.currentThread().execute(args[0], newArgs);
    2568           }
     2264        LispObject[] newArgs = new LispObject[length];
     2265        System.arraycopy(args, 1, newArgs, 0, length);
     2266        return LispThread.currentThread().execute(args[0], newArgs);
    25692267      }
    25702268    };
     
    25752273    {
    25762274      @Override
    2577       public LispObject execute() throws ConditionThrowable
    2578       {
    2579         return error(new WrongNumberOfArgumentsException(this));
    2580       }
    2581       @Override
    2582       public LispObject execute(LispObject arg) throws ConditionThrowable
    2583       {
    2584         return error(new WrongNumberOfArgumentsException(this));
    2585       }
    2586       @Override
    2587       public LispObject execute(LispObject fun, LispObject args)
    2588         throws ConditionThrowable
    2589       {
    2590         final LispThread thread = LispThread.currentThread();
    2591         final int length = args.length();
    2592         switch (length)
    2593           {
    2594           case 0:
    2595             return thread.execute(fun);
    2596           case 1:
    2597             return thread.execute(fun, ((Cons)args).car);
    2598           case 2:
    2599             {
    2600               Cons cons = (Cons) args;
    2601               return thread.execute(fun, cons.car, ((Cons)cons.cdr).car);
    2602             }
    2603           case 3:
    2604             return thread.execute(fun, args.car(), args.cadr(),
    2605                                   args.cdr().cdr().car());
    2606           default:
    2607             {
    2608               final LispObject[] funArgs = new LispObject[length];
    2609               int j = 0;
    2610               while (args != NIL)
    2611                 {
    2612                   funArgs[j++] = args.car();
    2613                   args = args.cdr();
    2614                 }
    2615               return funcall(fun, funArgs, thread);
    2616             }
    2617           }
    2618       }
    2619       @Override
    2620       public LispObject execute(LispObject first, LispObject second,
    2621                                 LispObject third)
    2622         throws ConditionThrowable
    2623       {
    2624         if (third.listp())
    2625           {
    2626             final int numFunArgs = 1 + third.length();
    2627             final LispObject[] funArgs = new LispObject[numFunArgs];
    2628             funArgs[0] = second;
    2629             int j = 1;
    2630             while (third != NIL)
    2631               {
    2632                 funArgs[j++] = third.car();
    2633                 third = third.cdr();
    2634               }
    2635             return funcall(first, funArgs, LispThread.currentThread());
    2636           }
    2637         return type_error(third, Symbol.LIST);
    2638       }
    2639       @Override
    26402275      public LispObject execute(final LispObject[] args) throws ConditionThrowable
    26412276      {
    26422277        final int numArgs = args.length;
     2278        if (numArgs < 2)
     2279          return error(new WrongNumberOfArgumentsException(this));
     2280
    26432281        LispObject spread = args[numArgs - 1];
    26442282        if (spread.listp())
     
    26782316            else
    26792317                return type_error(list, Symbol.LIST);
    2680             LispObject obj = thread.execute(fun, cons.car);
     2318            LispObject obj = thread.execute(fun, new LispObject[] { cons.car });
    26812319            if (splice == null)
    26822320              {
     
    27062344          {
    27072345            LispObject obj =
    2708               thread.execute(fun, list1.car(), list2.car());
     2346              thread.execute(fun, new LispObject[] { list1.car(), list2.car() });
    27092347            if (splice == null)
    27102348              {
     
    27792417            else
    27802418                return type_error(list, Symbol.LIST);
    2781             thread.execute(fun, cons.car);
     2419            thread.execute(fun, new LispObject[] { cons.car });
    27822420            list = cons.cdr;
    27832421          }
     
    27942432        while (list1 != NIL && list2 != NIL)
    27952433          {
    2796             thread.execute(fun, list1.car(), list2.car());
     2434            thread.execute(fun, new LispObject[] { list1.car(), list2.car() });
    27972435            list1 = ((Cons)list1).cdr;
    27982436            list2 = ((Cons)list2).cdr;
     
    34243062                  PACKAGE_SYS.intern("MAKE-EXPANDER-FOR-MACROLET");
    34253063                LispObject expander =
    3426                   make_expander_for_macrolet.execute(def);
     3064                  make_expander_for_macrolet.execute(new LispObject[] { def });
    34273065                Closure expansionFunction = new Closure(expander, env);
    34283066                MacroObject macroObject =
     
    45774215                  {
    45784216                    LispObject candidate = ((Cons)tail).car;
    4579                     if (test.execute(item, candidate) != NIL)
     4217                    if (test.execute(new LispObject[] { item, candidate }) != NIL)
    45804218                      return tail;
    45814219                    tail = ((Cons)tail).cdr;
     
    45884226                  {
    45894227                    LispObject candidate = ((Cons)tail).car;
    4590                     if (testNot.execute(item, candidate) == NIL)
     4228                    if (testNot.execute(new LispObject[] { item, candidate }) == NIL)
    45914229                      return tail;
    45924230                    tail = ((Cons)tail).cdr;
     
    45994237            while (tail instanceof Cons)
    46004238              {
    4601                 LispObject candidate = key.execute(((Cons)tail).car);
     4239                LispObject candidate = key.execute(new LispObject[] { ((Cons)tail).car });
    46024240                if (test != NIL)
    46034241                  {
    4604                     if (test.execute(item, candidate) != NIL)
     4242                    if (test.execute(new LispObject[] { item, candidate }) != NIL)
    46054243                      return tail;
    46064244                  }
    46074245                else
    46084246                  {
    4609                     if (testNot.execute(item, candidate) == NIL)
     4247                    if (testNot.execute(new LispObject[] { item, candidate }) == NIL)
    46104248                      return tail;
    46114249                  }
     
    46284266      {
    46294267        if (first != NIL)
    4630           return LispThread.currentThread().execute(first, second);
     4268          return LispThread.currentThread().execute(new LispObject[] { first, second });
    46314269        return second;
    46324270      }
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Profiler.java

    r11488 r11893  
    9393                            if (object instanceof StandardGenericFunction) {
    9494                                LispObject methods =
    95                                     PACKAGE_MOP.intern("GENERIC-FUNCTION-METHODS").execute(object);
     95                                    PACKAGE_MOP.intern("GENERIC-FUNCTION-METHODS")
     96                                    .execute(new LispObject[] { object });
    9697                                while (methods != NIL) {
    9798                                    StandardMethod method = (StandardMethod) methods.car();
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/ReaderMacroFunction.java

    r11488 r11893  
    6363
    6464    @Override
    65     public LispObject execute(LispObject first, LispObject second)
     65    public LispObject execute(LispObject[] args)
    6666        throws ConditionThrowable
    6767    {
    68         Stream stream = inSynonymOf(first);
    69         char c = LispCharacter.getValue(second);
     68        if (args.length != 2)
     69            return error(new WrongNumberOfArgumentsException(this));
     70
     71        Stream stream = inSynonymOf(args[0]);
     72        char c = LispCharacter.getValue(args[1]);
    7073        return execute(stream, c);
    7174    }
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/SimpleCondition.java

    r11488 r11893  
    8888        public LispObject execute(LispObject arg) throws ConditionThrowable
    8989        {
    90             return Symbol.STD_SLOT_VALUE.execute(arg, Symbol.FORMAT_CONTROL);
     90            return Symbol.STD_SLOT_VALUE.execute(new LispObject[] { arg, Symbol.FORMAT_CONTROL });
    9191        }
    9292    };
     
    9999        public LispObject execute(LispObject arg) throws ConditionThrowable
    100100        {
    101             return Symbol.STD_SLOT_VALUE.execute(arg, Symbol.FORMAT_ARGUMENTS);
     101            return Symbol.STD_SLOT_VALUE.execute(new LispObject[] { arg, Symbol.FORMAT_ARGUMENTS });
    102102        }
    103103    };
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/SlimeInputStream.java

    r11488 r11893  
    9797            try {
    9898                ostream.finishOutput();
    99                 s = LispThread.currentThread().execute(f).getStringValue();
     99                s = LispThread.currentThread()
     100                        .execute(f, new LispObject[0]).getStringValue();
    100101            }
    101102            catch (Throwable t) {
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/SlimeOutputStream.java

    r11488 r11893  
    131131            String s = stringWriter.toString();
    132132            stringWriter.getBuffer().setLength(0);
    133             LispThread.currentThread().execute(f, new SimpleString(s));
     133            LispThread.currentThread().execute(f, new LispObject[] { new SimpleString(s) });
    134134        }
    135135    }
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/SlotClass.java

    r11754 r11893  
    111111                LispObject obj = ((StandardClass)c).getDirectDefaultInitargs();
    112112                if (obj != NIL)
    113                     result = Symbol.APPEND.execute(result, obj);
     113                    result = Symbol.APPEND.execute(new LispObject[] { result, obj });
    114114            }
    115115            cpl = cpl.cdr();
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/SpecialOperator.java

    r11488 r11893  
    6969    }
    7070
    71     @Override
    7271    public LispObject execute() throws ConditionThrowable
    7372    {
     
    7574    }
    7675
    77     @Override
    7876    public LispObject execute(LispObject arg) throws ConditionThrowable
    7977    {
     
    8179    }
    8280
    83     @Override
    8481    public LispObject execute(LispObject first, LispObject second)
    8582        throws ConditionThrowable
     
    8885    }
    8986
    90     @Override
    9187    public LispObject execute(LispObject first, LispObject second,
    9288                              LispObject third)
     
    9692    }
    9793
    98     @Override
    9994    public LispObject execute(LispObject first, LispObject second,
    10095                              LispObject third, LispObject fourth)
     
    10499    }
    105100
    106     @Override
    107101    public LispObject execute(LispObject first, LispObject second,
    108102                              LispObject third, LispObject fourth,
     
    113107    }
    114108
    115     @Override
    116109    public LispObject execute(LispObject first, LispObject second,
    117110                              LispObject third, LispObject fourth,
     
    122115    }
    123116
    124     @Override
    125117    public LispObject execute(LispObject first, LispObject second,
    126118                              LispObject third, LispObject fourth,
     
    132124    }
    133125
    134     @Override
    135126    public LispObject execute(LispObject first, LispObject second,
    136127                              LispObject third, LispObject fourth,
     
    145136    public LispObject execute(LispObject[] args) throws ConditionThrowable
    146137    {
    147         return error(new UndefinedFunction(getLambdaName()));
     138      switch (args.length)
     139        {
     140          case 0:
     141            return execute();
     142          case 1:
     143            return execute(args[0]);
     144          case 2:
     145            return execute(args[0], args[1]);
     146          case 3:
     147            return execute(args[0], args[1], args[2]);
     148          case 4:
     149            return execute(args[0], args[1], args[2], args[3]);
     150          case 5:
     151            return execute(args[0], args[1], args[2], args[3], args[4]);
     152          case 6:
     153            return execute(args[0], args[1], args[2], args[3], args[4],
     154                           args[5]);
     155          case 7:
     156            return execute(args[0], args[1], args[2], args[3], args[4],
     157                           args[5], args[6]);
     158          case 8:
     159            return execute(args[0], args[1], args[2], args[3], args[4],
     160                           args[5], args[6], args[7]);
     161          default:
     162            return error(new UndefinedFunction(getLambdaName()));
     163        }
    148164    }
    149165
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/StandardClass.java

    r11711 r11893  
    7474    if (layout == null)
    7575      {
    76         Symbol.ERROR.execute(Symbol.SIMPLE_ERROR,
     76        Symbol.ERROR.execute(
     77          new LispObject[] { Symbol.SIMPLE_ERROR,
    7778                             Keyword.FORMAT_CONTROL,
    7879                             new SimpleString("No layout for class ~S."),
    7980                             Keyword.FORMAT_ARGUMENTS,
    80                              list(this));
     81                             list(this) });
    8182      }
    8283    return new StandardObject(this, layout.getLength());
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/StandardGenericFunction.java

    r11754 r11893  
    126126
    127127  @Override
    128   public LispObject execute() throws ConditionThrowable
    129   {
    130     return function.execute();
    131   }
    132 
    133   @Override
    134   public LispObject execute(LispObject arg) throws ConditionThrowable
    135   {
    136     return function.execute(arg);
    137   }
    138 
    139   @Override
    140   public LispObject execute(LispObject first, LispObject second)
    141     throws ConditionThrowable
    142   {
    143     return function.execute(first, second);
    144   }
    145 
    146   @Override
    147   public LispObject execute(LispObject first, LispObject second,
    148                             LispObject third)
    149     throws ConditionThrowable
    150   {
    151     return function.execute(first, second, third);
    152   }
    153 
    154   @Override
    155   public LispObject execute(LispObject first, LispObject second,
    156                             LispObject third, LispObject fourth)
    157     throws ConditionThrowable
    158   {
    159     return function.execute(first, second, third, fourth);
    160   }
    161 
    162   @Override
    163   public LispObject execute(LispObject first, LispObject second,
    164                             LispObject third, LispObject fourth,
    165                             LispObject fifth)
    166     throws ConditionThrowable
    167   {
    168     return function.execute(first, second, third, fourth,
    169                             fifth);
    170   }
    171 
    172   @Override
    173   public LispObject execute(LispObject first, LispObject second,
    174                             LispObject third, LispObject fourth,
    175                             LispObject fifth, LispObject sixth)
    176     throws ConditionThrowable
    177   {
    178     return function.execute(first, second, third, fourth,
    179                             fifth, sixth);
    180   }
    181 
    182   @Override
    183   public LispObject execute(LispObject first, LispObject second,
    184                             LispObject third, LispObject fourth,
    185                             LispObject fifth, LispObject sixth,
    186                             LispObject seventh)
    187     throws ConditionThrowable
    188   {
    189     return function.execute(first, second, third, fourth,
    190                             fifth, sixth, seventh);
    191   }
    192 
    193   @Override
    194   public LispObject execute(LispObject first, LispObject second,
    195                             LispObject third, LispObject fourth,
    196                             LispObject fifth, LispObject sixth,
    197                             LispObject seventh, LispObject eighth)
    198     throws ConditionThrowable
    199   {
    200     return function.execute(first, second, third, fourth,
    201                             fifth, sixth, seventh, eighth);
    202   }
    203 
    204   @Override
    205128  public LispObject execute(LispObject[] args) throws ConditionThrowable
    206129  {
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/StandardObject.java

    r11754 r11893  
    162162      {
    163163        StringOutputStream stream = new StringOutputStream();
    164         Symbol.PRINT_OBJECT.execute(this, stream);
     164        Symbol.PRINT_OBJECT.execute(new LispObject[] { this, stream });
    165165        return stream.getString().getStringValue();
    166166      }
     
    236236    Debug.assertTrue(!layout.isInvalid());
    237237    // Call UPDATE-INSTANCE-FOR-REDEFINED-CLASS.
    238     Symbol.UPDATE_INSTANCE_FOR_REDEFINED_CLASS.execute(this, added,
    239                                                        discarded, plist);
     238    Symbol.UPDATE_INSTANCE_FOR_REDEFINED_CLASS
     239            .execute(new LispObject[] { this, added, discarded, plist });
    240240    return newLayout;
    241241  }
     
    374374          {
    375375            LispObject slotName = instance.layout.getSlotNames()[index];
    376             value = Symbol.SLOT_UNBOUND.execute(instance.getLispClass(),
    377                                                 instance, slotName);
     376            value = Symbol.SLOT_UNBOUND
     377                    .execute(new LispObject[] { instance.getLispClass(),
     378                                                instance, slotName });
    378379            LispThread.currentThread()._values = null;
    379380          }
     
    424425        final LispThread thread = LispThread.currentThread();
    425426        LispObject value =
    426           thread.execute(Symbol.SLOT_MISSING, instance.getLispClass(),
    427                          instance, second, Symbol.SLOT_BOUNDP);
     427          thread.execute(Symbol.SLOT_MISSING,
     428              new LispObject[] { instance.getLispClass(),
     429                                 instance, second, Symbol.SLOT_BOUNDP });
    428430        // "If SLOT-MISSING is invoked and returns a value, a boolean
    429431        // equivalent to its primary value is returned by SLOT-BOUNDP."
     
    453455        LispObject location = layout.getSharedSlotLocation(slotName);
    454456        if (location == null)
    455           return Symbol.SLOT_MISSING.execute(getLispClass(), this, slotName,
    456                                              Symbol.SLOT_VALUE);
     457          return Symbol.SLOT_MISSING
     458                  .execute(new LispObject[] { getLispClass(), this, slotName,
     459                                              Symbol.SLOT_VALUE });
    457460        value = location.cdr();
    458461      }
    459462    if (value == UNBOUND_VALUE)
    460463      {
    461         value = Symbol.SLOT_UNBOUND.execute(getLispClass(), this, slotName);
     464        value = Symbol.SLOT_UNBOUND
     465                .execute(new LispObject[] { getLispClass(), this, slotName });
    462466        LispThread.currentThread()._values = null;
    463467      }
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Stream.java

    r11783 r11893  
    539539      return ((ReaderMacroFunction)handler).execute(this, c);
    540540    if (handler != null && handler != NIL)
    541       return handler.execute(this, LispCharacter.getInstance(c));
     541      return handler.execute(new LispObject[] { this, LispCharacter.getInstance(c) });
    542542    return readToken(c, rt);
    543543  }
     
    597597          PACKAGE_SYS.intern("DEFSTRUCT-DEFAULT-CONSTRUCTOR");
    598598        LispObject constructor =
    599           DEFSTRUCT_DEFAULT_CONSTRUCTOR.getSymbolFunctionOrDie().execute(structure);
     599          DEFSTRUCT_DEFAULT_CONSTRUCTOR.getSymbolFunctionOrDie().execute(new LispObject[] { structure });
    600600        final int length = args.length();
    601601        if ((length % 2) != 0)
     
    645645          PACKAGE_SYS.intern("DEFSTRUCT-DEFAULT-CONSTRUCTOR");
    646646        LispObject constructor =
    647           DEFSTRUCT_DEFAULT_CONSTRUCTOR.getSymbolFunctionOrDie().execute(structure);
     647          DEFSTRUCT_DEFAULT_CONSTRUCTOR.getSymbolFunctionOrDie().execute(new LispObject[] { structure });
    648648        final int length = args.length();
    649649        if ((length % 2) != 0)
     
    793793      {
    794794        LispObject result =
    795           thread.execute(fun, this, LispCharacter.getInstance(c),
    796                          (numArg < 0) ? NIL : Fixnum.getInstance(numArg));
     795          thread.execute(fun,
     796            new LispObject[] { this, LispCharacter.getInstance(c),
     797                               (numArg < 0) ? NIL : Fixnum.getInstance(numArg) });
    797798        LispObject[] values = thread._values;
    798799        if (values != null && values.length == 0)
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/StructureObject.java

    r11754 r11893  
    404404            LispObject fun = PRINT_RESTART.getSymbolFunction();
    405405            StringOutputStream stream = new StringOutputStream();
    406             thread.execute(fun, this, stream);
     406            thread.execute(fun, new LispObject[] { this, stream });
    407407            return stream.getString().getStringValue();
    408408          }
     
    447447                    StringOutputStream stream = new StringOutputStream();
    448448                    thread.execute(Symbol.OUTPUT_OBJECT.getSymbolFunction(),
    449                                    slots[i], stream);
     449                                   new LispObject[] { slots[i], stream });
    450450                    sb.append(stream.getString().getStringValue());
    451451                  }
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Symbol.java

    r11754 r11893  
    715715
    716716  @Override
    717   public LispObject execute() throws ConditionThrowable
    718   {
    719     try
    720       {
    721         return function.execute();
    722       }
    723     catch (NullPointerException e)
    724       {
    725         return handleNPE(e, NIL);
    726       }
    727   }
    728 
    729   @Override
    730   public LispObject execute(LispObject arg) throws ConditionThrowable
    731   {
    732     try
    733       {
    734         return function.execute(arg);
    735       }
    736     catch (NullPointerException e)
    737       {
    738         return handleNPE(e, list(arg));
    739       }
    740   }
    741 
    742   @Override
    743   public LispObject execute(LispObject first, LispObject second)
    744     throws ConditionThrowable
    745   {
    746     try
    747       {
    748         return function.execute(first, second);
    749       }
    750     catch (NullPointerException e)
    751       {
    752         return handleNPE(e, list(first, second));
    753       }
    754   }
    755 
    756   @Override
    757   public LispObject execute(LispObject first, LispObject second,
    758                             LispObject third)
    759     throws ConditionThrowable
    760   {
    761     try
    762       {
    763         return function.execute(first, second, third);
    764       }
    765     catch (NullPointerException e)
    766       {
    767         return handleNPE(e, list(first, second, third));
    768       }
    769   }
    770 
    771   @Override
    772   public LispObject execute(LispObject first, LispObject second,
    773                             LispObject third, LispObject fourth)
    774     throws ConditionThrowable
    775   {
    776     try
    777       {
    778         return function.execute(first, second, third, fourth);
    779       }
    780     catch (NullPointerException e)
    781       {
    782         return handleNPE(e, list(first, second, third, fourth));
    783       }
    784   }
    785 
    786   @Override
    787   public LispObject execute(LispObject first, LispObject second,
    788                             LispObject third, LispObject fourth,
    789                             LispObject fifth)
    790     throws ConditionThrowable
    791   {
    792     try
    793       {
    794         return function.execute(first, second, third, fourth, fifth);
    795       }
    796     catch (NullPointerException e)
    797       {
    798         return handleNPE(e, list(first, second, third, fourth, fifth));
    799       }
    800   }
    801 
    802   @Override
    803   public LispObject execute(LispObject first, LispObject second,
    804                             LispObject third, LispObject fourth,
    805                             LispObject fifth, LispObject sixth)
    806     throws ConditionThrowable
    807   {
    808     try
    809       {
    810         return function.execute(first, second, third, fourth, fifth, sixth);
    811       }
    812     catch (NullPointerException e)
    813       {
    814         return handleNPE(e, list(first, second, third, fourth, fifth,
    815                                   sixth));
    816       }
    817   }
    818 
    819   @Override
    820   public LispObject execute(LispObject first, LispObject second,
    821                             LispObject third, LispObject fourth,
    822                             LispObject fifth, LispObject sixth,
    823                             LispObject seventh)
    824     throws ConditionThrowable
    825   {
    826     try
    827       {
    828         return function.execute(first, second, third, fourth, fifth, sixth,
    829                                 seventh);
    830       }
    831     catch (NullPointerException e)
    832       {
    833         return handleNPE(e,
    834                          list(first, second, third, fourth, fifth, sixth,
    835                                seventh));
    836       }
    837   }
    838 
    839   @Override
    840   public LispObject execute(LispObject first, LispObject second,
    841                             LispObject third, LispObject fourth,
    842                             LispObject fifth, LispObject sixth,
    843                             LispObject seventh, LispObject eighth)
    844     throws ConditionThrowable
    845   {
    846     try
    847       {
    848         return function.execute(first, second, third, fourth, fifth, sixth,
    849                                 seventh, eighth);
    850       }
    851     catch (NullPointerException e)
    852       {
    853         return handleNPE(e,
    854                          list(first, second, third, fourth, fifth, sixth,
    855                                seventh, eighth));
    856       }
    857   }
    858 
    859   @Override
    860717  public LispObject execute(LispObject[] args) throws ConditionThrowable
    861718  {
     
    878735    if (function == null)
    879736      return LispThread.currentThread().execute(Symbol.UNDEFINED_FUNCTION_CALLED,
    880                                                 this, args);
     737                      new LispObject[] { this, args });
    881738    Debug.trace(e);
    882739    return error(new LispError("Null pointer exception"));
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/Time.java

    r11714 r11893  
    8787        try
    8888          {
    89             return arg.execute();
     89            return arg.execute(new LispObject[0]);
    9090          }
    9191        finally
  • branches/fewer-executes/abcl/src/org/armedbear/lisp/ZeroRankArray.java

    r11711 r11893  
    149149                StringOutputStream stream = new StringOutputStream();
    150150                thread.execute(Symbol.OUTPUT_OBJECT.getSymbolFunction(),
    151                                data, stream);
     151                               new LispObject[] { data, stream });
    152152                sb.append(stream.getString().getStringValue());
    153153            } else
Note: See TracChangeset for help on using the changeset viewer.