Changeset 11893
- Timestamp:
- 05/18/09 18:02:39 (14 years ago)
- 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 236 236 StringOutputStream stream = new StringOutputStream(); 237 237 thread.execute(Symbol.OUTPUT_OBJECT.getSymbolFunction(), 238 AREF(index), stream);238 new LispObject[] { AREF(index), stream }); 239 239 sb.append(stream.getString().getStringValue()); 240 240 } else -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Autoload.java
r11791 r11893 151 151 return fileName; 152 152 return symbol.getName().toLowerCase(); 153 }154 155 @Override156 public LispObject execute() throws ConditionThrowable157 {158 load();159 return symbol.execute();160 }161 162 @Override163 public LispObject execute(LispObject arg) throws ConditionThrowable164 {165 load();166 return symbol.execute(arg);167 }168 169 @Override170 public LispObject execute(LispObject first, LispObject second)171 throws ConditionThrowable172 {173 load();174 return symbol.execute(first, second);175 }176 177 @Override178 public LispObject execute(LispObject first, LispObject second,179 LispObject third)180 throws ConditionThrowable181 {182 load();183 return symbol.execute(first, second, third);184 }185 186 @Override187 public LispObject execute(LispObject first, LispObject second,188 LispObject third, LispObject fourth)189 throws ConditionThrowable190 {191 load();192 return symbol.execute(first, second, third, fourth);193 }194 195 @Override196 public LispObject execute(LispObject first, LispObject second,197 LispObject third, LispObject fourth,198 LispObject fifth)199 throws ConditionThrowable200 {201 load();202 return symbol.execute(first, second, third, fourth, fifth);203 }204 205 @Override206 public LispObject execute(LispObject first, LispObject second,207 LispObject third, LispObject fourth,208 LispObject fifth, LispObject sixth)209 throws ConditionThrowable210 {211 load();212 return symbol.execute(first, second, third, fourth, fifth, sixth);213 }214 215 @Override216 public LispObject execute(LispObject first, LispObject second,217 LispObject third, LispObject fourth,218 LispObject fifth, LispObject sixth,219 LispObject seventh)220 throws ConditionThrowable221 {222 load();223 return symbol.execute(first, second, third, fourth, fifth, sixth,224 seventh);225 }226 227 @Override228 public LispObject execute(LispObject first, LispObject second,229 LispObject third, LispObject fourth,230 LispObject fifth, LispObject sixth,231 LispObject seventh, LispObject eighth)232 throws ConditionThrowable233 {234 load();235 return symbol.execute(first, second, third, fourth, fifth, sixth,236 seventh, eighth);237 153 } 238 154 -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Closure.java
r11778 r11893 372 372 } 373 373 374 @Override375 public LispObject execute() throws ConditionThrowable376 {377 if (arity == 0)378 {379 return progn(executionBody, environment,380 LispThread.currentThread());381 }382 else383 return execute(new LispObject[0]);384 }385 386 374 private final LispObject bindParametersAndExecute(LispObject... objects) 387 375 throws ConditionThrowable … … 428 416 { 429 417 return execute(objects); 430 }431 432 @Override433 public LispObject execute(LispObject arg) throws ConditionThrowable434 {435 if (minArgs == 1)436 {437 return bindParametersAndExecute(arg);438 }439 else440 {441 return invokeArrayExecute(arg);442 }443 }444 445 @Override446 public LispObject execute(LispObject first, LispObject second)447 throws ConditionThrowable448 {449 if (minArgs == 2)450 {451 return bindParametersAndExecute(first, second);452 }453 else454 {455 return invokeArrayExecute(first, second);456 }457 }458 459 @Override460 public LispObject execute(LispObject first, LispObject second,461 LispObject third)462 throws ConditionThrowable463 {464 if (minArgs == 3)465 {466 return bindParametersAndExecute(first, second, third);467 }468 else469 {470 return invokeArrayExecute(first, second, third);471 }472 }473 474 @Override475 public LispObject execute(LispObject first, LispObject second,476 LispObject third, LispObject fourth)477 throws ConditionThrowable478 {479 if (minArgs == 4)480 {481 return bindParametersAndExecute(first, second, third, fourth);482 }483 else484 {485 return invokeArrayExecute(first, second, third, fourth);486 }487 }488 489 @Override490 public LispObject execute(LispObject first, LispObject second,491 LispObject third, LispObject fourth,492 LispObject fifth)493 throws ConditionThrowable494 {495 if (minArgs == 5)496 {497 return bindParametersAndExecute(first, second, third, fourth,498 fifth);499 }500 else501 {502 return invokeArrayExecute(first, second, third, fourth, fifth);503 }504 }505 506 @Override507 public LispObject execute(LispObject first, LispObject second,508 LispObject third, LispObject fourth,509 LispObject fifth, LispObject sixth)510 throws ConditionThrowable511 {512 if (minArgs == 6)513 {514 return bindParametersAndExecute(first, second, third, fourth,515 fifth, sixth);516 }517 else518 {519 return invokeArrayExecute(first, second, third, fourth, fifth,520 sixth);521 }522 }523 524 @Override525 public LispObject execute(LispObject first, LispObject second,526 LispObject third, LispObject fourth,527 LispObject fifth, LispObject sixth,528 LispObject seventh)529 throws ConditionThrowable530 {531 if (minArgs == 7)532 {533 return bindParametersAndExecute(first, second, third, fourth,534 fifth, sixth, seventh);535 }536 else537 {538 return invokeArrayExecute(first, second, third, fourth, fifth,539 sixth, seventh);540 }541 }542 543 @Override544 public LispObject execute(LispObject first, LispObject second,545 LispObject third, LispObject fourth,546 LispObject fifth, LispObject sixth,547 LispObject seventh, LispObject eighth)548 throws ConditionThrowable549 {550 if (minArgs == 8)551 {552 return bindParametersAndExecute(first, second, third, fourth,553 fifth, sixth, seventh, eighth);554 }555 else556 {557 return invokeArrayExecute(first, second, third, fourth, fifth,558 sixth, seventh, eighth);559 }560 418 } 561 419 -
branches/fewer-executes/abcl/src/org/armedbear/lisp/CompiledFunction.java
r11488 r11893 61 61 62 62 @Override 63 public LispObject execute() throws ConditionThrowable64 {65 LispObject[] args = new LispObject[0];66 return execute(args);67 }68 69 @Override70 public LispObject execute(LispObject arg) throws ConditionThrowable71 {72 LispObject[] args = new LispObject[1];73 args[0] = arg;74 return execute(args);75 }76 77 @Override78 public LispObject execute(LispObject first, LispObject second)79 throws ConditionThrowable80 {81 LispObject[] args = new LispObject[2];82 args[0] = first;83 args[1] = second;84 return execute(args);85 }86 87 @Override88 public LispObject execute(LispObject first, LispObject second,89 LispObject third)90 throws ConditionThrowable91 {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 @Override100 public LispObject execute(LispObject first, LispObject second,101 LispObject third, LispObject fourth)102 throws ConditionThrowable103 {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 @Override113 public LispObject execute(LispObject first, LispObject second,114 LispObject third, LispObject fourth,115 LispObject fifth)116 throws ConditionThrowable117 {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 @Override128 public LispObject execute(LispObject first, LispObject second,129 LispObject third, LispObject fourth,130 LispObject fifth, LispObject sixth)131 throws ConditionThrowable132 {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 @Override144 public LispObject execute(LispObject first, LispObject second,145 LispObject third, LispObject fourth,146 LispObject fifth, LispObject sixth,147 LispObject seventh)148 throws ConditionThrowable149 {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 @Override162 public LispObject execute(LispObject first, LispObject second,163 LispObject third, LispObject fourth,164 LispObject fifth, LispObject sixth,165 LispObject seventh, LispObject eighth)166 throws ConditionThrowable167 {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 @Override181 63 public LispObject execute(LispObject[] args) throws ConditionThrowable 182 64 { -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Condition.java
r11488 r11893 198 198 { 199 199 StringOutputStream stream = new StringOutputStream(); 200 Symbol.APPLY.execute( formatControl, stream, getFormatArguments());200 Symbol.APPLY.execute(new LispObject[] { formatControl, stream, getFormatArguments() }); 201 201 return stream.getString().getStringValue(); 202 202 } … … 206 206 if (f == null || f instanceof Autoload) 207 207 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(); 209 209 } 210 210 } -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Cons.java
r11754 r11893 468 468 } 469 469 return array; 470 }471 472 @Override473 public LispObject execute() throws ConditionThrowable474 {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 @Override484 public LispObject execute(LispObject arg) throws ConditionThrowable485 {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 @Override495 public LispObject execute(LispObject first, LispObject second)496 throws ConditionThrowable497 {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 @Override507 public LispObject execute(LispObject first, LispObject second,508 LispObject third)509 throws ConditionThrowable510 {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 @Override520 public LispObject execute(LispObject first, LispObject second,521 LispObject third, LispObject fourth)522 throws ConditionThrowable523 {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 @Override533 public LispObject execute(LispObject first, LispObject second,534 LispObject third, LispObject fourth,535 LispObject fifth)536 throws ConditionThrowable537 {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 @Override547 public LispObject execute(LispObject first, LispObject second,548 LispObject third, LispObject fourth,549 LispObject fifth, LispObject sixth)550 throws ConditionThrowable551 {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 @Override561 public LispObject execute(LispObject first, LispObject second,562 LispObject third, LispObject fourth,563 LispObject fifth, LispObject sixth,564 LispObject seventh)565 throws ConditionThrowable566 {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 @Override577 public LispObject execute(LispObject first, LispObject second,578 LispObject third, LispObject fourth,579 LispObject fifth, LispObject sixth,580 LispObject seventh, LispObject eighth)581 throws ConditionThrowable582 {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();590 470 } 591 471 -
branches/fewer-executes/abcl/src/org/armedbear/lisp/DispatchMacroFunction.java
r11488 r11893 63 63 64 64 @Override 65 public LispObject execute(LispObject first, LispObject second, 66 LispObject third) 65 public LispObject execute(LispObject[] args) 67 66 throws ConditionThrowable 68 67 { 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]); 71 73 int n; 72 if ( third== NIL)74 if (args[2] == NIL) 73 75 n = -1; 74 76 else 75 n = Fixnum.getValue( third);77 n = Fixnum.getValue(args[2]); 76 78 return execute(stream, c, n); 77 79 } -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Function.java
r11698 r11893 181 181 propertyList = putf(propertyList, Symbol.CLASS_BYTES, 182 182 new JavaObject(bytes)); 183 }184 185 @Override186 public LispObject execute() throws ConditionThrowable187 {188 return error(new WrongNumberOfArgumentsException(this));189 }190 191 @Override192 public LispObject execute(LispObject arg) throws ConditionThrowable193 {194 return error(new WrongNumberOfArgumentsException(this));195 }196 197 @Override198 public LispObject execute(LispObject first, LispObject second)199 throws ConditionThrowable200 {201 return error(new WrongNumberOfArgumentsException(this));202 }203 204 @Override205 public LispObject execute(LispObject first, LispObject second,206 LispObject third)207 throws ConditionThrowable208 {209 return error(new WrongNumberOfArgumentsException(this));210 }211 212 @Override213 public LispObject execute(LispObject first, LispObject second,214 LispObject third, LispObject fourth)215 throws ConditionThrowable216 {217 return error(new WrongNumberOfArgumentsException(this));218 }219 220 @Override221 public LispObject execute(LispObject first, LispObject second,222 LispObject third, LispObject fourth,223 LispObject fifth)224 throws ConditionThrowable225 {226 return error(new WrongNumberOfArgumentsException(this));227 }228 229 @Override230 public LispObject execute(LispObject first, LispObject second,231 LispObject third, LispObject fourth,232 LispObject fifth, LispObject sixth)233 throws ConditionThrowable234 {235 return error(new WrongNumberOfArgumentsException(this));236 }237 238 @Override239 public LispObject execute(LispObject first, LispObject second,240 LispObject third, LispObject fourth,241 LispObject fifth, LispObject sixth,242 LispObject seventh)243 throws ConditionThrowable244 {245 return error(new WrongNumberOfArgumentsException(this));246 }247 248 @Override249 public LispObject execute(LispObject first, LispObject second,250 LispObject third, LispObject fourth,251 LispObject fifth, LispObject sixth,252 LispObject seventh, LispObject eighth)253 throws ConditionThrowable254 {255 return error(new WrongNumberOfArgumentsException(this));256 183 } 257 184 -
branches/fewer-executes/abcl/src/org/armedbear/lisp/HashTable.java
r11711 r11893 280 280 while (e != null) 281 281 { 282 function.execute( e.key, e.value);282 function.execute(new LispObject[] { e.key, e.value }); 283 283 e = e.next; 284 284 } -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Interpreter.java
r11745 r11893 336 336 LispObject tplFun = TOP_LEVEL_LOOP.getSymbolFunction(); 337 337 if (tplFun instanceof Function) { 338 thread.execute( tplFun);338 thread.execute(new LispObject[] { tplFun }); 339 339 return; 340 340 } -
branches/fewer-executes/abcl/src/org/armedbear/lisp/JProxy.java
r11859 r11893 188 188 Object retVal = 189 189 LispThread.currentThread().execute 190 (Symbol.APPLY, function, lispArgs.reverse()).javaInstance();190 (Symbol.APPLY, new LispObject[] { function, lispArgs.reverse() }).javaInstance(); 191 191 //(function.execute(lispArgs)).javaInstance(); 192 192 /* DOES NOT WORK due to autoboxing! … … 201 201 new Primitive("%jmake-invocation-handler", PACKAGE_JAVA, false, 202 202 "function") { 203 203 @Override 204 204 public LispObject execute(LispObject[] args) throws ConditionThrowable { 205 205 int length = args.length; … … 217 217 new Primitive("%jmake-proxy", PACKAGE_JAVA, false, 218 218 "interface invocation-handler") { 219 219 @Override 220 220 public LispObject execute(final LispObject[] args) throws ConditionThrowable { 221 221 int length = args.length; -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Java.java
r11834 r11893 400 400 else 401 401 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)) }); 407 408 } 408 409 // Not reached. … … 465 466 else 466 467 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)) }); 472 474 } 473 475 // Not reached. … … 519 521 else 520 522 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)) }); 526 529 } 527 530 // Not reached. … … 577 580 else 578 581 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)) }); 584 588 } 585 589 // Not reached. … … 659 663 else 660 664 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)) }); 666 671 } 667 672 // Not reached. -
branches/fewer-executes/abcl/src/org/armedbear/lisp/JavaException.java
r11488 r11893 94 94 public LispObject execute(LispObject arg) throws ConditionThrowable 95 95 { 96 return Symbol.STD_SLOT_VALUE.execute( arg, Symbol.CAUSE);96 return Symbol.STD_SLOT_VALUE.execute(new LispObject[] { arg, Symbol.CAUSE }); 97 97 } 98 98 }; -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Lisp.java
r11883 r11893 141 141 try 142 142 { 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); 180 144 } 181 145 finally … … 183 147 thread.setStack(stack); 184 148 } 185 return result;186 149 } 187 150 … … 240 203 LispObject hook = 241 204 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} ), 243 206 T); 244 207 } … … 274 237 try 275 238 { 276 result = thread.execute(Symbol.EVAL.getSymbolFunction(), object); 239 result = thread.execute(Symbol.EVAL.getSymbolFunction(), 240 new LispObject[] { object }); 277 241 } 278 242 catch (OutOfMemoryError e) … … 335 299 throws ConditionThrowable 336 300 { 337 return Symbol.ERROR.execute( condition);301 return Symbol.ERROR.execute(new LispObject[] { condition }); 338 302 } 339 303 … … 341 305 throws ConditionThrowable 342 306 { 343 return Symbol.ERROR.execute( condition, Keyword.FORMAT_CONTROL, message);307 return Symbol.ERROR.execute(new LispObject[] { condition, Keyword.FORMAT_CONTROL, message }); 344 308 } 345 309 … … 361 325 { 362 326 setInterrupted(false); 363 Symbol.BREAK.getSymbolFunction().execute( );327 Symbol.BREAK.getSymbolFunction().execute(new LispObject[0]); 364 328 setInterrupted(false); 365 329 } … … 466 430 throws ConditionThrowable 467 431 { 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(); 531 433 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++) 541 435 { 542 436 array[i] = eval(args.car(), env, thread); … … 783 677 thread._values = null; 784 678 if (values == null) 785 return thread.execute(coerceToFunction(function), result); 679 return thread.execute(coerceToFunction(function), 680 new LispObject[] { result }); 786 681 else 787 682 return funcall(coerceToFunction(function), values, thread); -
branches/fewer-executes/abcl/src/org/armedbear/lisp/LispObject.java
r11834 r11893 647 647 } 648 648 649 public LispObject execute() throws ConditionThrowable650 {651 return type_error(this, Symbol.FUNCTION);652 }653 654 public LispObject execute(LispObject arg) throws ConditionThrowable655 {656 return type_error(this, Symbol.FUNCTION);657 }658 659 public LispObject execute(LispObject first, LispObject second)660 throws ConditionThrowable661 {662 return type_error(this, Symbol.FUNCTION);663 }664 665 public LispObject execute(LispObject first, LispObject second,666 LispObject third)667 throws ConditionThrowable668 {669 return type_error(this, Symbol.FUNCTION);670 }671 672 public LispObject execute(LispObject first, LispObject second,673 LispObject third, LispObject fourth)674 throws ConditionThrowable675 {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 ConditionThrowable683 {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 ConditionThrowable691 {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 ConditionThrowable700 {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 ConditionThrowable709 {710 return type_error(this, Symbol.FUNCTION);711 }712 713 649 public LispObject execute(LispObject[] args) throws ConditionThrowable 714 650 { … … 719 655 public LispObject dispatch(LispObject[] args) throws ConditionThrowable 720 656 { 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); 747 658 } 748 659 -
branches/fewer-executes/abcl/src/org/armedbear/lisp/LispThread.java
r11754 r11893 586 586 } 587 587 588 @Override589 public LispObject execute(LispObject function) throws ConditionThrowable590 {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 @Override609 public LispObject execute(LispObject function, LispObject arg)610 throws ConditionThrowable611 {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 @Override630 public LispObject execute(LispObject function, LispObject first,631 LispObject second)632 throws ConditionThrowable633 {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 @Override652 public LispObject execute(LispObject function, LispObject first,653 LispObject second, LispObject third)654 throws ConditionThrowable655 {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 @Override674 public LispObject execute(LispObject function, LispObject first,675 LispObject second, LispObject third,676 LispObject fourth)677 throws ConditionThrowable678 {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 @Override702 public LispObject execute(LispObject function, LispObject first,703 LispObject second, LispObject third,704 LispObject fourth, LispObject fifth)705 throws ConditionThrowable706 {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 @Override731 public LispObject execute(LispObject function, LispObject first,732 LispObject second, LispObject third,733 LispObject fourth, LispObject fifth,734 LispObject sixth)735 throws ConditionThrowable736 {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 @Override762 public LispObject execute(LispObject function, LispObject first,763 LispObject second, LispObject third,764 LispObject fourth, LispObject fifth,765 LispObject sixth, LispObject seventh)766 throws ConditionThrowable767 {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 ConditionThrowable801 {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 830 588 public LispObject execute(LispObject function, LispObject[] args) 831 589 throws ConditionThrowable -
branches/fewer-executes/abcl/src/org/armedbear/lisp/LogicalPathname.java
r11754 r11893 100 100 version = Keyword.NEWEST; 101 101 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) }); 103 104 } else { 104 105 String t = rest; … … 140 141 throws ConditionThrowable 141 142 { 142 return (Pathname) Symbol.TRANSLATE_LOGICAL_PATHNAME.execute(pathname); 143 return (Pathname) Symbol.TRANSLATE_LOGICAL_PATHNAME 144 .execute(new LispObject[] { pathname }); 143 145 } 144 146 -
branches/fewer-executes/abcl/src/org/armedbear/lisp/MacroObject.java
r11711 r11893 49 49 50 50 @Override 51 public LispObject execute() throws ConditionThrowable52 {53 return error(new UndefinedFunction(name));54 }55 56 @Override57 public LispObject execute(LispObject arg) throws ConditionThrowable58 {59 return error(new UndefinedFunction(name));60 }61 62 @Override63 public LispObject execute(LispObject first, LispObject second)64 throws ConditionThrowable65 {66 return error(new UndefinedFunction(name));67 }68 69 @Override70 public LispObject execute(LispObject first, LispObject second,71 LispObject third)72 throws ConditionThrowable73 {74 return error(new UndefinedFunction(name));75 }76 77 @Override78 public LispObject execute(LispObject first, LispObject second,79 LispObject third, LispObject fourth)80 throws ConditionThrowable81 {82 return error(new UndefinedFunction(name));83 }84 85 @Override86 public LispObject execute(LispObject first, LispObject second,87 LispObject third, LispObject fourth,88 LispObject fifth)89 throws ConditionThrowable90 {91 return error(new UndefinedFunction(name));92 }93 94 @Override95 public LispObject execute(LispObject first, LispObject second,96 LispObject third, LispObject fourth,97 LispObject fifth, LispObject sixth)98 throws ConditionThrowable99 {100 return error(new UndefinedFunction(name));101 }102 103 @Override104 public LispObject execute(LispObject first, LispObject second,105 LispObject third, LispObject fourth,106 LispObject fifth, LispObject sixth,107 LispObject seventh)108 throws ConditionThrowable109 {110 return error(new UndefinedFunction(name));111 }112 113 @Override114 public LispObject execute(LispObject first, LispObject second,115 LispObject third, LispObject fourth,116 LispObject fifth, LispObject sixth,117 LispObject seventh, LispObject eighth)118 throws ConditionThrowable119 {120 return error(new UndefinedFunction(name));121 }122 123 @Override124 51 public LispObject execute(LispObject[] args) throws ConditionThrowable 125 52 { -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Primitive.java
r11488 r11893 94 94 } 95 95 96 @Override97 96 public LispObject execute() throws ConditionThrowable 98 97 { 99 LispObject[] args = new LispObject[0]; 100 return execute(args); 98 return error(new WrongNumberOfArgumentsException(this)); 101 99 } 102 100 103 @Override104 101 public LispObject execute(LispObject arg) throws ConditionThrowable 105 102 { 106 LispObject[] args = new LispObject[1]; 107 args[0] = arg; 108 return execute(args); 103 return error(new WrongNumberOfArgumentsException(this)); 109 104 } 110 105 111 @Override112 106 public LispObject execute(LispObject first, LispObject second) 113 107 throws ConditionThrowable 114 108 { 115 LispObject[] args = new LispObject[2]; 116 args[0] = first; 117 args[1] = second; 118 return execute(args); 109 return error(new WrongNumberOfArgumentsException(this)); 119 110 } 120 111 121 @Override122 112 public LispObject execute(LispObject first, LispObject second, 123 113 LispObject third) 124 114 throws ConditionThrowable 125 115 { 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)); 131 117 } 132 118 133 @Override134 119 public LispObject execute(LispObject first, LispObject second, 135 120 LispObject third, LispObject fourth) 136 121 throws ConditionThrowable 137 122 { 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)); 144 124 } 145 125 146 @Override147 126 public LispObject execute(LispObject first, LispObject second, 148 127 LispObject third, LispObject fourth, … … 150 129 throws ConditionThrowable 151 130 { 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)); 159 132 } 160 133 161 @Override162 134 public LispObject execute(LispObject first, LispObject second, 163 135 LispObject third, LispObject fourth, … … 165 137 throws ConditionThrowable 166 138 { 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)); 175 140 } 176 141 177 @Override178 142 public LispObject execute(LispObject first, LispObject second, 179 143 LispObject third, LispObject fourth, … … 182 146 throws ConditionThrowable 183 147 { 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)); 193 149 } 194 150 195 @Override196 151 public LispObject execute(LispObject first, LispObject second, 197 152 LispObject third, LispObject fourth, … … 200 155 throws ConditionThrowable 201 156 { 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)); 212 158 } 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 213 191 } -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Primitives.java
r11883 r11893 49 49 } 50 50 @Override 51 public LispObject execute(LispObject arg) throws ConditionThrowable52 {53 if (arg.numberp())54 return arg;55 return type_error(arg, Symbol.NUMBER);56 }57 @Override58 public LispObject execute(LispObject first, LispObject second)59 throws ConditionThrowable60 {61 return first.multiplyBy(second);62 }63 @Override64 51 public LispObject execute(LispObject[] args) throws ConditionThrowable 65 52 { … … 76 63 { 77 64 @Override 78 public LispObject execute() throws ConditionThrowable79 {80 return error(new WrongNumberOfArgumentsException(this));81 }82 @Override83 public LispObject execute(LispObject arg) throws ConditionThrowable84 {85 return Fixnum.ONE.divideBy(arg);86 }87 @Override88 public LispObject execute(LispObject first, LispObject second)89 throws ConditionThrowable90 {91 return first.divideBy(second);92 }93 @Override94 65 public LispObject execute(LispObject[] args) throws ConditionThrowable 95 66 { 67 if (args.length == 0) 68 return error(new WrongNumberOfArgumentsException(this)); 69 96 70 LispObject result = args[0]; 97 71 for (int i = 1; i < args.length; i++) … … 106 80 { 107 81 @Override 108 public LispObject execute() throws ConditionThrowable109 {110 return error(new WrongNumberOfArgumentsException(this));111 }112 @Override113 public LispObject execute(LispObject arg) throws ConditionThrowable114 {115 if (arg.realp())116 return arg;117 return type_error(arg, Symbol.REAL);118 }119 @Override120 public LispObject execute(LispObject first, LispObject second)121 throws ConditionThrowable122 {123 return first.isLessThan(second) ? first : second;124 }125 @Override126 82 public LispObject execute(LispObject[] args) throws ConditionThrowable 127 83 { 84 if (args.length == 0) 85 return error(new WrongNumberOfArgumentsException(this)); 128 86 LispObject result = args[0]; 129 87 if (!result.realp()) … … 143 101 { 144 102 @Override 145 public LispObject execute() throws ConditionThrowable146 {147 return error(new WrongNumberOfArgumentsException(this));148 }149 @Override150 public LispObject execute(LispObject arg) throws ConditionThrowable151 {152 if (arg.realp())153 return arg;154 return type_error(arg, Symbol.REAL);155 }156 @Override157 public LispObject execute(LispObject first, LispObject second)158 throws ConditionThrowable159 {160 return first.isGreaterThan(second) ? first : second;161 }162 @Override163 103 public LispObject execute(LispObject[] args) throws ConditionThrowable 164 104 { 105 if (args.length == 0) 106 return error(new WrongNumberOfArgumentsException(this)); 165 107 LispObject result = args[0]; 166 108 if (!result.realp()) … … 355 297 new Primitive(Symbol.VALUES, "&rest object") 356 298 { 357 @Override358 public LispObject execute()359 {360 return LispThread.currentThread().setValues();361 }362 @Override363 public LispObject execute(LispObject arg)364 {365 return LispThread.currentThread().setValues(arg);366 }367 @Override368 public LispObject execute(LispObject first, LispObject second)369 {370 return LispThread.currentThread().setValues(first, second);371 }372 @Override373 public LispObject execute(LispObject first, LispObject second,374 LispObject third)375 {376 return LispThread.currentThread().setValues(first, second, third);377 }378 @Override379 public LispObject execute(LispObject first, LispObject second,380 LispObject third, LispObject fourth)381 {382 return LispThread.currentThread().setValues(first, second, third,383 fourth);384 }385 299 @Override 386 300 public LispObject execute(LispObject[] args) … … 634 548 { 635 549 @Override 636 public LispObject execute()637 {638 return Fixnum.ZERO;639 }640 @Override641 public LispObject execute(LispObject arg) throws ConditionThrowable642 {643 if (arg.numberp())644 return arg;645 return type_error(arg, Symbol.NUMBER);646 }647 @Override648 public LispObject execute(LispObject first, LispObject second)649 throws ConditionThrowable650 {651 return first.add(second);652 }653 @Override654 public LispObject execute(LispObject first, LispObject second,655 LispObject third)656 throws ConditionThrowable657 {658 return first.add(second).add(third);659 }660 @Override661 550 public LispObject execute(LispObject[] args) throws ConditionThrowable 662 551 { … … 685 574 { 686 575 @Override 687 public LispObject execute() throws ConditionThrowable688 {689 return error(new WrongNumberOfArgumentsException(this));690 }691 @Override692 public LispObject execute(LispObject arg) throws ConditionThrowable693 {694 return arg.negate();695 }696 @Override697 public LispObject execute(LispObject first, LispObject second)698 throws ConditionThrowable699 {700 return first.subtract(second);701 }702 @Override703 576 public LispObject execute(LispObject[] args) throws ConditionThrowable 704 577 { 578 if (args.length == 0) 579 return error(new WrongNumberOfArgumentsException(this)); 580 if (args.length == 1) 581 return args[0].negate(); 705 582 LispObject result = args[0]; 706 583 for (int i = 1; i < args.length; i++) … … 944 821 { 945 822 @Override 946 public LispObject execute()947 {948 return NIL;949 }950 @Override951 public LispObject execute(LispObject arg)952 {953 return arg;954 }955 @Override956 public LispObject execute(LispObject first, LispObject second)957 throws ConditionThrowable958 {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 @Override976 public LispObject execute(LispObject first, LispObject second,977 LispObject third)978 throws ConditionThrowable979 {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 @Override1003 823 public LispObject execute(LispObject[] args) throws ConditionThrowable 1004 824 { 825 if (args.length == 0) 826 return NIL; 827 828 if (args.length == 1) 829 return args[0]; 830 1005 831 Cons result = null; 1006 832 Cons splice = null; … … 1047 873 { 1048 874 @Override 1049 public LispObject execute()1050 {1051 return NIL;1052 }1053 @Override1054 public LispObject execute(LispObject arg)1055 {1056 return arg;1057 }1058 @Override1059 public LispObject execute(LispObject first, LispObject second)1060 throws ConditionThrowable1061 {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 @Override1079 875 public LispObject execute(LispObject[] array) throws ConditionThrowable 1080 876 { 877 if (array.length == 0) 878 return NIL; 879 if (array.length == 1) 880 return array[0]; 881 1081 882 LispObject result = null; 1082 883 Cons splice = null; … … 1123 924 { 1124 925 @Override 1125 public LispObject execute() throws ConditionThrowable1126 {1127 return error(new WrongNumberOfArgumentsException(this));1128 }1129 @Override1130 public LispObject execute(LispObject arg)1131 {1132 return T;1133 }1134 @Override1135 public LispObject execute(LispObject first, LispObject second)1136 throws ConditionThrowable1137 {1138 return first.isEqualTo(second) ? T : NIL;1139 }1140 @Override1141 public LispObject execute(LispObject first, LispObject second,1142 LispObject third)1143 throws ConditionThrowable1144 {1145 if (first.isEqualTo(second) && second.isEqualTo(third))1146 return T;1147 else1148 return NIL;1149 }1150 @Override1151 926 public LispObject execute(LispObject[] array) throws ConditionThrowable 1152 927 { 928 if (array.length == 0) 929 return error(new WrongNumberOfArgumentsException(this)); 1153 930 final int length = array.length; 1154 931 final LispObject obj = array[0]; … … 1612 1389 if (currentSource == Keyword.TOP_LEVEL) 1613 1390 { 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 }); 1616 1393 1617 1394 } … … 1622 1399 try 1623 1400 { 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 }); 1626 1404 } 1627 1405 finally … … 1657 1435 if (definition instanceof Function) 1658 1436 { 1659 Symbol.FSET.execute(n ame, definition, NIL,1660 ((Function)definition).getLambdaList());1437 Symbol.FSET.execute(new LispObject[] { name, definition, NIL, 1438 ((Function)definition).getLambdaList() }); 1661 1439 return name; 1662 1440 } … … 2478 2256 new Primitive(Symbol.FUNCALL, "function &rest args") 2479 2257 { 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 2551 2260 @Override 2552 2261 public LispObject execute(LispObject[] args) throws ConditionThrowable 2553 2262 { 2554 2263 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); 2569 2267 } 2570 2268 }; … … 2575 2273 { 2576 2274 @Override 2577 public LispObject execute() throws ConditionThrowable2578 {2579 return error(new WrongNumberOfArgumentsException(this));2580 }2581 @Override2582 public LispObject execute(LispObject arg) throws ConditionThrowable2583 {2584 return error(new WrongNumberOfArgumentsException(this));2585 }2586 @Override2587 public LispObject execute(LispObject fun, LispObject args)2588 throws ConditionThrowable2589 {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 @Override2620 public LispObject execute(LispObject first, LispObject second,2621 LispObject third)2622 throws ConditionThrowable2623 {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 @Override2640 2275 public LispObject execute(final LispObject[] args) throws ConditionThrowable 2641 2276 { 2642 2277 final int numArgs = args.length; 2278 if (numArgs < 2) 2279 return error(new WrongNumberOfArgumentsException(this)); 2280 2643 2281 LispObject spread = args[numArgs - 1]; 2644 2282 if (spread.listp()) … … 2678 2316 else 2679 2317 return type_error(list, Symbol.LIST); 2680 LispObject obj = thread.execute(fun, cons.car);2318 LispObject obj = thread.execute(fun, new LispObject[] { cons.car }); 2681 2319 if (splice == null) 2682 2320 { … … 2706 2344 { 2707 2345 LispObject obj = 2708 thread.execute(fun, list1.car(), list2.car());2346 thread.execute(fun, new LispObject[] { list1.car(), list2.car() }); 2709 2347 if (splice == null) 2710 2348 { … … 2779 2417 else 2780 2418 return type_error(list, Symbol.LIST); 2781 thread.execute(fun, cons.car);2419 thread.execute(fun, new LispObject[] { cons.car }); 2782 2420 list = cons.cdr; 2783 2421 } … … 2794 2432 while (list1 != NIL && list2 != NIL) 2795 2433 { 2796 thread.execute(fun, list1.car(), list2.car());2434 thread.execute(fun, new LispObject[] { list1.car(), list2.car() }); 2797 2435 list1 = ((Cons)list1).cdr; 2798 2436 list2 = ((Cons)list2).cdr; … … 3424 3062 PACKAGE_SYS.intern("MAKE-EXPANDER-FOR-MACROLET"); 3425 3063 LispObject expander = 3426 make_expander_for_macrolet.execute( def);3064 make_expander_for_macrolet.execute(new LispObject[] { def }); 3427 3065 Closure expansionFunction = new Closure(expander, env); 3428 3066 MacroObject macroObject = … … 4577 4215 { 4578 4216 LispObject candidate = ((Cons)tail).car; 4579 if (test.execute( item, candidate) != NIL)4217 if (test.execute(new LispObject[] { item, candidate }) != NIL) 4580 4218 return tail; 4581 4219 tail = ((Cons)tail).cdr; … … 4588 4226 { 4589 4227 LispObject candidate = ((Cons)tail).car; 4590 if (testNot.execute( item, candidate) == NIL)4228 if (testNot.execute(new LispObject[] { item, candidate }) == NIL) 4591 4229 return tail; 4592 4230 tail = ((Cons)tail).cdr; … … 4599 4237 while (tail instanceof Cons) 4600 4238 { 4601 LispObject candidate = key.execute( ((Cons)tail).car);4239 LispObject candidate = key.execute(new LispObject[] { ((Cons)tail).car }); 4602 4240 if (test != NIL) 4603 4241 { 4604 if (test.execute( item, candidate) != NIL)4242 if (test.execute(new LispObject[] { item, candidate }) != NIL) 4605 4243 return tail; 4606 4244 } 4607 4245 else 4608 4246 { 4609 if (testNot.execute( item, candidate) == NIL)4247 if (testNot.execute(new LispObject[] { item, candidate }) == NIL) 4610 4248 return tail; 4611 4249 } … … 4628 4266 { 4629 4267 if (first != NIL) 4630 return LispThread.currentThread().execute( first, second);4268 return LispThread.currentThread().execute(new LispObject[] { first, second }); 4631 4269 return second; 4632 4270 } -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Profiler.java
r11488 r11893 93 93 if (object instanceof StandardGenericFunction) { 94 94 LispObject methods = 95 PACKAGE_MOP.intern("GENERIC-FUNCTION-METHODS").execute(object); 95 PACKAGE_MOP.intern("GENERIC-FUNCTION-METHODS") 96 .execute(new LispObject[] { object }); 96 97 while (methods != NIL) { 97 98 StandardMethod method = (StandardMethod) methods.car(); -
branches/fewer-executes/abcl/src/org/armedbear/lisp/ReaderMacroFunction.java
r11488 r11893 63 63 64 64 @Override 65 public LispObject execute(LispObject first, LispObject second)65 public LispObject execute(LispObject[] args) 66 66 throws ConditionThrowable 67 67 { 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]); 70 73 return execute(stream, c); 71 74 } -
branches/fewer-executes/abcl/src/org/armedbear/lisp/SimpleCondition.java
r11488 r11893 88 88 public LispObject execute(LispObject arg) throws ConditionThrowable 89 89 { 90 return Symbol.STD_SLOT_VALUE.execute( arg, Symbol.FORMAT_CONTROL);90 return Symbol.STD_SLOT_VALUE.execute(new LispObject[] { arg, Symbol.FORMAT_CONTROL }); 91 91 } 92 92 }; … … 99 99 public LispObject execute(LispObject arg) throws ConditionThrowable 100 100 { 101 return Symbol.STD_SLOT_VALUE.execute( arg, Symbol.FORMAT_ARGUMENTS);101 return Symbol.STD_SLOT_VALUE.execute(new LispObject[] { arg, Symbol.FORMAT_ARGUMENTS }); 102 102 } 103 103 }; -
branches/fewer-executes/abcl/src/org/armedbear/lisp/SlimeInputStream.java
r11488 r11893 97 97 try { 98 98 ostream.finishOutput(); 99 s = LispThread.currentThread().execute(f).getStringValue(); 99 s = LispThread.currentThread() 100 .execute(f, new LispObject[0]).getStringValue(); 100 101 } 101 102 catch (Throwable t) { -
branches/fewer-executes/abcl/src/org/armedbear/lisp/SlimeOutputStream.java
r11488 r11893 131 131 String s = stringWriter.toString(); 132 132 stringWriter.getBuffer().setLength(0); 133 LispThread.currentThread().execute(f, new SimpleString(s));133 LispThread.currentThread().execute(f, new LispObject[] { new SimpleString(s) }); 134 134 } 135 135 } -
branches/fewer-executes/abcl/src/org/armedbear/lisp/SlotClass.java
r11754 r11893 111 111 LispObject obj = ((StandardClass)c).getDirectDefaultInitargs(); 112 112 if (obj != NIL) 113 result = Symbol.APPEND.execute( result, obj);113 result = Symbol.APPEND.execute(new LispObject[] { result, obj }); 114 114 } 115 115 cpl = cpl.cdr(); -
branches/fewer-executes/abcl/src/org/armedbear/lisp/SpecialOperator.java
r11488 r11893 69 69 } 70 70 71 @Override72 71 public LispObject execute() throws ConditionThrowable 73 72 { … … 75 74 } 76 75 77 @Override78 76 public LispObject execute(LispObject arg) throws ConditionThrowable 79 77 { … … 81 79 } 82 80 83 @Override84 81 public LispObject execute(LispObject first, LispObject second) 85 82 throws ConditionThrowable … … 88 85 } 89 86 90 @Override91 87 public LispObject execute(LispObject first, LispObject second, 92 88 LispObject third) … … 96 92 } 97 93 98 @Override99 94 public LispObject execute(LispObject first, LispObject second, 100 95 LispObject third, LispObject fourth) … … 104 99 } 105 100 106 @Override107 101 public LispObject execute(LispObject first, LispObject second, 108 102 LispObject third, LispObject fourth, … … 113 107 } 114 108 115 @Override116 109 public LispObject execute(LispObject first, LispObject second, 117 110 LispObject third, LispObject fourth, … … 122 115 } 123 116 124 @Override125 117 public LispObject execute(LispObject first, LispObject second, 126 118 LispObject third, LispObject fourth, … … 132 124 } 133 125 134 @Override135 126 public LispObject execute(LispObject first, LispObject second, 136 127 LispObject third, LispObject fourth, … … 145 136 public LispObject execute(LispObject[] args) throws ConditionThrowable 146 137 { 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 } 148 164 } 149 165 -
branches/fewer-executes/abcl/src/org/armedbear/lisp/StandardClass.java
r11711 r11893 74 74 if (layout == null) 75 75 { 76 Symbol.ERROR.execute(Symbol.SIMPLE_ERROR, 76 Symbol.ERROR.execute( 77 new LispObject[] { Symbol.SIMPLE_ERROR, 77 78 Keyword.FORMAT_CONTROL, 78 79 new SimpleString("No layout for class ~S."), 79 80 Keyword.FORMAT_ARGUMENTS, 80 list(this) );81 list(this) }); 81 82 } 82 83 return new StandardObject(this, layout.getLength()); -
branches/fewer-executes/abcl/src/org/armedbear/lisp/StandardGenericFunction.java
r11754 r11893 126 126 127 127 @Override 128 public LispObject execute() throws ConditionThrowable129 {130 return function.execute();131 }132 133 @Override134 public LispObject execute(LispObject arg) throws ConditionThrowable135 {136 return function.execute(arg);137 }138 139 @Override140 public LispObject execute(LispObject first, LispObject second)141 throws ConditionThrowable142 {143 return function.execute(first, second);144 }145 146 @Override147 public LispObject execute(LispObject first, LispObject second,148 LispObject third)149 throws ConditionThrowable150 {151 return function.execute(first, second, third);152 }153 154 @Override155 public LispObject execute(LispObject first, LispObject second,156 LispObject third, LispObject fourth)157 throws ConditionThrowable158 {159 return function.execute(first, second, third, fourth);160 }161 162 @Override163 public LispObject execute(LispObject first, LispObject second,164 LispObject third, LispObject fourth,165 LispObject fifth)166 throws ConditionThrowable167 {168 return function.execute(first, second, third, fourth,169 fifth);170 }171 172 @Override173 public LispObject execute(LispObject first, LispObject second,174 LispObject third, LispObject fourth,175 LispObject fifth, LispObject sixth)176 throws ConditionThrowable177 {178 return function.execute(first, second, third, fourth,179 fifth, sixth);180 }181 182 @Override183 public LispObject execute(LispObject first, LispObject second,184 LispObject third, LispObject fourth,185 LispObject fifth, LispObject sixth,186 LispObject seventh)187 throws ConditionThrowable188 {189 return function.execute(first, second, third, fourth,190 fifth, sixth, seventh);191 }192 193 @Override194 public LispObject execute(LispObject first, LispObject second,195 LispObject third, LispObject fourth,196 LispObject fifth, LispObject sixth,197 LispObject seventh, LispObject eighth)198 throws ConditionThrowable199 {200 return function.execute(first, second, third, fourth,201 fifth, sixth, seventh, eighth);202 }203 204 @Override205 128 public LispObject execute(LispObject[] args) throws ConditionThrowable 206 129 { -
branches/fewer-executes/abcl/src/org/armedbear/lisp/StandardObject.java
r11754 r11893 162 162 { 163 163 StringOutputStream stream = new StringOutputStream(); 164 Symbol.PRINT_OBJECT.execute( this, stream);164 Symbol.PRINT_OBJECT.execute(new LispObject[] { this, stream }); 165 165 return stream.getString().getStringValue(); 166 166 } … … 236 236 Debug.assertTrue(!layout.isInvalid()); 237 237 // 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 }); 240 240 return newLayout; 241 241 } … … 374 374 { 375 375 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 }); 378 379 LispThread.currentThread()._values = null; 379 380 } … … 424 425 final LispThread thread = LispThread.currentThread(); 425 426 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 }); 428 430 // "If SLOT-MISSING is invoked and returns a value, a boolean 429 431 // equivalent to its primary value is returned by SLOT-BOUNDP." … … 453 455 LispObject location = layout.getSharedSlotLocation(slotName); 454 456 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 }); 457 460 value = location.cdr(); 458 461 } 459 462 if (value == UNBOUND_VALUE) 460 463 { 461 value = Symbol.SLOT_UNBOUND.execute(getLispClass(), this, slotName); 464 value = Symbol.SLOT_UNBOUND 465 .execute(new LispObject[] { getLispClass(), this, slotName }); 462 466 LispThread.currentThread()._values = null; 463 467 } -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Stream.java
r11783 r11893 539 539 return ((ReaderMacroFunction)handler).execute(this, c); 540 540 if (handler != null && handler != NIL) 541 return handler.execute( this, LispCharacter.getInstance(c));541 return handler.execute(new LispObject[] { this, LispCharacter.getInstance(c) }); 542 542 return readToken(c, rt); 543 543 } … … 597 597 PACKAGE_SYS.intern("DEFSTRUCT-DEFAULT-CONSTRUCTOR"); 598 598 LispObject constructor = 599 DEFSTRUCT_DEFAULT_CONSTRUCTOR.getSymbolFunctionOrDie().execute( structure);599 DEFSTRUCT_DEFAULT_CONSTRUCTOR.getSymbolFunctionOrDie().execute(new LispObject[] { structure }); 600 600 final int length = args.length(); 601 601 if ((length % 2) != 0) … … 645 645 PACKAGE_SYS.intern("DEFSTRUCT-DEFAULT-CONSTRUCTOR"); 646 646 LispObject constructor = 647 DEFSTRUCT_DEFAULT_CONSTRUCTOR.getSymbolFunctionOrDie().execute( structure);647 DEFSTRUCT_DEFAULT_CONSTRUCTOR.getSymbolFunctionOrDie().execute(new LispObject[] { structure }); 648 648 final int length = args.length(); 649 649 if ((length % 2) != 0) … … 793 793 { 794 794 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) }); 797 798 LispObject[] values = thread._values; 798 799 if (values != null && values.length == 0) -
branches/fewer-executes/abcl/src/org/armedbear/lisp/StructureObject.java
r11754 r11893 404 404 LispObject fun = PRINT_RESTART.getSymbolFunction(); 405 405 StringOutputStream stream = new StringOutputStream(); 406 thread.execute(fun, this, stream);406 thread.execute(fun, new LispObject[] { this, stream }); 407 407 return stream.getString().getStringValue(); 408 408 } … … 447 447 StringOutputStream stream = new StringOutputStream(); 448 448 thread.execute(Symbol.OUTPUT_OBJECT.getSymbolFunction(), 449 slots[i], stream);449 new LispObject[] { slots[i], stream }); 450 450 sb.append(stream.getString().getStringValue()); 451 451 } -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Symbol.java
r11754 r11893 715 715 716 716 @Override 717 public LispObject execute() throws ConditionThrowable718 {719 try720 {721 return function.execute();722 }723 catch (NullPointerException e)724 {725 return handleNPE(e, NIL);726 }727 }728 729 @Override730 public LispObject execute(LispObject arg) throws ConditionThrowable731 {732 try733 {734 return function.execute(arg);735 }736 catch (NullPointerException e)737 {738 return handleNPE(e, list(arg));739 }740 }741 742 @Override743 public LispObject execute(LispObject first, LispObject second)744 throws ConditionThrowable745 {746 try747 {748 return function.execute(first, second);749 }750 catch (NullPointerException e)751 {752 return handleNPE(e, list(first, second));753 }754 }755 756 @Override757 public LispObject execute(LispObject first, LispObject second,758 LispObject third)759 throws ConditionThrowable760 {761 try762 {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 @Override772 public LispObject execute(LispObject first, LispObject second,773 LispObject third, LispObject fourth)774 throws ConditionThrowable775 {776 try777 {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 @Override787 public LispObject execute(LispObject first, LispObject second,788 LispObject third, LispObject fourth,789 LispObject fifth)790 throws ConditionThrowable791 {792 try793 {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 @Override803 public LispObject execute(LispObject first, LispObject second,804 LispObject third, LispObject fourth,805 LispObject fifth, LispObject sixth)806 throws ConditionThrowable807 {808 try809 {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 @Override820 public LispObject execute(LispObject first, LispObject second,821 LispObject third, LispObject fourth,822 LispObject fifth, LispObject sixth,823 LispObject seventh)824 throws ConditionThrowable825 {826 try827 {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 @Override840 public LispObject execute(LispObject first, LispObject second,841 LispObject third, LispObject fourth,842 LispObject fifth, LispObject sixth,843 LispObject seventh, LispObject eighth)844 throws ConditionThrowable845 {846 try847 {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 @Override860 717 public LispObject execute(LispObject[] args) throws ConditionThrowable 861 718 { … … 878 735 if (function == null) 879 736 return LispThread.currentThread().execute(Symbol.UNDEFINED_FUNCTION_CALLED, 880 this, args);737 new LispObject[] { this, args }); 881 738 Debug.trace(e); 882 739 return error(new LispError("Null pointer exception")); -
branches/fewer-executes/abcl/src/org/armedbear/lisp/Time.java
r11714 r11893 87 87 try 88 88 { 89 return arg.execute( );89 return arg.execute(new LispObject[0]); 90 90 } 91 91 finally -
branches/fewer-executes/abcl/src/org/armedbear/lisp/ZeroRankArray.java
r11711 r11893 149 149 StringOutputStream stream = new StringOutputStream(); 150 150 thread.execute(Symbol.OUTPUT_OBJECT.getSymbolFunction(), 151 data, stream);151 new LispObject[] { data, stream }); 152 152 sb.append(stream.getString().getStringValue()); 153 153 } else
Note: See TracChangeset
for help on using the changeset viewer.