2. Hashtable is replaced by ObjToIntMap or UintMap to minimize memory usage.
3. Converting of strings to utf8 encoding is coded explicitly to avoid overhead of creating many objects.
git-svn-id: svn://10.0.0.236/trunk@139378 18797224-902f-48f8-a5cc-f745e15eee43
2. Removal of Codegen.superClassSlashName field since Codegen.superSlashName since it is never used as a part of a signature and ClassFileWriter converts . into / in type name automatically.
git-svn-id: svn://10.0.0.236/trunk@139262 18797224-902f-48f8-a5cc-f745e15eee43
Thanks to John Morrison <jrgm@netscape.com> for the patch.
Bug #196633 r=cls sr=brendan
git-svn-id: svn://10.0.0.236/trunk@139235 18797224-902f-48f8-a5cc-f745e15eee43
- call the JSRuntime's checkObjectAccess callback, if configured, for each
get or set that invokes a user-defined function (a user-defined function is
a scripted or native function object, not a native JSPropertyOp C function).
The value passed as an in-out parameter in *vp is the function object, so
the callback could, e.g., clone function objects and configure them with
different parent objects, if that helped import them into a trust domain.
- Fix a long-standing bug that broke the deprecated, old-style, and rarely-
used top-level getter/setter function declaration form:
getter function f() { return ++x; }
setter function f(y) { return x = y; }
We want js_CheckRedeclaration to complain only if a permanent getter is
being redefined by another getter, likewise for a setter -- but not when
(as above) a setter is being added to a top-level object for the same id
as a pre-existing getter (or vice versa).
git-svn-id: svn://10.0.0.236/trunk@139038 18797224-902f-48f8-a5cc-f745e15eee43
Use Thread.getContextClassLoader() as the last resort when searching for classes.
git-svn-id: svn://10.0.0.236/trunk@139016 18797224-902f-48f8-a5cc-f745e15eee43
- call the JSRuntime's checkObjectAccess callback, if configured, for each
get or set that invokes a user-defined function (a user-defined function is
a scripted or native function object, not a native JSPropertyOp C function).
The value passed as an in-out parameter in *vp is the function object, so
the callback could, e.g., clone function objects and configure them with
different parent objects, if that helped import them into a trust domain.
- Fix a long-standing bug that broke the deprecated, old-style, and rarely-
used top-level getter/setter function declaration form:
getter function f() { return ++x; }
setter function f(y) { return x = y; }
We want js_CheckRedeclaration to complain only if a permanent getter is
being redefined by another getter, likewise for a setter -- but not when
(as above) a setter is being added to a top-level object for the same id
as a pre-existing getter (or vice versa).
git-svn-id: svn://10.0.0.236/trunk@138898 18797224-902f-48f8-a5cc-f745e15eee43
in js_FoldConstants where it was added (suboptimally: it worked, but it ran
so late that js_FoldConstants recursion was not reduced, only js_EmitTree
recursion), to NewBinary, where it avoids JSParseNode allocations up front
and reduces recursion in all parse-tree walking.
- This change enables js_FoldConstants to see a very long concatenation of
string literals as a PN_LIST node, so it can quickly concatenate without
running afoul of O(n^2) problems inherent in js_ConcatStrings applied to
two atomized strings (the old way of folding string concatenations, still
used for any pairwise string literal concatenation).
- Further optimize the first change for the second by having NewBinary set a
new pn_strcat flag (overlaying the pn_extra field) of the PN_LIST arm of
the JSParseNode.pn_u union, whenever it sees at least one string literal in
a concatenation that might be folded (whose operands might all be constants
of string or number type).
- Notes:
- only string and number constants are folded (not boolean or null
constants);
- only all-constant left-associated binary expression chains are folded,
so 2 * foo * 3 is not folded using commutativity of * over numbers, nor
is "hi" + " there" + foo folded to "hi there" + foo.
- gcc3.2 -O and objdump -x say I added 708 bytes of instructions with this
change. I tried to keep it down to what was necessary for common script;
I don't think JS needs an optimizing-compiler-strength constant folder,
and I don't think this 1K bloat is too high a price to pay for this fix.
But I'll certainly work on reducing footprint elsewhere, if I can.
- Bug 174341, r=shaver.
git-svn-id: svn://10.0.0.236/trunk@138638 18797224-902f-48f8-a5cc-f745e15eee43
r=dbradley, sr=brendan
If you ask for input, you should fflush after the fprintf
git-svn-id: svn://10.0.0.236/trunk@138544 18797224-902f-48f8-a5cc-f745e15eee43
proper implementation of Scriptable.has in ImporterTopLevel and NativeJavaPackages
git-svn-id: svn://10.0.0.236/trunk@138436 18797224-902f-48f8-a5cc-f745e15eee43