2887 Commits

Author SHA1 Message Date
mccabe%netscape.com
a7edd5be7f Fix to 62309. Change JS_AddRoot to JS_AddNamedRoot in Liveconnect to aid leak diagnoses.
r=beard
sr=brendan


git-svn-id: svn://10.0.0.236/trunk@83423 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-09 01:35:46 +00:00
rogerl%netscape.com
3192db65c0 Sweeping set of changes to implement closures. Also re-targetted entire
front-end to Cobol and back-end now generates pdp11 assembly code in
spanish.


git-svn-id: svn://10.0.0.236/trunk@83413 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-08 23:55:39 +00:00
mccabe%netscape.com
8db0182d42 More licenses and modelines.
Not part of the Mozilla build.


git-svn-id: svn://10.0.0.236/trunk@83402 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-08 10:19:59 +00:00
mccabe%netscape.com
fd0f0e8d79 Add informative comment.
Not part of the Mozilla build.


git-svn-id: svn://10.0.0.236/trunk@83401 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-08 10:01:35 +00:00
mccabe%netscape.com
1214194bac Whoops, wrong license.
git-svn-id: svn://10.0.0.236/trunk@83400 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-08 10:00:20 +00:00
mccabe%netscape.com
ee9dc32154 Add -p flags to several Makefile mkdir commands, to allow parallel gmakes. Still not sure how to make js/src/liveconnect/classes/*.java happy with parallel. gmakes...
Also add some #modelines to makefiles, and some more NPL licenses.

None of these files are part of the Mozilla build.


git-svn-id: svn://10.0.0.236/trunk@83399 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-08 09:56:47 +00:00
mccabe%netscape.com
c09cda8e4e Update to last fix of js.c. Multiple versions of functions #ifdef'ed to take different numbers of arguments (in C) are a pain. Use #ifdef-safe JS_GET_CLASS, instead.
Not part of the Mozilla build.


git-svn-id: svn://10.0.0.236/trunk@83397 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-08 06:30:57 +00:00
mccabe%netscape.com
b5182276d4 Fix to Windows build problem with the js reference build; replace non-API macro OBJ_GET_CLASS with API-kosher JS_GetClass. (OBJ_GET_CLASS used js_GetSlotWhileLocked, pulled from the set of exported symbols with the recent thread optimization checkin.)
Not part of the Mozilla build.  (Yes, it's a closed tree!)

r=brendan


git-svn-id: svn://10.0.0.236/trunk@83390 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-08 02:35:17 +00:00
cls%seawood.org
a27dc8aced Adding caps to REQUIRES. Bug #62069 r=burning tinderbox: senna
git-svn-id: svn://10.0.0.236/trunk@83386 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-07 22:46:13 +00:00
mccabe%netscape.com
e18bba4e83 Fix to 58120 - Rhino's Date.prototype.setYear wasn't converting from internal UTC time to local time before working with the date, resulting in new dates that were off by the current timezone offset. Adding a LocalTime call fixes it.
Thanks to David Flanagan <david@oreilly.com> for catching this.


git-svn-id: svn://10.0.0.236/trunk@83369 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-07 09:21:45 +00:00
jband%netscape.com
4dbd18c0a9 now that the bustage is cleanedup (sorry), I'm fixing the whitespace of that hasty checkin
git-svn-id: svn://10.0.0.236/trunk@83368 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-07 09:06:55 +00:00
jband%netscape.com
389c2d6966 fix build bustage on some platforms from MI ambiguity
git-svn-id: svn://10.0.0.236/trunk@83367 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-07 08:33:50 +00:00
jband%netscape.com
2aa5fb0583 fix bug 62069 and bug 68538 by using nsISecurityCheckedComponent to allow unfettered access from JavaScript to Components.interfaces and the safer methods on nsXPCException. r=brendan r=mstoltz sr=hyatt
git-svn-id: svn://10.0.0.236/trunk@83366 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-07 08:14:27 +00:00
mccabe%netscape.com
eb53804812 Add emacs makefile modeline to many makefiles, add npl license to others.
(Comment changes only.)


git-svn-id: svn://10.0.0.236/trunk@83355 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-07 02:44:27 +00:00
pschwartau%netscape.com
ba05e188dd Initial add; regression test for Bugzilla bug 57043
git-svn-id: svn://10.0.0.236/trunk@83327 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 20:52:59 +00:00
jeff.dyer%compilercompany.com
6d1b9a84a9 Corrupt. Removing.
git-svn-id: svn://10.0.0.236/trunk@83321 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 19:01:21 +00:00
jeff.dyer%compilercompany.com
af328a62d9 Removing, corrupt.
git-svn-id: svn://10.0.0.236/trunk@83320 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 18:59:39 +00:00
jeff.dyer%compilercompany.com
3fed90749c Drawing of compile-time values.
git-svn-id: svn://10.0.0.236/trunk@83319 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 18:37:20 +00:00
jeff.dyer%compilercompany.com
b147b05709 Fixed test to be correct js2.
git-svn-id: svn://10.0.0.236/trunk@83318 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 18:30:18 +00:00
jeff.dyer%compilercompany.com
e6837e1e00 Fixes to the type system and error handler.
git-svn-id: svn://10.0.0.236/trunk@83317 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 18:27:42 +00:00
brendan%mozilla.org
50b1d4d1f6 Fix leak on IS_BIG_ENDIAN malloc failure early return (r=mccabe,sr=jband).
git-svn-id: svn://10.0.0.236/trunk@83307 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 06:53:33 +00:00
brendan%mozilla.org
784d503f6e Include <ctype.h> before using isalpha, etc.; misc style cleanup (r=mccabe,sr=jband).
git-svn-id: svn://10.0.0.236/trunk@83306 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 06:46:55 +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
jband%netscape.com
ae30279ca2 fix bug 61788 - don't leave garbage in stack from js_AllocStack. Also, avoid allocing unneeded slots. r=mccabe sr=brendan
git-svn-id: svn://10.0.0.236/trunk@83303 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 06:00:49 +00:00
jband%netscape.com
959e1037f7 fix warnings
git-svn-id: svn://10.0.0.236/trunk@83302 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 05:59:16 +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
nboyd%atg.com
5196035164 Add construction of Counter from Java
git-svn-id: svn://10.0.0.236/trunk@83268 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-05 16:42:39 +00:00
nboyd%atg.com
b569ba961d Fix bug 61979
git-svn-id: svn://10.0.0.236/trunk@83267 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-05 16:06:20 +00:00
nboyd%atg.com
efe558d5d6 Fix bug 60093
git-svn-id: svn://10.0.0.236/trunk@83266 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-05 16:04:32 +00:00
brendan%mozilla.org
a91f4de13e Forgot to check this in as part of 54743's big patch, d'oh\!
git-svn-id: svn://10.0.0.236/trunk@83262 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-05 06:42:14 +00:00
mccabe%netscape.com
29570cf10d Fix to 45590. Beard untangled ancient and wrong code from prmjtime.c interacting with the Mac OS; 45590 is fixed by actually treating the date offset as a signed value (it should be!) rather than adding a day when east of Greenwich.
Along the way, Patrick also fixed a bug that's been with the JS engine on the mac for more than three years; used to be that Mac dates throughout the year were displayed according to the machine's *current* daylight savings time setting; now they display properly and all is well with the world.

Dependent on recent checkin fixing 61577, adding needed time library to the mac build.X

r=mccabe


git-svn-id: svn://10.0.0.236/trunk@83261 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-05 05:17:30 +00:00
brendan%mozilla.org
45d2ae13b6 Checkin for art@halogen.kharkov.ua, bug 61899, r=mccabe, sr=brendan.
git-svn-id: svn://10.0.0.236/trunk@83251 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-05 03:16:41 +00:00
pschwartau%netscape.com
710313d828 Replaced hard-coded TZ_DIFF = -8 with a dynamically-calculated value
git-svn-id: svn://10.0.0.236/trunk@83247 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-05 01:47:15 +00:00
jeff.dyer%compilercompany.com
6ad4f40cf9 Fixed type bugs and header comments.
git-svn-id: svn://10.0.0.236/trunk@83238 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-04 18:47:28 +00:00
brendan%mozilla.org
0079469b4e A bit over-aggressive with that static keyword last time...
git-svn-id: svn://10.0.0.236/trunk@83233 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-04 04:34:18 +00:00
brendan%mozilla.org
c359b1ea49 Fix NSPR_LOCK ifdefs (for JS_NO_THIN_LOCKS mode, enabled due to a configure.in bug on gcc/sparc5 systems). Fixes speedracer build bustage.
git-svn-id: svn://10.0.0.236/trunk@83230 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-04 04:02:27 +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
jband%netscape.com
21ba28c965 remove unnecessary nested JS_{Begin,End}Request in Load. r=beard
git-svn-id: svn://10.0.0.236/trunk@83228 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-04 02:13:13 +00:00
cls%seawood.org
4e69672da1 Update REQUIRES.
git-svn-id: svn://10.0.0.236/trunk@83225 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-03 22:33:51 +00:00
pschwartau%netscape.com
5d7643c162 Removed hard-coded line var TZ_DIFF = -8. It's already set in the pre-loaded shell.js file.
git-svn-id: svn://10.0.0.236/trunk@83221 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-02 23:59:58 +00:00
waldemar%netscape.com
ee35fdfdf0 Made 'super' into an operator. Added syntax for operator overloading.
git-svn-id: svn://10.0.0.236/trunk@83209 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-02 09:10:12 +00:00
waldemar%netscape.com
0d2eb192bd Added 'operator' non-reserved word
git-svn-id: svn://10.0.0.236/trunk@83208 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-02 09:09:41 +00:00
jeff.dyer%compilercompany.com
859dd2f766 Fixed a couple typos.
git-svn-id: svn://10.0.0.236/trunk@83204 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-02 02:04:51 +00:00
jeff.dyer%compilercompany.com
476b99cf9e Updated to reflect latest changes.
git-svn-id: svn://10.0.0.236/trunk@83203 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-02 01:49:18 +00:00
jeff.dyer%compilercompany.com
595130165d Import of Initial Source from MVCC
git-svn-id: svn://10.0.0.236/trunk@83197 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-02 00:46:31 +00:00
pschwartau%netscape.com
c2fc5a66ec Initial add; see Bugzilla bug 61266 -
git-svn-id: svn://10.0.0.236/trunk@83186 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-01 20:20:43 +00:00
pschwartau%netscape.com
ab2ac534d2 Initial add; see Bugzilla bug 57631
git-svn-id: svn://10.0.0.236/trunk@83185 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-01 20:17:11 +00:00
jband%netscape.com
cd06043da8 fixes for bug 60303, bug 60356, bug 57370, and bug 58982 r=mccabe sr=hyatt sr=brendan
git-svn-id: svn://10.0.0.236/trunk@83117 18797224-902f-48f8-a5cc-f745e15eee43
2000-11-30 06:58:37 +00:00
mccabe%netscape.com
8b5b02a20a Fix to 61183. Detect whether the OS has given us a date string ending in /xx (as in xx/xx/xx) for Date.prototype.toLocale[Date]String, and pad it out to the real number of digits.
r=rogerl


git-svn-id: svn://10.0.0.236/trunk@83115 18797224-902f-48f8-a5cc-f745e15eee43
2000-11-30 05:52:44 +00:00
mccabe%netscape.com
81f7853413 Remove unused property definitions and fix some errors that had crept in.
git-svn-id: svn://10.0.0.236/trunk@83091 18797224-902f-48f8-a5cc-f745e15eee43
2000-11-29 23:32:53 +00:00