Mantis - Squeak
Viewing Issue Advanced Details
2918 Compiler feature always 02-19-06 15:37 06-28-06 01:17
new 3.9  
0002918: number of args for message sends can be extended to 31
Dan Ingalls mail to squeak-dev:

|There is no fix for this problem. In Squeak, the number of parameters for a method invocation is
|limited to 15.

I think there may be a relatively simple solution for extending the number of arguments to 31. I realize that it is only a factor of two, and folks may consider it not worth worrying about this unless all limits are to be relieved but, if I'm correct, I'd be remiss if I didn't point this out.

 It looks to me like the method headers can take another bit of argCount as is, and the double-extended-do-anything bytecode can specify up to 31 arguments on a send. I added the DEDA bytecode for other reasons, and may just never have bothered extending argcount at the time, figuring such code is, um, not generally found in Smalltalk programs.

So if I'm not mistaken about the argCount bits in the method header and the DEDA bytecode, all that remains is a bit of compiler work and a few methods in CompiledMethod which shouldn't add up to more than an hour or two for someone who knows the territory.
 ByteCodeLimit-workaround-prereq.1.cs [^] (7,867 bytes) 06-28-06 01:13
 ByteCodeLimit-workaround-core.1.cs [^] (9,299 bytes) 06-28-06 01:13
 ByteCodeLimit-workaround-test.1.cs [^] (866 bytes) 06-28-06 01:14

nicolas cellier   
06-28-06 01:17   
Maybe there is room in bytecodes for 31 arguments, but i did not see any in CompiledMethod header... and as far as i understand, it would need vm hacking.

I propose another approach: transparently compile the bytecode passing a single array of arguments.

I have a patch working correctly yet, but load order is important
1) prereq
2) core
3) test

TODO: make debugger and decompiler work also (they are not aware of the single array argument trick)