115 Commits

Author SHA1 Message Date
brendan%mozilla.org
5f91bd99d8 Checking in shaver's patch for bug 78100, adding JS_GetExternalStringGCType (sr=brendan&jband).
git-svn-id: svn://10.0.0.236/trunk@101473 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 02:53:19 +00:00
shaver%mozilla.org
9c980e4543 sigh, fix direct-inclusion-of-jsgc.h bustage in TestXPC
git-svn-id: svn://10.0.0.236/trunk@91257 18797224-902f-48f8-a5cc-f745e15eee43
2001-04-04 05:53:58 +00:00
shaver%mozilla.org
04121d876f 73645: use JSDHashTable for JSRuntime.gcRootsHash and .gcLocksHash.
r=waterson-the-dhash-fiend, sr=brendan-the-other-dhash-fiend


git-svn-id: svn://10.0.0.236/trunk@91247 18797224-902f-48f8-a5cc-f745e15eee43
2001-04-04 04:30:41 +00:00
shaver%mozilla.org
44326fc42c 50602: Add support in XPConnect for sharing of refcounted string BufferHandles,
in both directions.
72552: Remedy overzealous CHECK_REQUEST placement in jsapi.c, to produce a
       minimal-but-complete set of engine entry points that require a Request
       for safe execution.
r=brendan, sr=jband, assist=scc,pinkerton


git-svn-id: svn://10.0.0.236/trunk@90483 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-27 06:04:44 +00:00
jband%netscape.com
5c45f126ae part of the fix to bug 66950. Add support for cheaply tracking the lifetime of arbitrary JSObject by extending the GC callback mechanism to notify after marking is done but before sweeping, and by providing an api function that can be called at that point to determine if any given gcthing is about to be finalized. r=rogerl sr=brendan
git-svn-id: svn://10.0.0.236/trunk@86060 18797224-902f-48f8-a5cc-f745e15eee43
2001-02-02 08:44:24 +00:00
jband%netscape.com
a9d947a466 fix bug 59588. Since js_MarkAtom is called *so* often but is usually short-circuited, we add a macro to get the shortcircuit flag in the 3 callers and avoid most of the calls. r=mccabe sr=brendan
git-svn-id: svn://10.0.0.236/trunk@83304 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 06:03:30 +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
brendan%mozilla.org
822d3b3746 Support external string GC types so XPConnect and other systems can optimize away copies (50602, r=jband).
git-svn-id: svn://10.0.0.236/trunk@78026 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-02 20:37:37 +00:00
brendan%mozilla.org
e85122f78b Clean up JSObjectOps layering violations by adding mark and clear ops; JSClass gets a corresponding mark op so classes with unregistered roots in private data can mark them. The JS API gets a new JS_MarkGCThing entry point for JSObjectOps.mark implementors. Prerequisite check-in for bug 49816 and others (r=shaver).
git-svn-id: svn://10.0.0.236/trunk@77238 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-26 02:30:22 +00:00
brendan%mozilla.org
e59f31abff Make it safe to nest a GC from js_AllocGCThing, ultimately from the interpreter; also make sure we collect all garbage (even garbage created by finalizers who unroot or unlock GC-things) when destroying the last context (39125, 44376, r=mccabe@netscape.com).
git-svn-id: svn://10.0.0.236/trunk@73871 18797224-902f-48f8-a5cc-f745e15eee43
2000-07-08 02:06:01 +00:00
dmose%mozilla.org
ec2434440d update license boilerplate to NPL-1.1 dual-licensed with the GPL. a=brendan, r=brendan.
git-svn-id: svn://10.0.0.236/trunk@49258 18797224-902f-48f8-a5cc-f745e15eee43
1999-09-28 23:12:09 +00:00
fur%netscape.com
40e974ccab Merge from SpiderMonkey140_BRANCH:
Incorporated changes from JS_STABLE_DROP_04261999 to JS_STABLE_DROP_06221999


git-svn-id: svn://10.0.0.236/trunk@36563 18797224-902f-48f8-a5cc-f745e15eee43
1999-06-23 14:18:56 +00:00
fur%netscape.com
e655606d45 Checkpoint JS1.4 from JS_STABLE_10131998_BRANCH. Changes include:
+ merging of js/src and js/ref
 + elimination of most dependencies on NSPR
 + JS1.4 feature additions and accumulated bug fixes

More details are in last week's mozilla status report.


git-svn-id: svn://10.0.0.236/trunk@12797 18797224-902f-48f8-a5cc-f745e15eee43
1998-10-14 10:22:38 +00:00
fur
6e3cdaec31 Initial checkin of JavaScript 1.3, migrated from JSFUN13_BRANCH in /m/src repository
git-svn-id: svn://10.0.0.236/trunk@578 18797224-902f-48f8-a5cc-f745e15eee43
1998-04-24 00:31:11 +00:00
ltabb
8ed5afe62c Free the lizard
git-svn-id: svn://10.0.0.236/trunk@10 18797224-902f-48f8-a5cc-f745e15eee43
1998-03-28 02:44:41 +00:00