From cb93f4c02a9d6fc368b32ad1c7838b4347ae4703 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Wed, 2 Dec 2020 14:56:38 -0500 Subject: [PATCH] [DEV-8947] Guided TCO: Reassign argument values after processing all expressions I did say it was _experimental_ guided TRO. This waits to perform the actual argument reassignment until after processing the expressions associated with the new arguments, since they will otherwise be replaced when their original values are still needed. --- RELEASES.md | 11 ++++++++ src/current/compiler/js-calc.xsl | 45 +++++++++++++++++++++----------- 2 files changed, 41 insertions(+), 15 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index 317a62de..7571ffa3 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -13,6 +13,17 @@ TAME developers: Add new changes under a "NEXT" heading as part of the commits that introduce the changes. To make a new release, run `tools/mkrelease`, which will handle updating the heading for you. +NEXT +==== +This release provides tail-call optimizations aimed at the query system in +core. + +Compiler +-------- +- [bugfix] Recursive calls using TCO will wait to overwrite their function + arguments until all expressions calculating the new argument values have + completed. + v17.6.5 (2020-12-03) ==================== This release improves Summary Page performance when populating the page with diff --git a/src/current/compiler/js-calc.xsl b/src/current/compiler/js-calc.xsl index dc375f58..a21b0b4a 100644 --- a/src/current/compiler/js-calc.xsl +++ b/src/current/compiler/js-calc.xsl @@ -960,27 +960,42 @@ + (/*TCO*/function(){ + - + + - - + + - - - - - , - + + + + + + + + + + ; + + + + + - 0 + return 0;})()