-
-
Notifications
You must be signed in to change notification settings - Fork 50
Optimize non-tailrec recursive function calls #561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Static analysis reportLizard reportListing only functions with cyclomatic complexity >= 15 or NLOC >= 100 or parameters >= 6.
Report about files you didn't modify in this PR
CppCheck report
Report files about files you didn't modify in this PR
|
CodSpeed Performance ReportMerging #561 will improve performances by 21.04%Comparing Summary
Benchmarks breakdown
|
Fuzzing report/usr/local/bin/afl-whatsup status check tool for afl-fuzz by Michal Zalewski Summary statsCycles without finds : 0 [+] Captured 47587 tuples (map size 215734, highest value 255, total values 375296925) in '/dev/null'. |
…_CURRENT_PAGE super instruction to avoid a local variable lookup when performing a recursive non-tail call
47b6204 to
804553f
Compare
Description
This adds a new instruction, GET_CURRENT_PAGE_ADDRESS that pushes the current page address to the stack, and CALL_CURRENT_PAGE super instruction, to call the current page (without popping from the stack) with a given number of arguments.
Both instructions set the
context.last_symbolaccordingly.The ASTLowerer can now optimize those non-tailrec recursive calls, to remove the unneeded
VM::callWe can just call
VM::callwithout a pointer to aValue, passing a non-zero page address, andVM:callwill skip superfluous checks and stack manipulation.Checklist