79 Commits

Author SHA1 Message Date
igor%mir2.org
6ed5810784 Bug 384151: refactoring boxing of primitive values, r=brendan
git-svn-id: svn://10.0.0.236/trunk@228036 18797224-902f-48f8-a5cc-f745e15eee43
2007-06-14 07:07:02 +00:00
igor.bukanov%gmail.com
ee65483439 Bug 366725: JS_GetString(Bytes|Chars) are no longer used in SpiderMonkey.
git-svn-id: svn://10.0.0.236/trunk@221525 18797224-902f-48f8-a5cc-f745e15eee43
2007-03-08 06:25:23 +00:00
igor.bukanov%gmail.com
cae329a112 Bug 36680: new function to report error using decompiled jsval text. r=brendan
git-svn-id: svn://10.0.0.236/trunk@218666 18797224-902f-48f8-a5cc-f745e15eee43
2007-01-19 08:37:55 +00:00
igor.bukanov%gmail.com
6997abb908 Bug 366975: Allow to allocate new GC things from JSGC_END callback. r=brendan
git-svn-id: svn://10.0.0.236/trunk@218642 18797224-902f-48f8-a5cc-f745e15eee43
2007-01-18 23:36:41 +00:00
brendan%mozilla.org
4efdf4fb64 Trailing space and comment cleanup.
git-svn-id: svn://10.0.0.236/trunk@209584 18797224-902f-48f8-a5cc-f745e15eee43
2006-09-09 20:37:49 +00:00
brendan%mozilla.org
e6aee26e27 Check in smontagu's patch for bug 349488 (r=me).
git-svn-id: svn://10.0.0.236/trunk@208158 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-23 04:49:11 +00:00
brendan%mozilla.org
9cef5307bc Awesome patch from Andreas <mqmq87@web.de> to avoid creating unnecessary objects for primitives being operated on via methods (334261, r=me).
git-svn-id: svn://10.0.0.236/trunk@195575 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-27 17:58:55 +00:00
brendan%mozilla.org
aedfa6257b Major simplification to jsconfig.h, dropping support for all ancient bug config and almost all pre-ECMA-Edition-3 feature config (325951, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@195469 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-26 21:33:01 +00:00
brendan%mozilla.org
d5fb083e40 Second half of fix for 304376 (r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@194732 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-19 23:36:16 +00:00
gavin%gavinsharp.com
79e150c396 Bug 330319: Remove duplicate string constants in jsnum.c, patch by Erik Fabert <jerfa@email.it>, r=brendan
git-svn-id: svn://10.0.0.236/trunk@193686 18797224-902f-48f8-a5cc-f745e15eee43
2006-04-06 13:02:03 +00:00
igor%mir2.org
e9732b9053 Bug 331456: Cache of deflated string bytes is per runtime now. To preserve
API compatibility JS_GetStringBytes(JSString *str) calls newly introduced
js_GetGCStringRuntime(JSString *str) to extract JSRuntime* instance based
on the layout of GC structures. r=brendan


git-svn-id: svn://10.0.0.236/trunk@192999 18797224-902f-48f8-a5cc-f745e15eee43
2006-03-25 22:55:00 +00:00
brendan%mozilla.org
dc870e57c6 Nit-pick a doubled blank line.
git-svn-id: svn://10.0.0.236/trunk@186555 18797224-902f-48f8-a5cc-f745e15eee43
2005-12-24 07:34:16 +00:00
brendan%mozilla.org
bbca4956a4 Reorder to avoid a GC hazard (313479, r=igor).
git-svn-id: svn://10.0.0.236/trunk@182845 18797224-902f-48f8-a5cc-f745e15eee43
2005-10-23 21:23:00 +00:00
dougt%meer.net
3d7bcc8055 Windows CE build changes. This addresses most of the outstanding Windows
CE compilation issues.

This patch also fixes/removes CheckStackGrowthDirection assertions in
Javscript.  This change is based on bug 242518.  See comment 36.

This patch also removes the unused enum in transformiix .  See bug
292118.

r/sr = dveditz/shaver
b    = 291229
a    = asa


git-svn-id: svn://10.0.0.236/trunk@172870 18797224-902f-48f8-a5cc-f745e15eee43
2005-04-29 13:33:49 +00:00
brendan%mozilla.org
a8e2a690ad Revamp the GC to fix E4X private data dueling GC bugs, to reduce malloc costs for small-ish objects and functions, and to pave the way for further GC wins (123668, r=shaver, TAKE 2).
git-svn-id: svn://10.0.0.236/trunk@167293 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-05 06:15:03 +00:00
brendan%mozilla.org
4c0635a125 Back out, broke liveconnect at least.
git-svn-id: svn://10.0.0.236/trunk@167288 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-05 03:58:19 +00:00
brendan%mozilla.org
7a816352a4 Revamp the GC to fix E4X private data dueling GC bugs, to reduce malloc costs for small-ish objects and functions, and to pave the way for further GC wins (123668, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@167286 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-05 02:56:36 +00:00
brendan%mozilla.org
3b56ceb6d1 Implement Deutsch-Schorr-Waite, plus related GC metering improvements, to avoid stack overflow crashes when marking very deep object lists (203278, r=igor@fastmail.fm and Igor wrote the tail-recursion elimination code).
git-svn-id: svn://10.0.0.236/trunk@166357 18797224-902f-48f8-a5cc-f745e15eee43
2004-12-06 23:17:19 +00:00
brendan%mozilla.org
e1d64a36be Initial E4X check-in, configured off (246441, rs=shaver).
git-svn-id: svn://10.0.0.236/trunk@163236 18797224-902f-48f8-a5cc-f745e15eee43
2004-10-05 10:19:07 +00:00
brendan%mozilla.org
dc606d6d85 Fix unused variable problem.
git-svn-id: svn://10.0.0.236/trunk@159382 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-17 02:44:37 +00:00
brendan%mozilla.org
9d3428574c White space policing.
git-svn-id: svn://10.0.0.236/trunk@159380 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-17 02:31:11 +00:00
tor%cs.brown.edu
61fec9ef22 Bug 165200 - Number.toLocaleString() localization. r=brendan
git-svn-id: svn://10.0.0.236/trunk@159366 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-16 21:17:50 +00:00
pedemont%us.ibm.com
ae56beec64 Bug 237183, Add FP exception handler to OS/2, r=brendan, a=mkaply
git-svn-id: svn://10.0.0.236/trunk@154408 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-31 16:38:54 +00:00
gerv%gerv.net
123c4a9492 Bug 205418 - Relicense Spidermonkey (js/src) to MPL/LGPL/GPL. Patch by gerv; r,a=brendan.
git-svn-id: svn://10.0.0.236/trunk@149331 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-15 00:11:16 +00:00
mkaply%us.ibm.com
61313af827 #224487
r=brendan
Os/2 only changes to work around FPU issues. See the bug.


git-svn-id: svn://10.0.0.236/trunk@149280 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-14 01:49:37 +00:00
mkaply%us.ibm.com
864be1ce4d #215581
r/sr=brendan
Changes to get GCC 3.2.2 working on OS/2 - this set is OS/2 only changes


git-svn-id: svn://10.0.0.236/trunk@146932 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-15 22:10:12 +00:00
mkaply%us.ibm.com
da4cdd7619 rs=leaf
Remove XP_OS2_VACPP from the tree


git-svn-id: svn://10.0.0.236/trunk@145083 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-22 21:08:40 +00:00
brendan%mozilla.org
93e05c517c Canonical forever loops.
git-svn-id: svn://10.0.0.236/trunk@143399 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-06 19:00:40 +00:00
brendan%mozilla.org
b0767fa2f6 Unify double/{hi,lo} union to fix bad ifdef'ing for ARM in jsnum.c (208048, r=rogerl).
git-svn-id: svn://10.0.0.236/trunk@143265 18797224-902f-48f8-a5cc-f745e15eee43
2003-06-04 00:12:18 +00:00
seawood%netscape.com
57b8446137 Purge XP_PC.
Bug #74999 r=mkaply sr=brendan


git-svn-id: svn://10.0.0.236/trunk@140650 18797224-902f-48f8-a5cc-f745e15eee43
2003-04-03 19:35:29 +00:00
mkaply%us.ibm.com
98a96ebf73 #188249
s/r=brendan
Cleanup #ifdef and add EMX


git-svn-id: svn://10.0.0.236/trunk@139986 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-21 22:18:12 +00:00
cls%seawood.org
3e1e711a04 Adding mingw support to js.
Bug #134113 r=brendan


git-svn-id: svn://10.0.0.236/trunk@139249 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-11 03:27:07 +00:00
dbradley%netscape.com
26c46a2853 Bug 160602 - Patch sets FPU precision to 53 bit mantissa. r=khanson, sr=brendan
git-svn-id: svn://10.0.0.236/trunk@127699 18797224-902f-48f8-a5cc-f745e15eee43
2002-08-20 12:56:30 +00:00
khanson%netscape.com
e76ec12e0a patch 88484 for bug 14044. checks for out of memory conditon in jsdtoa.c. sr=brendan, r=khanson
git-svn-id: svn://10.0.0.236/trunk@123918 18797224-902f-48f8-a5cc-f745e15eee43
2002-06-24 06:14:02 +00:00
bryner%netscape.com
870e2e8bf7 Adding the functions JS_LockGCThingRT and JS_UnlockGCThingRT, which are variants that only require a JSRuntime, not a JSContext. Converted some internal callers to use the new interface. Bug 141356, patch from shaver, r=bryner, sr=brendan.
git-svn-id: svn://10.0.0.236/trunk@120782 18797224-902f-48f8-a5cc-f745e15eee43
2002-05-04 05:28:09 +00:00
timeless%mac.com
69ae314807 Bug 106386 rid source of misspellings
r=db48x sr=blake a=asa


git-svn-id: svn://10.0.0.236/trunk@116832 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-19 04:30:17 +00:00
brendan%mozilla.org
d8e62cd414 Fix bad old js_ValueToInt32 to have an int-jsval fast path, to avoid f.p. inaccuracy (126159, r=shaver, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@114850 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-19 00:02:29 +00:00
bratell%lysator.liu.se
0279313b6e Bug 120990 - make conversion from integer to string faster by not using sprintf. r=khanson, sr=brendan
git-svn-id: svn://10.0.0.236/trunk@112659 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-24 05:24:39 +00:00
brendan%mozilla.org
07d1aed3b1 Checking in patch for Steven Cole <scole@planetweb.com> to fix js_DoubleToECMAInt32 (120083, r=khanson, sr=brendan).
git-svn-id: svn://10.0.0.236/trunk@112244 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-16 00:17:16 +00:00
dbaron%fas.harvard.edu
5f3c1a0733 Don't use C++ comments in C files.
git-svn-id: svn://10.0.0.236/trunk@111543 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-08 02:29:11 +00:00
brendan%mozilla.org
845f74be1e Checking in patch written by balleysson@bigfoot.com based on tenthumbs@cybernex.net's sketch, to avoid mallocs in js_strtod (115627, r=khanson, sr=me).
git-svn-id: svn://10.0.0.236/trunk@111510 18797224-902f-48f8-a5cc-f745e15eee43
2002-01-07 23:42:25 +00:00
brendan%mozilla.org
2163e55b8e Add mutable (growable or dependent, two subtypes) strings to solve O(n^2) and O(n^3) growth rates (56940, r=rogerl, sr=jband&shaver).
git-svn-id: svn://10.0.0.236/trunk@106213 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-25 00:26:38 +00:00
brendan%mozilla.org
726006598c Fix for bug 99663 (for loop resolves properties of the object being enumerated
with JSRESOLVE_ASSIGNING, wrongly), plus a few miscellaneous bugfixes.

- Combine the JSStackFrame members constructing, special, overrides, and
  reserved into a uint32 flags member.

- Separate JOF_ASSIGNING from the JOF_SET bytecode format flag, and impute
  JSRESOLVE_ASSIGNING from the presence of JOF_ASSIGNING among the current
  opcode's format flags.  To handle the for-in loop opcodes, which do more
  than simply assign -- in particular, they do property lookups whose resolve
  hook outcalls should not be flagged with JSRESOLVE_ASSIGNING -- a new frame
  flag, JSFRAME_ASSIGNING, has been added.

- Fix interpreter version selection to respect JS_SetVersion, whose effect on
  cx->version is "sticky".

- Fix js_DecompileValueGenerator to deal with JSOP_ENUMELEM -- it never had,
  as this testcase shows (it crashes without this patch):

    version(120);
    eval("function fe(s) { for (it[s] in this); }");
    try { fe('rdonly'); } catch (e) { print(e); }


git-svn-id: svn://10.0.0.236/trunk@104525 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-03 06:39:30 +00:00
gerv%gerv.net
ae1d5501a1 Oops.
git-svn-id: svn://10.0.0.236/trunk@103236 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 00:02:59 +00:00
scc%mozilla.org
2281a4d137 bug #98089: ripped new license
git-svn-id: svn://10.0.0.236/trunk@103230 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 22:39:41 +00:00
beard%netscape.com
4b7d52f7a7 fix for bug #8112, sr=brendan, r=beard
git-svn-id: svn://10.0.0.236/trunk@92648 18797224-902f-48f8-a5cc-f745e15eee43
2001-04-18 03:38:58 +00:00
rogerl%netscape.com
1511fee5f5 Fix #57187. sr=brendan,r=shaver. Reorder lines to avoid warning.
git-svn-id: svn://10.0.0.236/trunk@89166 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-10 00:17:37 +00:00
brendan%mozilla.org
55b0ba4585 Fixes to make JS GC truly exact:
- All jsvals for which JSVAL_IS_GCTHING evaluates to true must contain tagged
pointers into the GC heap -- therefore jsapi.c's JS_DefineConstDoubles cannot
"cheat" by tagging addresses of static jsdoubles to avoid js_NewNumberValue.

- Finalization is now interleaved with the Sweep phase, to avoid allocating
memory for finalization records while sweeping.  Instead, the JSRuntime holds a
preallocated JSGCThing vector (gcFinalVec) that the Sweep phase fills and
flushes via gc_finalize_phase, repeatedly.

This means that finalizers cannot allocate a new GC thing, an incompatible but
plausible change.  js_AllocGCThing asserts and then checks whether it is called
while rt->gcLevel is non-zero, and fails the allocation attempt if so.  But this
fixes bug 38942, where the old sweep-then-finalize with a sweep => malloc
dependency could lead to memory exhaustion.

- Instead of scanning whole stackPool arenas, which led to UMRs (bug 27924) and
sometimes to gross over-scanning that depended on the GC bounds-checking all
thing pointers against its heap, we scan exactly those stack slots in use:
  - arguments reachable from fp->argv;
  - variables reachable from fp->vars;
  - operands now reachable from fp->spbase, bounded above by the lesser of
    fp->sp or fp->spbase + fp->script->depth for an interpreted frame; if the
    latter, fp->sp has advanced logically above the operand budget, in order to
    call a native method, and all unused slots from fp->sp up to depth slots
    above fp->spbase must be set to JSVAL_VOID;
  - stack segments pushed when calling native methods, prefixed by JSStackHeader
    structs and linked from cx->stackSegments through each header.
The stack segment headers help the GC avoid scanning unused portions of the
stack: the generating pc slots running depth slots below fp->spbase, and slots
at the end of an arena that aren't sufficient to satisfy a contiguous allocation
for more args, vars, or operands.

- Exact GC means the stack pointer must remain above live operands until the
interpreter is done with them, so jsinterp.c got heavily whacked.  Instead of
POPs of various kinds followed by a PUSH for binary operators (e.g.), we use
FETCH and STORE macros that index by -1 and -2 from sp, and minimize adjustments
to sp.  When sp is homed to fp->sp, this allows js_DecompileValueGenerator to
find the value reliably, and if possible its generating pc.

- Finally, the O(n**2) growth rate of gc_find_flags has been fixed, using the
scheme sketched in bug 49816 and documented in a new major comment in jsgc.c.
Briefly, by allocating flags and things from one arena, we can align things on
1024-byte "thing page" boundaries, and use JSGCPageInfo headers in each page to
find a given thing's flags in O(1) time.

/be


git-svn-id: svn://10.0.0.236/trunk@79087 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-14 06:14:45 +00:00
mkaply%us.ibm.com
70ef4ad5d1 #50212
r=brendan, a=brendan
OS/2 GCC doesn't define _M_IX86


git-svn-id: svn://10.0.0.236/trunk@77538 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-30 01:04:59 +00:00
brendan%mozilla.org
358cfb3146 Macro-ize FPU mode fixing and do it on ever js_InitNumberClass; also, simplify #ifdefs to unify OS2 with XP_PC && _M_IX86 case (50212, r=mkaply@us.ibm.com).
git-svn-id: svn://10.0.0.236/trunk@77165 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-25 03:14:50 +00:00