[ANN] methods with more than 15 arguments do now compile and execute

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ANN] methods with more than 15 arguments do now compile and execute

Nicolas Cellier-3
I finally decided to implement the work around for getting over the 15
arguments byte code limit.

I now have this test working correctly in my image:

test17args
  self class compile: 'a1: a1 a2: a2 a3: a3 a4: a4 a5: a5 a6: a6 a7: a7 a8: a8
     a9: a9 a10: a10 a11: a11 a12: a12 a13: a13 a14: a14 a15: a15 a16: a16
     a17: a17
    ^a1+a2+a3+a4+a5+a6+a7+a8+a9+a10+a11+a12+a13+a14+a15+a16+a17'.
  self assert: (self a1:1 a2:2 a3:3 a4:4 a5:5 a6:6 a7:7 a8:8
    a9:9 a10:10 a11:11 a12:12 a13:13 a14:14 a15:15 a16:16 a17:17) = (17*18/2).

I simply implement the caller as sending a single argument array (thanks to
BraceNode) and the callee to also have a single array argument and access
individual arguments sending at: to the array argument (thanks to
MessageAsTempNode subclass created on purpose).

The change is only for 3.9 old compiler (Parser/Encoder/MessageNode), and
remains quite cosmetic (few lines added).

But how tricky this old compiler is programmed, this should be much easier
with the newCompiler (i hope so).

Of course, decompiler debugger tiles etc... are broken when they encounter
this kind of method... They need hacking too.
FFI with more than 15 arguments will also have to be hacked, but this one is
easier.

I did not much like the sap returned when inquiring pattern and created a
SmalltalkPattern class to handle selector/arguments/precedence and also all
tricks related to 16 args. That should ease things.

when code is stabilized i will put on mantis because it is general purpose.

Nicolas