Project

Profile

Help

Bug #3974

closed

Configuration options for generating bytecode

Added by Michael Kay over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Byte code generation
Sprint/Milestone:
-
Start date:
2018-10-14
Due date:
% Done:

100%

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

Description

Within BytecodeCandidate.targetExpression(), the decision whether or not to generate bytecode depends on the setting of configuration.isGenerateByteCode(Configuration.XSLT).

This is wrong for a number of reasons:

(a) the code is executed in XQuery as well as XSLT

(b) the decision whether or not bytecode generation is enabled has already been made when injecting a ByteCodeCandidate into the expression tree; there is no need for a further check at this stage

(c) the option is not switched at configuration level anyway, but at the level of an XsltCompiler or XQueryCompiler.

The simplest solution is just to remove this check.

However, I think we may need further thought for the case where a stylesheet is loaded from an export file. At present in this situation I suspect we are not generating bytecode at all. That may be a separate issue.

Actions #1

Updated by Michael Kay over 3 years ago

  • Status changed from New to In Progress
  • Applies to branch 9.8, 9.9 added
  • Fix Committed on Branch 9.8, 9.9 added

There seems to be quite a complex story here. It looks to me (subject to confirmation) as if:

  • In XSLT, if bytecode generation is enabled, then we generate ByteCodeCandidate expressions at appropriate points in the code, and these cause bytecode to be generated if and when the relevant section of code is executed often enough to trigger it.

  • In XQuery, we generate ByteCodeCandidates for the main query expression, but for function bodies, we generate bytecode unconditionally, and for global variables, we do not generate bytecode at all.

For code that is reloaded from SEF files, I don't think we currently generate bytecode.

The test within ByteCodeCandidate.targetExpression on config.isGenerateByteCode(XSLT) is redundant for XSLT, and potentially damaging for XQuery because it means bytecode will not be generated for the main XQuery expression if the user has an EEQ license only. Removing this call seems simple and safe, though it's possibly not the end of the story. I will remove this call for both 9.8 and 9.9.

Actions #2

Updated by Michael Kay over 3 years ago

  • Status changed from In Progress to Resolved

I've made further changes (for 9.9 only) so that hotspot bytecode generation now applies also to the body of an XQuery user-defined function.

Actions #3

Updated by O'Neil Delpratt over 3 years ago

  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.8.0.15 added

Bug fix applied in the Saxon 9.8.0.15 maintenance release. Leave open to the Saxon 9.9 maintenance release.

Actions #4

Updated by O'Neil Delpratt over 3 years ago

  • Status changed from Resolved to Closed
  • Fixed in Maintenance Release 9.9.0.2 added

Bug fix applied in the Saxon 9.9.0.2 maintenance release.

Please register to edit this issue

Also available in: Atom PDF