/[Apache-SVN]
ViewVC logotype

Revision 528589


Jump to revision: Previous Next
Author: zongaro
Date: Fri Apr 13 18:50:56 2007 UTC (16 years, 11 months ago)
Changed paths: 3
Log Message:
Patch for XALANJ-2377

VariableBase.removeReference was effectively being used to decrement a reference
counter for local variables.

At one time, XSLTC used to release JVM stack slots as soon as the last
reference to a local variable occurred, but that resulted in a bug if loops
were involved.  So the code was changed to release a local variable slot only
when the containing construct went out of scope - this was done with a call to
VariableBase.unmapRegister from SytaxTreeNode.translateContents.

However, VariableBase.unmapRegister still contained a vestige of the old
reference counting code - it was checking whether any references to the variable
still existed.  In the presence of "Closures," the number of calls to
VariableBase.addReference did not equal the number of calls to
VariableBase.removeReference (for no good reason), so the variable was not
marked by VariableBase.unmapRegister as going out of scope.  This caused later
problems for outlining in org.apache.xalan.xsltc.compiler.util.MethodGenerator.

The fix is to remove VariableBase.removeReference, since XSLTC should no longer
on that to determine whether it can release a variable slot.  The
VariableBase.addReference method remains, however, because XSLTC uses that to
determine whether a variable can be discarded completely.


Reviewed by Christine Li (jycli () ca ! ibm ! com).


Changed paths

Path Details
Directoryxalan/java/trunk/src/org/apache/xalan/xsltc/compiler/ParameterRef.java modified , text changed
Directoryxalan/java/trunk/src/org/apache/xalan/xsltc/compiler/VariableBase.java modified , text changed
Directoryxalan/java/trunk/src/org/apache/xalan/xsltc/compiler/VariableRef.java modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26