1696 Commits

Author SHA1 Message Date
dbradley%netscape.com
636bf8b5b0 Bug 83426 - Remove DOM exception hack. r=jst, r=dbradley, sr=jband
git-svn-id: svn://10.0.0.236/trunk@106972 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-01 15:52:53 +00:00
jband%netscape.com
3b3d9f5aaf fixing warnings from recent landing and uncommenting test cases I did not mean to comment out for the checkin
git-svn-id: svn://10.0.0.236/trunk@106926 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-01 05:18:35 +00:00
brendan%mozilla.org
bd7ff6eb3b Fix nul-termination assumption hidden in lastIndexOf, broken by dependent strings fix for bug 56940 (107771, r=jag, sr=waterson).
git-svn-id: svn://10.0.0.236/trunk@106916 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-01 03:19:54 +00:00
jband%netscape.com
958b4e78e0 fix Mac bustage. I can't believe the Mac can't do this conversion without a cast!
git-svn-id: svn://10.0.0.236/trunk@106914 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-01 02:36:19 +00:00
jband%netscape.com
1c7f2a930e the HP compiler says that anonymous unions can't even have structs. So the union must be named. Fixing that bustage
git-svn-id: svn://10.0.0.236/trunk@106909 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-01 01:45:48 +00:00
jband%netscape.com
4246348236 fix Mac bustage (I hope). I think these names conflicted with other names
git-svn-id: svn://10.0.0.236/trunk@106908 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-01 01:15:53 +00:00
seawood%netscape.com
acaf3004b5 Since '-framework Carbon' causes binaries to require console access to run, do not link using that flag by default. Otherwise, remote builds & non-console tinderboxes will break. Mac OSX Mach-O only.
Bug #107696 r=mozbot


git-svn-id: svn://10.0.0.236/trunk@106904 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-01 00:54:48 +00:00
pete%alphanumerica.com
3c4492f3e0 b=107823, r=ccarlen, sr=brendan
--pete


git-svn-id: svn://10.0.0.236/trunk@106886 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-01 00:11:15 +00:00
jband%netscape.com
57fc23094c add support for nsIVariant and nsIPropertyBag. bug 44675 and bug 98209. sr=vidur r=dbradley
git-svn-id: svn://10.0.0.236/trunk@106867 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-31 23:35:07 +00:00
rginda%netscape.com
4e00b5d217 bug 99601, don't install xpconnect debugger keyword handler if one is already there, r=jband, sr=brendan
git-svn-id: svn://10.0.0.236/trunk@106854 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-31 23:13:17 +00:00
brendan%mozilla.org
7c84ad604a Don't try to correct = to == if strict, do it only if downrev (106244, r=jband, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@106796 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-31 03:17:00 +00:00
brendan%mozilla.org
4b80be2931 Ensure atom strings are immutable -- duh! (107138, r=jag, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@106626 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-30 02:33:41 +00:00
brendan%mozilla.org
bc470f1b6b Consolidate property cache flush under JS_ClearScope (107265, r=shaver, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@106560 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-29 19:30:03 +00:00
brendan%mozilla.org
f5e80ade8f Followup to bug 56940's big patch, tighten GC-mark case analysis, assume atom strings are immutable.
git-svn-id: svn://10.0.0.236/trunk@106522 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-28 22:37:25 +00:00
brendan%mozilla.org
8dc3d47fd7 Ensure proper pointer alignment in oversized arena footers (105726, r/sr=jband,shaver).
git-svn-id: svn://10.0.0.236/trunk@106516 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-28 20:41:53 +00:00
brendan%mozilla.org
788b8d31b2 Avoid stack overflow in js_EmitTree on long left-associative operator chains (98901, r=jband, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@106489 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-27 18:38:16 +00:00
seawood%netscape.com
4551221bef Landing the rest of the mach-o OSX changes.
Bug #75653 r=cls sr=waterson


git-svn-id: svn://10.0.0.236/trunk@106461 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-27 07:38:18 +00:00
mike+mozilla%meer.net
cf412012ae Initial checkin of build file for Darwin1.4.mk. It just includes Darwin1.3.mk. Because I happened to be fooling around with an OS X system.
git-svn-id: svn://10.0.0.236/trunk@106349 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-26 09:38:43 +00:00
alecf%netscape.com
58b7676c67 other part of bug 106130, remove unicharutil dependency and linking (just requires updates)
git-svn-id: svn://10.0.0.236/trunk@106318 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-26 03:06:04 +00:00
brendan%mozilla.org
d33cfeae5d epstein@tellme.com's patch implementing JS_ClearNewbornRoots (106790, r=brendan, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@106312 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-26 02:38:10 +00:00
brendan%mozilla.org
8b45204d8c khanson@netscape.com's fix for silent ValueIsLength failure (101488, r=rogerl, sr=me).
git-svn-id: svn://10.0.0.236/trunk@106311 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-26 02:35:01 +00:00
jst%netscape.com
d3611e95e0 Fixing bug 106823. Pass the length to nsAString::Assign() to make sure we don't loose embedded null characters in strings, and also to speed things up a bit. Also trunkate strings before 'voiding' them to make sure old string data is deleted from the string before it's reused. r=bzbarsky@mit.edu, rs=jband@netscape.com
git-svn-id: svn://10.0.0.236/trunk@106304 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-26 02:18:16 +00:00
dbradley%netscape.com
759a8eb6b7 Bug 106130 - Remove dependancy of xpconnect on intl. r=alecf, sr=shaver, patch=jband
git-svn-id: svn://10.0.0.236/trunk@106268 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-25 12:07:23 +00:00
brendan%mozilla.org
2163e55b8e 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).
git-svn-id: svn://10.0.0.236/trunk@106213 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-25 00:26:38 +00:00
jaggernaut%netscape.com
bc36e83f58 Bug 53057: Fixing up users of implicit |CharT*| conversion operators for nsCString to use |.get()| instead, rr=dbaron, rs=scc
git-svn-id: svn://10.0.0.236/trunk@106162 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-24 09:43:59 +00:00
jst%netscape.com
51e4831f64 Fixing bug 69468. Finally adding support for string nullness to XPConnect. r=jaggernaut@netscape.com, shaver@mozilla.org, sr=jband@netscape.com
git-svn-id: svn://10.0.0.236/trunk@106148 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-24 07:15:06 +00:00
cls%seawood.org
2bd5f6543a Since the purpose of --enable-ultrasparc is to just flip on the ultrasparc-specific js compare & swap code, move the asflags/defines to turn it on back into js/src/Makefile.in rather than causing the entire project to be built with those flags.
git-svn-id: svn://10.0.0.236/trunk@106037 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-23 08:17:16 +00:00
dougt%netscape.com
fa2d0b7e98 99163 - removing nsObserverService.h includes. Also fixing 106090, extra methods on nsObserverService. r=shaver@mozilla.org, sr=jband@netscape.com
git-svn-id: svn://10.0.0.236/trunk@105973 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-22 22:01:27 +00:00
alecf%netscape.com
93701a7f68 bug 100214 - add libunicharutil_s to all unix projects that require it, r=cls
git-svn-id: svn://10.0.0.236/trunk@105956 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-22 20:44:02 +00:00
jaggernaut%netscape.com
32692449ba Bug 105973: s/Observe/observe/
git-svn-id: svn://10.0.0.236/trunk@105918 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-22 04:16:33 +00:00
dougt%netscape.com
cf60fc042e nsIObserver and nsIObserverService API freeze. r=rpotts@netscape.com, alecf@netscape.com. bug 99163
git-svn-id: svn://10.0.0.236/trunk@105800 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-19 20:52:59 +00:00
brendan%mozilla.org
f51a743f35 Avoid converting lock-free to lock-full scope from GC mark call-outs (105571, r=jst, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@105742 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-19 03:02:41 +00:00
dbradley%netscape.com
9bc41bcde1 bug 103649 - Crash when rendering a page with hundreds of iframes - This reduces the number of calls to JS_ContextIterator from XPCJSRuntime::SyncXPCContextList. It is only the first step in addressing this bug. r=jband, sr=jst
git-svn-id: svn://10.0.0.236/trunk@105614 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-17 11:52:55 +00:00
brendan%mozilla.org
0fcd3e9626 Checking in scole@planetweb.com's patch to prefix str_escape with js_ (96084, r=rogerl, sr=brendan).
git-svn-id: svn://10.0.0.236/trunk@105611 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-17 08:16:53 +00:00
brendan%mozilla.org
69d4fd60de Fixes for bug 80981 (``Need extended jump bytecode to avoid "script too large"
errors, etc.''):

We now ReportStatementTooLarge only if
- a jump offset overflows 32 bits, signed;
- there are 2**32 or more span dependencies in a script;
- a backpatch chain link is more than (2**30 - 1) bytecodes long;
- a source note's distance from the last note, or from script main entry
  point, is > 0x7fffff bytes.

Narrative of the patch, by file:

- js.c
  The js_SrcNoteName array of const char * is now a js_SrcNoteSpec array of
  "specifiers", structs that include a const char *name member.  Also, due to
  span-dependent jumps at the ends of basic blocks where the decompiler knows
  the basic block length, but not the jump format, we need an offset operand
  for SRC_COND, SRC_IF_ELSE, and SRC_WHILE (to tell the distance from the
  branch bytecode after the condition expression to the span-dependent jump).

- jsarena.[ch]
  JS arenas are used mainly for last-in-first-out allocation with _en masse_
  release to the malloc pool (or, optionally, to a private freelist).  But
  the code generator needs to allocate and grow (by doubling, to avoid O(n^2)
  growth) allocations that hold bytecode, source notes, and span-dependency
  records.  This exception to LIFO allocation works by claiming an entire
  arena from the pool and realloc'ing it, as soon as the allocation size
  reaches the pool's default arena size.  Call such an allocation a "large
  single allocation".

  This patch adds a new arena API, JS_ArenaFreeAllocation, which can be used
  to free a large single allocation.  If called with an allocation that's not
  a large single allocation, it will nevertheless attempt to retract the arena
  containing that allocation, if the allocation is last within its arena.
  Thus JS_ArenaFreeAllocation adds a non-LIFO "free" special case to match the
  non-LIFO "grow" special case already implemented under JS_ARENA_GROW for
  large single allocations.

  The code generator still benefits via this extension to arenas, over purely
  manual malloc/realloc/free, by virtue of _en masse_ free (JS_ARENA_RELEASE
  after code generation has completed, successfully or not).

  To avoid searching for the previous arena, in order to update its next
  member upon reallocation of the arena containing a large single allocation,
  the oversized arena has a back-pointer to that next member stored (but not
  as allocable space within the arena) in a (JSArena **) footer at its end.

- jscntxt.c
  I've observed for many scripts that the bytes of source notes and bytecode
  are of comparable lengths, but only now am I fixing the default arena size
  for cx->notePool to match the size for cx->codePool (1024 instead of 256).

- jsemit.c
  Span-dependent instructions in JS bytecode consist of the jump (JOF_JUMP)
  and switch (JOF_LOOKUPSWITCH, JOF_TABLESWITCH) format opcodes, subdivided
  into unconditional (gotos and gosubs), and conditional jumps or branches
  (which pop a value, test it, and jump depending on its value).  Most jumps
  have just one immediate operand, a signed offset from the jump opcode's pc
  to the target bytecode.  The lookup and table switch opcodes may contain
  many jump offsets.

  This patch adds "X" counterparts to the opcodes/formats (X is suffixed, btw,
  to prefer JSOP_ORX and thereby to avoid colliding on the JSOP_XOR name for
  the extended form of the JSOP_OR branch opcode).  The unextended or short
  formats have 16-bit signed immediate offset operands, the extended or long
  formats have 32-bit signed immediates.  The span-dependency problem consists
  of selecting as few long instructions as possible, or about as few -- since
  jumps can span other jumps, extending one jump may cause another to need to
  be extended.

  Most JS scripts are short, so need no extended jumps.  We optimize for this
  case by generating short jumps until we know a long jump is needed.  After
  that point, we keep generating short jumps, but each jump's 16-bit immediate
  offset operand is actually an unsigned index into cg->spanDeps, an array of
  JSSpanDep structs.  Each struct tells the top offset in the script of the
  opcode, the "before" offset of the jump (which will be the same as top for
  simplex jumps, but which will index further into the bytecode array for a
  non-initial jump offset in a lookup or table switch), the after "offset"
  adjusted during span-dependent instruction selection (initially the same
  value as the "before" offset), and the jump target (more below).

  Since we generate cg->spanDeps lazily, from within js_SetJumpOffset, we must
  ensure that all bytecode generated so far can be inspected to discover where
  the jump offset immediate operands lie within CG_CODE(cg).  But the bonus is
  that we generate span-dependency records sorted by their offsets, so we can
  binary-search when trying to find a JSSpanDep for a given bytecode offset,
  or the nearest JSSpanDep at or above a given pc.

  To avoid limiting scripts to 64K jumps, if the cg->spanDeps index overflows
  65534, we store SPANDEP_INDEX_HUGE in the jump's immediate operand.  This
  tells us that we need to binary-search for the cg->spanDeps entry by the
  jump opcode's bytecode offset (sd->before).

  Jump targets need to be maintained in a data structure that lets us look
  up an already-known target by its address (jumps may have a common target),
  and that also lets us update the addresses (script-relative, a.k.a. absolute
  offsets) of targets that come after a jump target (for when a jump below
  that target needs to be extended).  We use an AVL tree, implemented using
  recursion, but with some tricky optimizations to its height-balancing code
  (see http://www.enteract.com/~bradapp/ftp/src/libs/C++/AvlTrees.html).

  A final wrinkle: backpatch chains are linked by jump-to-jump offsets with
  positive sign, even though they link "backward" (i.e., toward lower bytecode
  address).  We don't want to waste space and search time in the AVL tree for
  such temporary backpatch deltas, so we use a single-bit wildcard scheme to
  tag true JSJumpTarget pointers and encode untagged, signed (positive) deltas
  in JSSpanDep.target pointers, depending on whether the JSSpanDep has a known
  target, or is still awaiting backpatching.

  Note that backpatch chains would present a problem for BuildSpanDepTable,
  which inspects bytecode to build cg->spanDeps on demand, when the first
  short jump offset overflows.  To solve this temporary problem, we emit a
  proxy bytecode (JSOP_BACKPATCH; JSOP_BACKPATCH_PUSH for jumps that push a
  result on the interpreter's stack, namely JSOP_GOSUB; or JSOP_BACKPATCH_POP
  for branch ops) whose nuses/ndefs counts help keep the stack balanced, but
  whose opcode format distinguishes its backpatch delta immediate operand from
  a normal jump offset.

  The cg->spanDeps array and JSJumpTarget structs are allocated from the
  cx->tempPool arena-pool.  This created a LIFO vs. non-LIFO conflict: there
  were two places under the TOK_SWITCH case in js_EmitTree that used tempPool
  to allocate and release a chunk of memory, during whose lifetime JSSpanDep
  and/or JSJumpTarget structs might also be allocated from tempPool -- the
  ensuing release would prove disastrous.  These bitmap and table temporaries
  are now allocated from the malloc heap.

- jsinterp.c
  Straightforward cloning and JUMP => JUMPX mutating of the jump and switch
  format bytecode cases.

- jsobj.c
  Silence warnings about %p used without (void *) casts.

- jsopcode.c
  Massive and scary decompiler whackage to cope with extended jumps, using
  source note offsets to help find jumps whose format (short or long) can't
  be discovered from properties of prior instructions in the script.

  One cute hack here: long || and && expressions are broken up to wrap before
  the 80th column, with the operator at the end of each non-terminal line.

- jsopcode.h, jsopcode.tbl
  The new extended jump opcodes, formats, and fundamental parameterization
  macros.  Also, more comments.

- jsparse.c
  Random and probably only aesthetic fix to avoid decorating a foo[i]++ or
  --foo[i] parse tree node with JSOP_SETCALL, wrongly (only foo(i)++ or
  --foo(i), or the other post- or prefix form operator, should have such an
  opcode decoration on its parse tree).

- jsscript.h
  Random macro naming sanity: use trailing _ rather than leading _ for macro
  local variables in order to avoid invading the standard C global namespace.


git-svn-id: svn://10.0.0.236/trunk@105588 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-17 03:16:48 +00:00
jband%netscape.com
1203a52b41 trivial warning fix. rs=jband
git-svn-id: svn://10.0.0.236/trunk@105471 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 05:48:25 +00:00
brendan%mozilla.org
040a610072 Add SetAlphaBounds, TABLE_SIZE, and MIN_ALPHA APIs (103990, r=dbaron, sr=waterson).
git-svn-id: svn://10.0.0.236/trunk@105470 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 05:40:27 +00:00
dougt%netscape.com
2367cd653a API Freeze for nsIServiceManager r=shaver@mozilla.org, sr=rpotts@netscape.com bug 99147
git-svn-id: svn://10.0.0.236/trunk@105458 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 03:35:52 +00:00
brendan%mozilla.org
f0ffd6eaeb Fix js_GC to mark max(#actuals, #formals) slots at fp->argv (104584, r=shaver, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@105455 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-16 02:21:02 +00:00
bryner%netscape.com
4ee338ff6b Bug 102725 -- problems converting numbers to strings when using gcc -O2. r=bbaetz, sr=brendan.
git-svn-id: svn://10.0.0.236/trunk@105429 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-15 22:31:39 +00:00
jband%netscape.com
ab59dfb6c9 not yet part of build. support tracking the iid in array of interfaces
git-svn-id: svn://10.0.0.236/trunk@105279 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-12 20:29:19 +00:00
brendan%mozilla.org
9cdd2afd56 Avoid O(n**2) growth rate of token buffer arena-based reallocation (103042, r=jband, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@105062 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-10 20:19:12 +00:00
jband%netscape.com
61ab7b9603 NOT PART OF BUILD. bug 44675. bug 98209. New files
git-svn-id: svn://10.0.0.236/trunk@104964 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 23:42:22 +00:00
dbradley%netscape.com
e8297e7cfa bug 102750 - Can't call JSIID.equals from web content. r=mstoltz, sr=jband
git-svn-id: svn://10.0.0.236/trunk@104923 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-09 18:54:37 +00:00
jband%netscape.com
029cf25395 fix bug 103259. Avoid crasher by correctly marking sharedscriptable object so that JSClasses don't get collected prematurely even when wrapper is 'stillborn' and not reflected into JS. r=dbradley sr=vidur.
git-svn-id: svn://10.0.0.236/trunk@104812 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-08 19:56:25 +00:00
jaggernaut%netscape.com
bf7774eb72 Bug 81444: eliminate |null_nsCOMPtr|. Eliminating all callers, r=syd, rs=mozbot.
git-svn-id: svn://10.0.0.236/trunk@104764 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-07 10:58:39 +00:00
jaggernaut%netscape.com
5bcb5cf396 Clean up REQUIRES lines.
git-svn-id: svn://10.0.0.236/trunk@104763 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-07 10:35:41 +00:00
brendan%mozilla.org
8ff485a9c1 Fix bogus return JS_FALSE without error report for empty flat string regexp match/replace (83293, r=rogerl, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@104731 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-06 08:07:43 +00:00
brendan%mozilla.org
726006598c 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); }


git-svn-id: svn://10.0.0.236/trunk@104525 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-03 06:39:30 +00:00
dbradley%netscape.com
203af34b05 bug 100665 - Maybe xpconnect should not init the XPCOutArg JSClass. r=jband, sr=shaver
git-svn-id: svn://10.0.0.236/trunk@104515 18797224-902f-48f8-a5cc-f745e15eee43
2001-10-03 02:57:42 +00:00