Project

Profile

Help

Bug #4044

closed

Tail call optimization of xsl:call-template with bytecode generation

Added by Michael Kay over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2018-11-20
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.9
Fix Committed on Branch:
9.9
Fixed in Maintenance Release:
Platforms:

Description

Test case xslt30extra/opt-025 fails (with a StackOverflow) when run with bytecode:1 which forces bytecode generation

Actions #1

Updated by Michael Kay over 5 years ago

Note also, the failure only occurs with export:off.

Actions #2

Updated by Michael Kay over 5 years ago

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.

Actions #3

Updated by Michael Kay over 5 years ago

  • 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).

Actions #4

Updated by O'Neil Delpratt about 5 years ago

  • % 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.

Actions #5

Updated by O'Neil Delpratt about 5 years ago

  • Status changed from Resolved to Closed

Please register to edit this issue

Also available in: Atom PDF