Commit Graph

25 Commits

Author SHA1 Message Date
bryner%brianryner.com
23089547be Add a NS_FASTCALL macro that specifies regparm(3) and stdcall on gcc/x86 to improve performance (passing up to 3 arguments in registers instead of on the stack, and having the caller pop any stack arguments). Apply NS_FASTCALL to our most frequently called non-public methods and functions. Also add NS_CDECL to explicitly specify the default calling convention and make it part of NS_IMETHOD, since xptcall can't deal with NS_FASTCALL. Bug 249652, r=darin, sr=dbaron. 2004-07-14 22:14:34 +00:00
brendan%mozilla.org
1d61995445 Unify license comment per js/src/plify_jsdhash.sed, plus comment simplification. 2004-01-15 02:00:55 +00:00
brendan%mozilla.org
b7cdb7debb Add shared DHashTableOps for [const] char *key use-cases, clean up dhash API abusages (214839, r=dougt, sr=dbaron). 2003-08-05 20:09:21 +00:00
brendan%mozilla.org
33cce84916 Disable DEBUG_brendan stuff. 2003-05-30 20:25:42 +00:00
brendan%mozilla.org
ae0c4d3804 Reorder static and const to match tradition; reomve DEBUG_brendan cruft. 2003-03-08 01:28:02 +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
b8d97d8b8c Defend against bad EndMuxedDocument calls, and assert in the underlying {JS,PL}_DHashTableRawRemove that entry is live (188744, r=jrgm, sr=ben). 2003-01-17 10:01:50 +00:00
brendan%mozilla.org
5380b54b0e Relax comments restricting Operate calls from enumerator to allow lookups (no bug, comment change only). 2002-11-26 00:32:07 +00:00
brendan%mozilla.org
5335692809 Make enumeration const unless PL_DHASH_REMOVE is returned by the etor callback; improve several comments (174859, r=waterson, sr=beard). 2002-11-13 04:35:37 +00:00
brendan%mozilla.org
12685fb2da Comment improvements motivated by bug 173797, no code changes. 2002-10-13 19:08:07 +00:00
brendan%mozilla.org
a099682b6e Fix a macro name (LIMIT, not MAX -- fencepost, not maximum value; r=lumpy, sr=jack). 2002-08-07 20:22:38 +00:00
brendan%mozilla.org
791ae0c843 Ensure a live keyHash *after* multiplying by the irrational (146907, r=dbaron, sr=shaver). 2002-06-05 00:47:38 +00:00
brendan%mozilla.org
6f45f575a4 Fix JS/PL_DHashTableEnumerate to compress or shrink the table after enumeration using the same logic as ADD and REMOVE use (120953, r=dbaron, sr=shaver, a=asa). 2002-03-14 21:55:08 +00:00
brendan%mozilla.org
6b265c5d37 Sync these mirrored sources with their primaries at js/src/jsdhash.[ch] (see bug 62164, r=shaver, sr=jband). 2002-02-23 10:04:29 +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
gerv%gerv.net
4e12e44b2f Relicensing Round 1, Take 2. Most C-like NPL files -> NPL/GPL/LGPL. Bug 98089. 2001-09-28 20:14:13 +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
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
69dc0b2e55 Fix ChangeTable and how it's called (74883, r=gordon, sr=waterson, mcafee approved). 2001-05-16 21:41:52 +00:00
anthonyd%netscape.com
34c0ca3147 Patch around ChangeTable bug (brendan, r=gordon, smoketestblocker). 2001-05-15 23:41:32 +00:00
brendan%mozilla.org
38fa3fed08 Add optional JSDHashTableOps.initEntry hook, spruce up comments (74883, r=waterson, sr=shaver). 2001-05-15 21:07:10 +00:00
waterson%netscape.com
3e355a7cf3 Bug 73540. Make sure [JS|PL]DHashTable clear live entries while finalizing. Remove induction variable from [JS|PL]_DHashEnumerate() along the way. r=brendan, sr=shaver 2001-03-27 06:24:25 +00:00
brendan%mozilla.org
1e8530d216 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 pldhash.h helps analyze when to use double
  hashing (most of the time) vs. when to use chaining.
- Subroutine ChangeTable from PL_DHashTableOperate so it can be called from
  PL_DHashTableEnumerate, if the latter finds that enough entries have been
  removed to be worth a shrink or compress cycle.
2001-03-14 07:48:07 +00:00
brendan%mozilla.org
2b858a9a05 Forgot to round capacity up to nearest power of two\! r=bienvenu. 2000-08-31 03:12:40 +00:00
brendan%mozilla.org
da11005af4 Add pldhash.[ch], sed-translated from js/src/jsdhash.[ch]. 2000-08-30 19:32:03 +00:00