102 Commits

Author SHA1 Message Date
brendan%mozilla.org
678d939e1c Lazily pin the less likely atoms when resolving standard class names (77861, r=jst, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@95787 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-23 04:02:06 +00:00
brendan%mozilla.org
0c0e5d9a7b Unified resolve recursion damping (70358) and resolve-from-js_SetProperty (72354), r/sr=jband,jst,shaver.
git-svn-id: svn://10.0.0.236/trunk@95183 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-17 01:43:58 +00:00
pschwartau%netscape.com
8c29047265 Updated JS_GetImplementationVersion() to date of latest JS release (67111).
git-svn-id: svn://10.0.0.236/trunk@94678 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-11 20:05:34 +00:00
brendan%mozilla.org
da4224d9bf - Fix bug 79054, AB-BA deadlock between rt->setSlotLock and one or more claimed scopes (r=shaver, sr=jband)
js_SetProtoOrParent should always have used a condvar in addition to a lock.
- Fix bug 79129, assert-botch in js_AllocSlot (r/sr=jband, sr=shaver)
  JS_INITIAL_NSLOTS is the minimum number of slots, js_FreeSlot guarantees it.


git-svn-id: svn://10.0.0.236/trunk@94190 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-08 01:31:02 +00:00
rginda%netscape.com
de70079e56 fix for bug 77807, r=rogerl, sr=brendan
git-svn-id: svn://10.0.0.236/trunk@93962 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-04 21:31:48 +00:00
brendan%mozilla.org
24043e3212 - Don't initialize the arguments class, and do rename it to "Object" so that
arguments objects are prototyped by Object.prototype, per ECMA.  We still
  want a custom class, in order to lazily resolve active-JSStackFrame-based
  properties.
- Use a reserved slot to hold a bitmap of deleted arguments elements, so we
  don't re-resolve them after they've been deleted (which would make them seem
  to be permanent, contrary to ECMA).  This work involved sprucing up several
  fundamental types (jsbitmap) and macros (jsbitmap helper macros in jsbit.h,
  JS_HOWMANY in jstypes.h, JSVAL_INT_BITS in jsapi.h).


git-svn-id: svn://10.0.0.236/trunk@92016 18797224-902f-48f8-a5cc-f745e15eee43
2001-04-11 23:07:26 +00:00
brendan%mozilla.org
e4c21a8200 - Add JS_GetReservedSlot, JS_SetReservedSlot, and JSCLASS_HAS_RESERVED_SLOTS(n)
to the JS API, for per class extra slots beyond JSSLOT_PRIVATE (or starting
  there for a class that lacks JSCLASS_HAS_PRIVATE).  To avoid penalizing all
  instances, these slots are allocated only upon first property-owned slot
  allocation, or upon first JS_SetReservedSlot.

  This entailed adding getRequiredSlot and setRequiredSlot hooks to the
  JSObjectOps struct, and making obj->slots self-describing, a la BSTR.  It
  also afforded me a chance to clean up obj->slots locking so that non-native
  JSObjectOps didn't risk unlocked accesses!  Now there are thread-safe hooks
  for all uses of obj.

  First consumer is the new, DOM-glue-unifying XPConnect, which needs two
  slots per wrapped function.  Hence the change to js_FunctionClass.flags'
  initializer.

- Commented the heck out of JSClass and JSObjectOps function typedefs in
  jspubtd.h.  I hope embedders see these comments!

- Fix JS_XDRValue's default case to handle int exclusively, there is no other
  possible type (and therefore no JSMSG_BAD_JVAL_TYPE error).

- Clean up tabs in select old, tab-ridden files and sections.

- s/\<fh\>/file/g for stdio FILE * canonical variable names.


git-svn-id: svn://10.0.0.236/trunk@91396 18797224-902f-48f8-a5cc-f745e15eee43
2001-04-05 01:53:24 +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
brendan%mozilla.org
2cc30d28ec Add JS_MapGCRoots for complete enumeration of GC roots (72465, r/sr={shaver,jband}).
git-svn-id: svn://10.0.0.236/trunk@89955 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-21 01:33:39 +00:00
brendan%mozilla.org
d9b3cdbf07 Fix bug 69271, r=waterson, sr=shaver:
- Don't ape java.lang.String's bogo-sampling hash function for "long" (>=16
  char) strings.
- Theory and practice comment in jsdhash.h helps analyze when to use double
  hashing (most of the time) vs. when to use chaining.
- Subroutine ChangeTable from JS_DHashTableOperate so it can be called from
  JS_DHashTableEnumerate, if the latter finds that enough entries have been
  removed to be worth a shrink or compress cycle.


git-svn-id: svn://10.0.0.236/trunk@89637 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-14 07:42:32 +00:00
pschwartau%netscape.com
8efd292d96 Updated JS_GetImplementationVersion() to date of latest JS release (67111, r=rginda, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@89111 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-09 07:36:48 +00:00
brendan%mozilla.org
d4d7f80d47 Don't assert about leaked atoms, do DEBUG fprints instead (68765, r=timeless, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@87034 18797224-902f-48f8-a5cc-f745e15eee43
2001-02-14 22:25:30 +00:00
brendan%mozilla.org
be138b52b8 - Keep interned string atoms around across zero-context episodes on a runtime,
until JS_DestroyRuntime is called (68450, r=rginda, sr=jband).
- NUL-terminate tagbuf in tagify, for the HTML helpers such as string.big()
  (66648, r=timeless, sr=jband).


git-svn-id: svn://10.0.0.236/trunk@86863 18797224-902f-48f8-a5cc-f745e15eee43
2001-02-13 00:57:10 +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
brendan%mozilla.org
1c7d4471fa Fixes for bug 61898 (which has morphed), r=rogerl, sr=jband.
- Optimize integer ++ and -- to avoid double-to-int, which is quite costly for
  some compilers (ftol on Windows with MSVC).
- Optimized arguments[i] and arguments.length references to use bytecodes that
  avoid creating an arguments object for the current frame.  This entailed
  simplifying the compiler to avoid flagging functions and scripts that set
  arguments, since we have code in jsfun.c to catch such sets at runtime.
- The code generator now eliminates useless expression statements, giving a
  strict warning about them.
- Rationalized jsemit.c's LookupArgOrVar to have well-defined results in *pn.
  Eliminate bytecode specializations for argument and local variable gets and
  sets from jsparse.c -- these precede jsemit.c's LookupArgOrVar and frustrate
  it, by setting pn_slot non-negative too early.
- Code generation errors set report->filename and report->lineno, rather than
  hacking "{0}, line {1}: " into the localized message.
- Bogus JSFRAME_VAROBJBUG removed, JSOPTION_VAROBJFIX is sufficient.
- Spruce up jsinterp.c macros to use JS_BEGIN/END_MACRO brackets if possible.
- Avoid calling JS_PropertyStub.  The call is too costly compared to a branch
  in the caller.


git-svn-id: svn://10.0.0.236/trunk@85537 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-26 00:59:50 +00:00
sspitzer%netscape.com
7305affabb back out brendan (Career Limiting Move) to fix blocker bug #66545.
a=leaf


git-svn-id: svn://10.0.0.236/trunk@85497 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-25 18:06:57 +00:00
brendan%mozilla.org
c1463a8801 Fixes for bug 61898 (which has morphed), r=rogerl, sr=jband.
- Optimize integer ++ and -- to avoid double-to-int, which is quite costly for
  some compilers (ftol on Windows with MSVC).
- Optimized arguments[i] and arguments.length references to use bytecodes that
  avoid creating an arguments object for the current frame.  This entailed
  simplifying the compiler to avoid flagging functions and scripts that set
  arguments, since we have code in jsfun.c to catch such sets at runtime.
- The code generator now eliminates useless expression statements, giving a
  strict warning about them.
- Rationalized jsemit.c's LookupArgOrVar to have well-defined results in *pn.
- Code generation errors set report->filename and report->lineno, rather than
  hacking "{0}, line {1}: " into the localized message.
- Bogus JSFRAME_VAROBJBUG removed, JSOPTION_VAROBJFIX is sufficient.
- Spruce up jsinterp.c macros to use JS_BEGIN/END_MACRO brackets if possible.
- Avoid calling JS_PropertyStub.  The call is too costly compared to a branch
  in the caller.


git-svn-id: svn://10.0.0.236/trunk@85488 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-25 09:22:19 +00:00
brendan%mozilla.org
e92f541879 2nd attempt: Fix API botch where 'var x=0' vs. 'x=0' could put x in a different object (65553, r=mccabe, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@85199 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-20 01:41:55 +00:00
kin%netscape.com
b027ec74ff Temporary fix for Bug #65828: mozilla installer.exe fails with "-229 script error"
Backing out Brendan's previous checkin for bug #65553 (jsapi.c, jsdbgapi.c, jsemit.c, jsinterp.c, jsinterp.h, jsobj.c, and jsscript.c), so we can get smoke tests going.

r=attinasi@netscape.com (sheriff)


git-svn-id: svn://10.0.0.236/trunk@85091 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-18 22:10:12 +00:00
brendan%mozilla.org
a8e8c0ed81 Fix API botch where 'var x=0' vs. 'x=0' could put x in a different object (65553, r=mccabe, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@85067 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-18 03:00:31 +00:00
brendan%mozilla.org
1f9562bcf1 Don't fatten a flyweight lock unnecessarily in JS_SetPrototype; misc. cleanups (63097, r=mccabe, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@83914 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-20 22:36:01 +00:00
brendan%mozilla.org
850d9d969b JSPROP_SHARED implies no slot to entrain garbage (bug 61482, r=mccabe, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@83276 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-05 21:47:23 +00:00
brendan%mozilla.org
ff9815b123 All this r=mccabe, r=beard, and sr=jband -- many thanks to all who helped,
especially to jband for his great stress-test setup and particularly helpful
(in terms of reproducing bugs in draft patches) MP and laptop machines.

- Radical(*) object (scope) locking optimization: don't lock if a scope is
  accessed on the context that exclusively owns it (initially, the context
  on which the scope was created).  Once a scope becomes shared among more
  than one owner-context, give it the usual thin or fat lock, per existing
  jslock.c code.

  I did this at the memory cost of another word per JSScope, ownercx, which
  raised scope size from 12 to 13 words if !DEBUG.  I also added a linked
  list head pointer, rt->scopeSharingTodo, and a scopeSharingDone condition
  variable to JSRuntime, and a scopeToShare pointer to JSContext that's
  necessary for deadlock avoidance.

  The rt->scopeSharingTodo list links JSScopes through the scope->u.link
  union arm, which overlays the pre-existing scope->count (now u.count)
  member.  This list holds scopes still exclusively owned by a context, but
  wanted by js_LockScope calls active on other threads.  Those calls wait
  on the rt->scopeSharingDone condition, which is notified every time an
  owner-context ends the request running on it, in which code active on
  that context may be using scope freely until end of request.

  The code that waits on rt->scopeSharingDone must first suspend any and
  all requests active on the calling context, and resume those contexts
  after the wait is notified.  This means a GC could happen while the
  thread locking a scope owned by another thread's context blocks; all
  calls to JS_LOCK_OBJ must therefore first home fp->sp above any live
  operands, e.g.  The interpreter takes care to do that already.

  To avoid AB-BA deadlocks, if a js_LockScope attempt on one context finds
  that the owner-context of the scope is already waiting on a scope owned
  by the current context (or indirectly depending on such a scope lock),
  the attempt converts the scope from lock-free exclusive ownership to
  shared ownership (thin or fat lock).

- Fix js_SetupLocks and the js_LockGlobal/js_UnlockGlobal code to avoid
  divmod instruction costs, strength-reducing to bit-mask instructions.

- The radical lock-free scope change required care in handling the 0=>1
  and 1=>0 transitions of cx->requestDepth, which was till now thread-local
  because part of the JSContext not manipulated by other threads.  It's
  still updated only by cx's thread, but it is read by other threads in
  the course of attempting to claim exclusive ownership of a scope for more
  lock-free JS object operations.

- The JS_SuspendRequest and JS_ResumeRequest APIs have changed incompatibly
  to require their caller to save and restore the requestCount found when
  JS_SuspendRequest is called.  This is necessary to avoid deadlock; sorry
  for the incompatible change.

- Fixed various nits in jslock.[ch], including using Init/Finish rather
  than New/Destroy for the methods that take a JSThinLock and initialize
  and finish/free its members.  Another example: JS_ATOMIC_ADDREF is now
  JS_ATOMIC_INCREMENT and JS_ATOMIC_DECREMENT, so the two cases can be
  mapped to PR_AtomicIncrement and PR_AtomicDecrement.  This entailed
  changing jsrefcount from jsword to int32 (PRInt32).

- No need to use JS_ATOMIC_INCREMENT on JSScopeProperty.nrefs, as it is
  always and everywhere protected by the property's JSScope.lock.

- Cleaned up gratuitous casts in jscntxt.c by using &cx->links, etc.

- The lock used for mutual exclusion around both request begin and end vs.
  GC synchronization is rt->gcLock, and this lock now also protects all
  scope->ownercx pointer changes from non-null (exclusive) to null (shared),
  the rt->scopeSharingTodo/scope->u.link list operations, and of course the
  rt->scopeSharingDone condition.

  But this means that js_GC cannot hold rt->gcLock across the bulk of its
  body, in particular the mark phase, during which JS_GetPrivate calls,
  e.g., may need to "promote" scope locks from lock-free to thin or fat,
  because doing so would double-trip.  There never was any good reason to
  hold rt->gcLock so long, of course -- locks are for mutual exclusion, not
  for waiting or notifying a thread -- those operations require a condition,
  rt->gcDone, which we already use along with rt->gcLevel to keep racing GC
  attempts at bay.

  So now that rt->gcLock does not protect the mark phase, the enumeration
  of rt->gcRootsHash can race badly with JS_RemoveRootRT, an API that may
  legitimately be called outside of a request, without even a context.  It
  turns out that people may be cheating on the request model even with
  JS_AddRoot, JS_AddNamedRoot, and JS_RemoveRoot calls, so we must make
  all of those interlock with the GC using gcLevel and gcDone, unless they
  are called on the gcThread.

  Also, since bug 49816 was fixed, there has been no need for a separate
  finalize phase, or for rt->gcFinalVec.  Finalizers can no longer allocate
  newborn GC-things that might be swept (because unmarked), or double-trip
  on rt->gcLock (which is no longer held).  So js_GC finalizes as it sweeps,
  just as it did in days of old.

- I added comments to jslock.h making it plain that callers of JS_LOCK_OBJ
  and JS_UNLOCK_OBJ must either be implementations of js_ObjectOps hooks,
  or code reachable only from those hooks; or else must be predicated on
  OBJ_IS_NATIVE tests.  It turns out jsinterp.c's CACHED_GET and CACHED_SET
  macros neglected to do such tests, limiting the ability of JS embeddings
  to implement JSObjectOps with their own non-JSScope JSObjectMap subclass.
  Fixed, small performance hit that the lock-free optimization should more
  than make up for.

- jslock.c now gives a #error if you try to compile it on a platform that
  lacks a compare-and-swap instruction.  The #error says to use NSPR locks.
  Before this change, some platforms would emulate compare-and-swap using
  a global PRLock, which is always worse in runtime than using per-scope
  PRLocks.


git-svn-id: svn://10.0.0.236/trunk@83229 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-04 02:43:31 +00:00
brendan%mozilla.org
b13ca3b398 Don't nuke the stackPool in JS_GC if it's in use by cx->stackHeaders or cx->fp (or other future users; 57096, r=shaver, a=jband).
git-svn-id: svn://10.0.0.236/trunk@81407 18797224-902f-48f8-a5cc-f745e15eee43
2000-10-18 22:21:46 +00:00
rogerl%netscape.com
f976aefde7 Bug #46196, a=brendan, r=mccabe. Fixed recursive death in out of memory
situation.


git-svn-id: svn://10.0.0.236/trunk@81150 18797224-902f-48f8-a5cc-f745e15eee43
2000-10-13 22:11:52 +00:00
mccabe%netscape.com
555583f56a Fix to 55117. Warn on DEBUG of any GC roots remaining at engine shutdown.
r=rogerl@netscape.com
a=brendan@mozilla.org


git-svn-id: svn://10.0.0.236/trunk@80489 18797224-902f-48f8-a5cc-f745e15eee43
2000-10-05 21:55:38 +00:00
brendan%mozilla.org
22321f285c Fix two distinct bugs with similar symptoms (53123, r=law, a=jband).
git-svn-id: svn://10.0.0.236/trunk@79925 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-23 01:26:03 +00:00
brendan%mozilla.org
861e26cb89 Fix JS_BeginRequest to avoid self-deadlock if called from a finalizer (52808, r=jband).
git-svn-id: svn://10.0.0.236/trunk@79498 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-19 02:18:17 +00:00
brendan%mozilla.org
6f257f5b8e - Back out part of patch from tlundeen@webcrossing.com, my fault for taking it
in part (the entire patch made JSContexts ref-counted, but that is not an API
  compatible change, and it doesn't help clean up at JS_Finish time if the API
  user leaks JSContext refs anyway).  52835, r=jband.
- First part of 64-bit portability fix for 52792, r=jnance.  More work needed.
- Fix bogus assert and minimization in js_AllocStack, too.


git-svn-id: svn://10.0.0.236/trunk@79396 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-16 22:17:22 +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
b0b7fd8115 Followup for 44997, r=shaver:
- #if JS_HAS_LVALUE_RETURN around cx->rval2/rval2set defs and uses.
- Instrument different kinds of invocations, #ifdef DEBUG only.
- Clean up basis case of empty switch statement to use high = -1, low = 0,
  requiring care when optimizing in-range tests using unsigned casts, but
  freeing the interpreter and decompiler from having to do an extra test
  before looping from low to high.
- Clean up all codegen to use JUMP_OFFSET_LEN, ATOM_INDEX_LEN, etc. instead of
  magic 2 or 4.
- Add JSOP_TRY and JSOP_FINALLY no-ops to save a srcnote per JSOP_NOP, and to
  make decompilation and jit'ing easier.
- Minimize number of source notes to maximize SRC_XDELTA span.
- Use JSSCRIPT_FIND_CATCH_START in throw code.
- Indentation and bracing nits picked.


git-svn-id: svn://10.0.0.236/trunk@77900 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-01 18:42:22 +00:00
brendan%mozilla.org
3c54211db3 Support ECMA reference type return from native methods (44997, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@77793 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-01 00:45:50 +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
deff25d80d Lazily define escape and unescape (via js_InitStringClass) only #ifndef MOZILLA_CLIENT, because the DOM must predefine backward-compatible versions of these functions that 'stick' (42221, r=mccabe).
git-svn-id: svn://10.0.0.236/trunk@77234 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-26 02:05:41 +00:00
brendan%mozilla.org
31fe262dfa Fix UMR on ok in JS_ResolveStandardClass (46703, r=rogerl).
git-svn-id: svn://10.0.0.236/trunk@76823 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-22 00:25:17 +00:00
brendan%mozilla.org
3802be8867 Support lazy initialization of standard classes and their associated global functions/properties (46703, r=jband,rogerl).
git-svn-id: svn://10.0.0.236/trunk@76699 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-19 08:37:07 +00:00
mccabe%netscape.com
9657613bc1 Fix to 39438.
Add a TokenStream entry to the regexp parser state so that regexps compiled at script-compilation time can report filename and line number on error.


git-svn-id: svn://10.0.0.236/trunk@76171 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-11 23:55:07 +00:00
rogerl%netscape.com
ccc73deb34 r,a=brendan@mozilla.org. Adding missing ECMA3 compliance toLocaleXXX
functions to built-in Array, Date and Object object prototypes.


git-svn-id: svn://10.0.0.236/trunk@75908 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-09 21:46:03 +00:00
brendan%mozilla.org
854313ee5e Try again for bug 41381, r=wtc@netscape.com
git-svn-id: svn://10.0.0.236/trunk@74155 18797224-902f-48f8-a5cc-f745e15eee43
2000-07-13 05:08:35 +00:00
brendan%mozilla.org
281682666b Uh oh. Back out last change until I'm sure I'm not an idiot.
git-svn-id: svn://10.0.0.236/trunk@74151 18797224-902f-48f8-a5cc-f745e15eee43
2000-07-13 04:00:33 +00:00
brendan%mozilla.org
8f313d2720 Fix ancient bugs: compare-and-swap is not threadsafe given A-B-A address replay via malloc/free; release to mark in pool->first empty arena would not free anything, as troy@tellme.com found (41381, r=wtc@netscape.com).
git-svn-id: svn://10.0.0.236/trunk@74150 18797224-902f-48f8-a5cc-f745e15eee43
2000-07-13 03:49:22 +00:00
brendan%mozilla.org
2a9d76e574 Fix JS_SetPrototype and __proto__ setting to deal with shared scopes; use JSObjectOps for setProto and setParent operations, and add spare op slots (41126, r=shaver@mozilla.org,pschwartau@netscape.com).
git-svn-id: svn://10.0.0.236/trunk@73274 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-27 02:37:25 +00:00
brendan%mozilla.org
5dc04862aa Use localizable error message for out of memory.
git-svn-id: svn://10.0.0.236/trunk@71586 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-06 04:54:04 +00:00
brendan%mozilla.org
4a68c03a16 Fix ECMA DontDelete compliance problems, which create getter/setter security holes (40760, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@71309 18797224-902f-48f8-a5cc-f745e15eee43
2000-06-02 00:02:46 +00:00
brendan%mozilla.org
ed99d6e493 Make JS_ExecuteScriptPart call the debugger hooks (41066, r=MyNGs@HotMail.com).
git-svn-id: svn://10.0.0.236/trunk@71182 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-31 21:57:46 +00:00
brendan%mozilla.org
82a7c4b5d1 Fix unreviewed changes made to fix 'Uninitialized variable compiler warnings'.
git-svn-id: svn://10.0.0.236/trunk@71009 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-28 00:02:26 +00:00
brendan%mozilla.org
d42ca5af73 JS_DestroyRuntime nukes all contexts; add JS_G/SetRuntimePrivate (r=tlundeen@webcrossing.com).
git-svn-id: svn://10.0.0.236/trunk@70340 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-17 06:23:03 +00:00
brendan%mozilla.org
52c90059b6 GC synchronization and lock fixes, plus comments (37983, r=waterson@netscape.com).
git-svn-id: svn://10.0.0.236/trunk@69690 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-14 23:00:51 +00:00