From 26b1bdacecb39242c93810cc4714d177e72b4de6 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Tue, 14 Jul 2020 16:50:08 -0400 Subject: [PATCH] Experimental guided TCO This implements TCO in the XSLT compiler by requiring a human to manually indicate when a recursive call is in tail position. This was somewhat urgently needed to resolve stack exhaustion on large rate tables. TAMER will do this properly by determining itself whether a call is in tail position. Until then, this will serve as a test for this type of feature. --- RELEASES.md | 14 ++++ src/current/compiler/js-calc.xsl | 88 +++++++++++++++++++++++++- src/current/compiler/js.xsl | 27 +++++++- src/current/include/preproc/expand.xsl | 1 + 4 files changed, 127 insertions(+), 3 deletions(-) diff --git a/RELEASES.md b/RELEASES.md index a14f684c..f7c0900f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -14,6 +14,20 @@ commits that introduce the changes. To make a new release, run `tools/mkrelease`, which will handle updating the heading for you. +NEXT +==== +Compiler +-------- +- Experimental guided tail call optimizations (TCO) added to XSLT-based + compiler, allowing a human to manually indicate recursive calls in tail + position. + - This is undocumented and should only be used by `tame-core`. The + experimental warning will be removed in future releases if the behavior + proves to be sound. + - TAMER will add support for proper tail calls that will be detected + automatically. + + v17.4.3 (2020-07-02) ==================== This release fixes a bug caused by previous refactoring that caused diff --git a/src/current/compiler/js-calc.xsl b/src/current/compiler/js-calc.xsl index 245d4c8d..dc375f58 100644 --- a/src/current/compiler/js-calc.xsl +++ b/src/current/compiler/js-calc.xsl @@ -854,7 +854,7 @@ @return generated function application --> -