Граф коммитов

129 Коммитов

Автор SHA1 Сообщение Дата
brendan%mozilla.org dd545c2cb9 Fix JS_[GS]etContextThread return type; add JSCLASS_NEW_RESOLVE_GETS_START (196966, r=shaver). 2003-03-12 20:29:16 +00:00
brendan%mozilla.org 6e0c7cdde4 Constipation of (JS|PL)DHashTableOps (195298, r/sr=shaver/alecf). 2003-02-28 07:17:59 +00:00
brendan%mozilla.org 4b0d8710d7 Fix blunder in obj_propertyIsEnumerable from last checkin (156354, r=shaver). 2002-09-16 23:00:03 +00:00
brendan%mozilla.org d02561c5d2 Restore enumeable, permanent, readonly single-char elements to string objects; fix propertyIsEnumerable to work with shared permanent proto-properties (167910, r=rogerl). 2002-09-12 19:34:59 +00:00
brendan%mozilla.org 873971ec4c Fix js_NewObject not to share proto's map if proto and obj don't have the same number of reserved slots (112974, r=rogerl, sr=jband). 2002-08-08 21:51:54 +00:00
brendan%mozilla.org 703c294a0e Null-check prop before dropping it (156354, r=khanson, sr=shaver). 2002-07-09 02:24:51 +00:00
brendan%mozilla.org 1740ef44a7 Respect addProperty failure (148899, r=khanson, sr=shaver). 2002-06-04 18:13:55 +00:00
dbaron%fas.harvard.edu 412d54c9d6 Fix Mac bustage from brendan's checkin. 2002-05-22 00:53:12 +00:00
brendan%mozilla.org f1f6f1398e Don't fail to call OBJ_CHECK_ACCESS for o.__proto__ = x, with enough mode bits to say what's happening (143369, r=shaver, sr=jst). 2002-05-22 00:06:40 +00:00
brendan%mozilla.org bf8e80d0d1 Fix js_SetProtoOrParent to handle non-native and native-but-incompatible-class-change proto-setting scenarios (140164, r=khanson, sr=jband). 2002-05-02 20:59:35 +00:00
timeless%mac.com dec943eb10 Bug 106386 rid source of misspellings
r=db48x sr=blake a=asa
2002-03-19 04:30:17 +00:00
brendan%mozilla.org 1e126a67d9 Restore non-bogus assertion removed in last rev, and fix the case that tripped it in js_ChangeScopeProperty, by not removing [and maybe freeing sprop->slot] before re-adding sprop; also fix all engine-defined getters and setters to have no slot [to be JSPROP_SHARED] (130970, r/sr=shaver&jband, a=asa). 2002-03-16 04:51:29 +00:00
khanson%netscape.com e67d7ec049 bug #130991 (Out-of-Memory in jsshell causes assertion failure in jsobj.c) patch by Brendan, sr=jband, r=khanson, a=asa 2002-03-15 06:22:00 +00:00
brendan%mozilla.org 62bc0d659b No strict warnings without the strict option, and other js1.5/mozilla1.0 tidying (129972, r=shaver, sr=jband, a=asa). 2002-03-14 00:14:48 +00:00
brendan%mozilla.org 5074f6ebd1 Don't forget to lock obj in js_AddNativeProperty and js_ChangeNativePropertyAttrs (130137, r=jband, sr=shaver, a=roc+moz). 2002-03-12 07:17:30 +00:00
brendan%mozilla.org efe08cd95c Fix longstanding bug where watchpoints didn't work with JSPROP_SETTER (127243, r=rginda, sr=shaver, a=dbaron). 2002-03-08 22:46:13 +00:00
brendan%mozilla.org be783ec091 Runaway recursion safety for Exception and js_ErrorToException.
The latter no longer calls the former via js_ConstructObject, to
minimize failure opportunities when converting an error into an
exception.  Also, the 'stack' property of exception objects
faithfully preserves Unicode in function names and decompiled
actual argument sources.

Also, fun_xdrObject was reversing property order when encoding;
fixed to maximize property tree compression gain.

Also^2, js_ConstructObject was not handling success+not-found
return from FindConstructor.

bug 127136, r=rginda, sr=shaver, a=chofmann
2002-03-03 00:59:16 +00:00
brendan%mozilla.org 57483a3082 Major footprint/perf win: share property state using a tree whose root represents empty scopes, and whose non-root nodes represent scopes with properties added in order from the root to that node; to use double hashing to map these tree-paths for per-scope property lookup; and avoid locking where possible through immutability and mostly-benign&rare race tolerance (62164, r=shaver, sr=jband). 2002-02-23 03:49:27 +00:00
brendan%mozilla.org aba15fbd2d Construct error objects to consolidate their default property setting; this entails adding JS_ConstructObjectWithArguments (123177, r=rginda, sr=shaver). 2002-02-14 07:25:34 +00:00
brendan%mozilla.org 2c41247d14 Fix failure to check for JS_InitClass failure, reported by Eric Brueggemann <eric_brueggemann@yahoo.com>, r=shaver, sr=mozbot. 2002-02-06 07:01:37 +00:00
brendan%mozilla.org 8b9fb46499 Avoid ClaimScope (lock-free to -full transition) in JS_GetClass and js_FinalizeObject called from the GC (109183, r=shaver, sr=jband). 2001-11-11 21:25:13 +00:00
brendan%mozilla.org c220d0c707 Avoid recursive join/toString death (108440, r=shaver, sr=jband). 2001-11-07 00:15:44 +00:00
brendan%mozilla.org d27c4cb86f Followup to bug 56940's big patch, tighten GC-mark case analysis, assume atom strings are immutable. 2001-10-28 22:37:25 +00:00
brendan%mozilla.org 894b19f8c3 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). 2001-10-25 00:26:38 +00:00
brendan%mozilla.org eb9671e246 Add SetAlphaBounds, TABLE_SIZE, and MIN_ALPHA APIs (103990, r=dbaron, sr=waterson). 2001-10-16 05:40:27 +00:00
brendan%mozilla.org 9324b81dee 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); }
2001-10-03 06:39:30 +00:00
gerv%gerv.net 1856815ff1 Oops. 2001-09-20 00:02:59 +00:00
scc%mozilla.org bc444f528a bug #98089: ripped new license 2001-09-19 22:39:41 +00:00
brendan%mozilla.org cf80f7240c Fix unsafe JS_DHashTableRawRemove usage; unoverload cx->resolving into a counter and a JSDHashTable pointer (94422, r/sr=jband,waterson with dbaron sanity checks). 2001-09-14 03:37:15 +00:00
brendan%mozilla.org 3efd0e519f 1. Fix jsdhash/pldhash.[ch] so that add/remove cycles for a given k do not
create a long chain of removed sentinels.  Also, when adding k to a table
    where k is not mapped, but where k hashes to a chain that includes removed
    sentinels, recycle the first removed sentinel in the chain for k's entry.
2.  Cache cx->resolving till js_DestroyContext, to avoid high JSDHashTable
    new/destroy overhead in js_LookupProperty.
3.  Add NS_TraceStack to nsTraceMalloc.[ch] and clean the .c file up a bit.
2001-09-12 06:39:31 +00:00
jband%netscape.com 23d7dc717d fix bug 97444. It is not good to patch a different fun into the frame. Let's safely shunt aside the callee frame instead. r=rogerl sr=brendan 2001-09-05 21:25:09 +00:00
brendan%mozilla.org 622522e134 Ignore property found in non-native prototype (12367, sr=jband&shaver, a=asa). 2001-09-03 22:29:12 +00:00
brendan%mozilla.org f319c1d822 Check keyword version when scanning, not by installing different keywords on version selection (when starting to compile; bug 96562, r=rogerl, sr=shaver&jband, a=dbaron). 2001-08-24 03:32:31 +00:00
brendan%mozilla.org 52f4ef75ac Fix 3-way deadlock by never nesting rt->gcLock inside rt->setSlotLock (90994, sr=shaver&jband). 2001-07-25 02:43:40 +00:00
jst%netscape.com 030da7b1b9 Fixing bug 86147. Adding code that does security checks on access to getter and setter functions for properties of DOM objects in JS. Also fixing a JS engine bug that caused problems with the real fix for this bug, the JS engine bug was that a jsid was passed as a jsval to the checkAccess() class hook. r=mstolts@netscape.com, sr=brendan@mozilla.org 2001-07-04 09:44:57 +00:00
jband%netscape.com ea41e651fd fix bug 78428 by making sure to use the lesser of the freeslot or nslots value when marking slots. This is necessary because objects can now be in an initial state where the freeslots is a larger number than the nslots - and the actual number of slots in the array. sr=brendan r=beard a=drivers 2001-06-05 00:47:56 +00:00
brendan%mozilla.org 769e09a93e - Add a generation number to JSDHashTable that counts entryStore changes due
to grows, shrinks, and compresses.  This helps JS_DHashTableOperate callers
  who hold returned entry pointers to validate those pointers and avoid having
  to re-lookup an entry by its key.
- Balance that addition by removing JSDHashTable.sizeMask, which is induced by
  JSDHashTable.sizeLog2 at the cost of two typically single-cycle instructions.
- Use JSDHashTable.generation in jsobj.c to avoid unsafely dereferencing an
  entry pointer held across calls to JSClass.resolve from js_LookupProperty,
  which may recur and add entries to cx->resolving, growing that table and
  invalidating entry pointers held by earlier js_LookupProperty activations.
(bug 78121, r=jst@netscape.com, sr=jband@netscape.com, a=asa@mozilla.org)
2001-05-25 03:05:38 +00:00
brendan%mozilla.org e46d5f7fc4 Warning abatement (r=polarbear, sr=lumpy). 2001-05-22 23:25:18 +00:00
brendan%mozilla.org a10d5eb5aa Unified resolve recursion damping (70358) and resolve-from-js_SetProperty (72354), r/sr=jband,jst,shaver. 2001-05-17 01:43:58 +00:00
jst%netscape.com ea706038cf Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com. 2001-05-08 17:42:36 +00:00
brendan%mozilla.org 841f7a55dd - 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.
2001-05-08 01:31:02 +00:00
brendan%mozilla.org ef5f23f75e Use parent, if non-null, as scope chain with which to find default proto from Class.prototype, in js_{New,Construct}Object (75975, sr=jband&jst). 2001-04-14 07:34:58 +00:00
brendan%mozilla.org 7c4a8fb64d Add __lookupGetter__ and __lookupSetter__ (71992, r=rogerl, sr=shaver). 2001-04-08 23:23:34 +00:00
brendan%mozilla.org cd37f8447b - 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.
2001-04-05 01:53:24 +00:00
brendan%mozilla.org e29e0e312d Quote reserved identifiers as well as non-lexical-identifier property ids in object literals (73598, r=jband, sr=shaver). 2001-04-04 07:45:22 +00:00
brendan%mozilla.org b0da40da16 - [jsemit.c] Fix horrid stupid bugs generating JSOP_ARGCNT and JSOP_ARGSUB,
where any occurrence of arguments.length or arguments[0], e.g., would be
  "optimized" to use those bytecodes.  This is just wrong if the occurrence
  is an operand of delete, ++, --, or the left-hand-side of an assignment
  operator!

- [jsfun.c, jsinterp.c]  args_getProperty etc. must use JS_GetInstancePrivate,
  not JS_GetPrivate, as the arguments object is exposed, and can be made a
  prototype of other objects that do not have private data, or private data
  that's a JSStackFrame*.  Same goes for fun_getProperty, js_GetArgument, etc.

- [jsfun.c, jsobj.c, jsstr.c]  No need to specialize fun_delProperty and
  str_delProperty to help convince users and ECMA conformance tests that
  fun.length and str.length are direct properties of instances, instead of
  being delegated to Function.prototype.length and String.prototype.length.
  This special case is done universally in js_DeleteProperty for all SHARED
  and PERMANENT proto-properties.

- [jshash.c]  Sneaking this followup-fix for bug 69271 in: use JS_HASH_BITS
  rather than hardcoded 32.

- [jsobj.c, jsscope.[ch]]  Fix misnamed js_HashValue (it takes a jsid, so it
  is now js_HashId).

- [jsscript.c] script_compile needs to call JS_InstanceOf, to ensure that obj
  is a Script object.
2001-03-22 02:52:42 +00:00
brendan%mozilla.org b1bad82b83 Fix js_LookupProperty to resolve iff the resolved-in object owns its own scope (jband private bug, r=jband, sr=shaver). 2001-03-11 02:35:10 +00:00
brendan%mozilla.org 69ab37f337 bugs 31003 and (mostly) 68045, r=rogerl, sr=shaver&hyatt
- Fix bug where script jssrcnote vector terminator was not XDRed.
- Ensure that memory is cleared by serializing zero padding bytes as needed
  under JS_XDRBytes and JS_XDRString.
- Fix JS_XDRValue to handle undefined and null JS types properly (bug 31003).
  Also make it cast from jsint to uint32 and back carefully, so as to work
  with negative numbers even on targets where jsval is a signed 64 bit type.
- Add JS_XDRScript public API.
- Optimize the per-JSXDRState class registry so it uses a JSDHashTable upon
  searching for a class-id by name in an overpopulated (for linear search)
  registry table.
- Clean up API nits such as JS_XDRNewBase => JS_XDRInitBase, with parameter
  list rotation to put cx last (JS_XDRInitBase is an infallible init helper,
  not an error-reporting, cx-comes-first, API entry point).
- Fix some XXX comments, unneeded masks, other nits.
- Make sure all JS XDR API functions start with JS_XDR.
2001-03-06 01:56:30 +00:00
brendan%mozilla.org 55d5713602 Don't deprecate __proto__, there ain't no forward-compatible alternative (68401, r=timeless, sr=shaver). 2001-02-24 03:07:58 +00:00
brendan%mozilla.org 8aa6c94c12 Crash fix (first part, two more files to come) for old-style obj.eval in a function (68498, r=bryner, sr=jband). 2001-02-14 09:11:09 +00:00