Bug #4044
closed
Tail call optimization of xsl:call-template with bytecode generation
Fix Committed on Branch:
9.9
Fixed in Maintenance Release:
Description
Test case xslt30extra/opt-025 fails (with a StackOverflow) when run with bytecode:1 which forces bytecode generation
Note also, the failure only occurs with export:off.
In 9.8, bytecode generation is not attempted for a template that is marked as tail-recursive. This means the interpreted code is used, and interpreted tail-call optimization kicks in. In 9.9, bytecode generation is attempted but generates code without tail call optimization.
- Status changed from New to Resolved
- Fix Committed on Branch 9.9 added
I made some unsuccessful attempts to compile code for an optimized tail call, but it's more difficult than I thought -- we have to generate a processLeavingTail() method instead of a process() method, so it all gets quite complicated.
Instead I have reverted to what 9.8 did: if the template body is tail-recursive, then we don't wrap the body in a ByteCodeCandidate and therefore bytecode doesn't get generated for the template body as a whole (or for the call-template instruction in particular).
- % Done changed from 0 to 100
- Fixed in Maintenance Release 9.9.1.1 added
Bug fix applied to the Saxon 9.9.1.1 maintenance release.
- Status changed from Resolved to Closed
Please register to edit this issue
Also available in: Atom
PDF