is never 0, and make the memset-to-zero required for these assertions be
#ifdef NS_DEBUG.
- Extend FastLoad file format to encode a singleton flag in the high bit of
nsFastLoadSharpObjectInfo.mWeakRefCnt. The updater code needs to test this
bit in order to deserialize a singleton that was not read by the updater's
reader during this FastLoad episode. Otherwise the updater is likely to
reserialize the singleton, leading to multiple entries in the object map
for the same object, and UMRs when loading from the writer's object map
enumeration (objvec) in nsFastLoadFileWriter::WriteFooter.
- Remove bogus assertion that worked only when an XPCOM data structure being
serialized was still alive at the time the writer closed. In general, there
is no relationship between the strong ref-counts in a FastLoad file and the
XPCOM refcnts in memory at close time.
- Bug 189832, r=jrgm, sr=ben, a=dbaron.
git-svn-id: svn://10.0.0.236/trunk@137872 18797224-902f-48f8-a5cc-f745e15eee43
I also added explicit flags to Parser: languageVersion and allowMemberExprAsFunctionName and set them from Context. In this way Parser can be used without Context which is useful for debugging.
git-svn-id: svn://10.0.0.236/trunk@137861 18797224-902f-48f8-a5cc-f745e15eee43
1. It is not passed as a parameter to Interpreter/Codegen, instead Codegen access it directly when necessary.
2. ClassNameHelper.reset method is removed as inherently thread unsafe and data that should be used during compilation of single script is stored in Codegen itself.
3. Instead of a special DefaultClassRepository null is used to indicate that generated classes should not be stored and JavaAdapter is modified to take ClassRepository as a parameter, not ClassNameHelper.
git-svn-id: svn://10.0.0.236/trunk@137850 18797224-902f-48f8-a5cc-f745e15eee43
PreorderNodeIterator iter = new PreorderNodeIterator();
for (iter.start(tree); !iter.done(); iter.next()) {
Node node = iter.getCurrent();
...
}
instead of
PreorderNodeIterator iter = tree.getPreorderIterator();
Node node;
while ((node = iter.nextNode()) != null) {
}
to allow for more flexible usage and added PreorderNodeIterator.nextSkipSubtree to skip iteration of the last visited node subtree which allows to have simple code in Optimizer.buildStatementList when iterating over statements.
git-svn-id: svn://10.0.0.236/trunk@137846 18797224-902f-48f8-a5cc-f745e15eee43
The bug caused by a missed check in StmtNodeIterator.nextNode for a possible null result of findFirstInterestingNode inside the search loop which made search to stop preliminary with non-empty stack.
The changes fixe this and integrate StmtNodeIterator into
Optimizer.buildStatementList as StmtNodeIterator was used only by
buildStatementList and the new version is simpler.
git-svn-id: svn://10.0.0.236/trunk@137845 18797224-902f-48f8-a5cc-f745e15eee43
not work under MKS Korn shell on Windows XP. Replaced it by the equivalent
construct "while read ... do ... done < ${file}".
git-svn-id: svn://10.0.0.236/trunk@137841 18797224-902f-48f8-a5cc-f745e15eee43
in favor of a slot specific latency test (already done by pk11wrap code).
git-svn-id: svn://10.0.0.236/trunk@137837 18797224-902f-48f8-a5cc-f745e15eee43
This has the added benifit that the version will appear at the top of each .html (and the top of each page on the .pdf version generated by tldp.org).
git-svn-id: svn://10.0.0.236/trunk@137833 18797224-902f-48f8-a5cc-f745e15eee43
The reason for the bug was that omj/optimizer/Optimizer.java when optimizing code for this[name] (see GETELEM switch, line 665) assumed a number context for GETELEM index node unconditionally which is wrong.
The fix uses number context only if [] argument is known for sure to be a number.
git-svn-id: svn://10.0.0.236/trunk@137832 18797224-902f-48f8-a5cc-f745e15eee43
The bug was caused by a double call to Codegen.addNumberConstant, the first
time correctly from Codegen.visitLiteral and the second time wrongfully from
the loop in emitConstantDudeInitializers where loop index should be used
instead of calling addNumberConstant. As addNumberConstant would return the
same index for same numbers, the bug surfaces only with NaN as
addNumberConstant does not recognizes already added NaN. The bug also visible
only with optimization set to 1 or higher since only then constant folding can
produce NaN literal.
The fix removes the second call to addNumberConstant and uses
ScriptRuntime.NaNobj for NaNs.
git-svn-id: svn://10.0.0.236/trunk@137831 18797224-902f-48f8-a5cc-f745e15eee43
The reason for the bug is that emitDirectConstructor generates code to call
setPrototype twice instead of setPrototype/setParentScope pair during new JS
object construction. The fix replaces that setup by a single call to
BaseFunction.createObject which is used by Interpreter as well.
git-svn-id: svn://10.0.0.236/trunk@137828 18797224-902f-48f8-a5cc-f745e15eee43
Integration of LineBuffer into TokenStream code which now uses a special buffer for unreading of several chars to follow SM more closely. In this way there is no problem with a possible backtracking of 3 chars on failed attempt to match <!-- at the last minus.
TokenStream is also modified to accept a string with a source directly which avoids the need to construct intermediate StringReader in Context and allows to remove DebugReader class which is replaced by a simple function to read all Reader data into string.
git-svn-id: svn://10.0.0.236/trunk@137816 18797224-902f-48f8-a5cc-f745e15eee43
Codegen.visitRegularCall should not try to apply the simple call optimization
when firstArgDone is true indicating directly called function. The patch also
replaces generation of code to call new Object[0] by loading the
ScripRuntime.emptyArgs field.
git-svn-id: svn://10.0.0.236/trunk@137815 18797224-902f-48f8-a5cc-f745e15eee43