Implement Tail Call Optimize into ReturnCall Instruction#400
Implement Tail Call Optimize into ReturnCall Instruction#400makachanm wants to merge 10 commits intoSamsung:mainfrom
Conversation
|
Please run |
|
I applied. thanks. |
zherczeg
left a comment
There was a problem hiding this comment.
This sounds like a good idea. I would simplify the parameter storing: the parameters are simply stored in a linear buffer, and copied by a memcpy.
|
Parameters are stored in a linear area: Then the tco buffer could be copied here without changes. |
|
I'll rework parameter recover code with memcpy and Walrus's own vector implementation. Thanks for the feedback. |
|
I think lack of JIT version of TCO implement causes CI failure. I'll seperate it for future works. |
|
I've verified that all tests in the walrus suite are passing in the x64 local machine at interpret mode. |
|
There is a conflict in |
67bc7f8 to
daa44c1
Compare
|
CI is failing when Clang compiler is used. I had no problem with GCC. |
|
Lastly, have you been able to test this patch for recursive tail calls? |
I'll do it through recursive fibonacci test. Thanks for the mention. |
|
I found fibonacci test makes call stack exhaustion. I'm analyzing what's problem with. |
|
Yup it passes 10000-depth fibonacci test without problems. I'll add new edge-case logic into it. |
|
One more, this patch doesn't consider exceptions. |
|
I found some inconsistency in parameter space. Copy to callee can be not a problem, but Copy from caller is making some corruption into buffer value. I changed it does manually copy data one by one. |
I implemented a tail call optimize into WebAssembly 3's ReturnCall recursive instruction.
It currently unfinished, (the issue with type checking in the standard's spec, indirect call is not completed..) but it passes Return Call Test code.