Yes, this is a contradiction, but it is still not very important.
In addition, the number of arguments in methods is also limited by the maximum number of temporary variables in the method, which in most Smalltalks is 2^8-1 .
There is another part:
In Squeak, the number of arguments is actually limited to 15 ( 2^4-1 ), and also has only a space (4 bits) in the method header. A Squeak CompiledMethod comment says:
(index 18) 6 bits: number of temporary variables (
with #numTemps , including the number of arguments.
In short, yes, doubleExtendedSendBytecode can encode more arguments than the actual expression in CompiledMethod .
This is one of the reasons why it was replaced in Squeak with doubleExtendedDoAnything bytecode that can do more than just send, but limits the number of arguments 2^5-1 (which is even more than CompiledMethod can encode, but it is unlikely that CompiledMethod will change the encoding of more than 15 arguments in the foreseeable future).
source share