59 Commits

Author SHA1 Message Date
brendan%mozilla.org
e555a7c1cf Recover trapped opcode in js_GetIndexFromBytecode (416665, r=igor).
git-svn-id: svn://10.0.0.236/trunk@245889 18797224-902f-48f8-a5cc-f745e15eee43
2008-02-18 01:32:12 +00:00
brendan%mozilla.org
5ea4994939 Return of the property cache (365851, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@245186 18797224-902f-48f8-a5cc-f745e15eee43
2008-02-07 23:18:45 +00:00
jwalden%mit.edu
680af8da29 Bug 376957 - Prevent data leaks from cross-site JSON loads (JavaScript literals), by making the global name bindings ReadOnly/DontDelete and making [] and {} use the global bindings. Still more that can be done here, but this covers a lot of the fix. r+a=brendan
git-svn-id: svn://10.0.0.236/trunk@240378 18797224-902f-48f8-a5cc-f745e15eee43
2007-12-04 03:05:24 +00:00
igor%mir2.org
db5133bf70 Bug 398609: simpler handling of hidden properties, r,a=brendan
git-svn-id: svn://10.0.0.236/trunk@239660 18797224-902f-48f8-a5cc-f745e15eee43
2007-11-19 17:15:45 +00:00
igor%mir2.org
6c8e3eaa97 Bug 398609: backing out due to test failures.
git-svn-id: svn://10.0.0.236/trunk@239619 18797224-902f-48f8-a5cc-f745e15eee43
2007-11-19 00:58:46 +00:00
igor%mir2.org
778ffb85c1 Bug 398609: cleanup of hidden properties support. r,a=brendan
git-svn-id: svn://10.0.0.236/trunk@239618 18797224-902f-48f8-a5cc-f745e15eee43
2007-11-19 00:36:50 +00:00
igor%mir2.org
0541de0428 Bug 398609: Backing out due to mochi test failure.
git-svn-id: svn://10.0.0.236/trunk@239325 18797224-902f-48f8-a5cc-f745e15eee43
2007-11-13 15:47:28 +00:00
igor%mir2.org
2e65d4ff36 Bug 398609: cleanup of hidden properties. r,a=brendan
git-svn-id: svn://10.0.0.236/trunk@239322 18797224-902f-48f8-a5cc-f745e15eee43
2007-11-13 14:56:18 +00:00
igor%mir2.org
014dceca4a Bug 387286: patch from Rich Dougherty to name constitently JOF_* flags. r=me
git-svn-id: svn://10.0.0.236/trunk@231651 18797224-902f-48f8-a5cc-f745e15eee43
2007-08-08 13:35:05 +00:00
igor%mir2.org
3482078f3d Bug 386885: JSAtom.number is removed in favour of using atoms itself for hashing. r=brendan
git-svn-id: svn://10.0.0.236/trunk@229690 18797224-902f-48f8-a5cc-f745e15eee43
2007-07-11 09:25:45 +00:00
igor%mir2.org
0ec23405cf Bug 385729: objects and regexps are stored in separated tables in JSScript. r=brendan,mrbkap
git-svn-id: svn://10.0.0.236/trunk@229506 18797224-902f-48f8-a5cc-f745e15eee43
2007-07-08 09:03:37 +00:00
igor%mir2.org
817a698900 Bug 381973: new opcode flag top declare an extra temporary slot used by interpreter. r=brendan
git-svn-id: svn://10.0.0.236/trunk@227482 18797224-902f-48f8-a5cc-f745e15eee43
2007-06-04 20:01:41 +00:00
brendan%mozilla.org
d943774bf5 Fix JOF_XMLNAME, etc., interrogation to mask the mode bits and compare (381504, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@226859 18797224-902f-48f8-a5cc-f745e15eee43
2007-05-23 06:04:18 +00:00
brendan%mozilla.org
9c307e16dc Support generator expressions for JS1.8 (380237, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@226595 18797224-902f-48f8-a5cc-f745e15eee43
2007-05-18 01:41:17 +00:00
igor%mir2.org
d637463ffb Bug 379855: js_CodeSpec.name/token are moved to separated arrays to shrink the code. r=brendan
git-svn-id: svn://10.0.0.236/trunk@226002 18797224-902f-48f8-a5cc-f745e15eee43
2007-05-06 10:50:07 +00:00
igor%mir2.org
be8566dadc Bug 373175: hiding code to set arena names behind JS_ARENAMETER. r=brendan
git-svn-id: svn://10.0.0.236/trunk@224346 18797224-902f-48f8-a5cc-f745e15eee43
2007-04-10 13:29:10 +00:00
igor.bukanov%gmail.com
ee65483439 Bug 366725: JS_GetString(Bytes|Chars) are no longer used in SpiderMonkey.
git-svn-id: svn://10.0.0.236/trunk@221525 18797224-902f-48f8-a5cc-f745e15eee43
2007-03-08 06:25:23 +00:00
igor.bukanov%gmail.com
034f20ab05 Bug 363530: Optimizing JS function/method calling bytecodes. r=brendan
git-svn-id: svn://10.0.0.236/trunk@221126 18797224-902f-48f8-a5cc-f745e15eee43
2007-03-01 01:33:46 +00:00
igor.bukanov%gmail.com
cae329a112 Bug 36680: new function to report error using decompiled jsval text. r=brendan
git-svn-id: svn://10.0.0.236/trunk@218666 18797224-902f-48f8-a5cc-f745e15eee43
2007-01-19 08:37:55 +00:00
igor.bukanov%gmail.com
2f1623948d Bug 366236: cleanup and debug checks for atom indexes. r=brendan
git-svn-id: svn://10.0.0.236/trunk@218238 18797224-902f-48f8-a5cc-f745e15eee43
2007-01-12 12:10:36 +00:00
brendan%mozilla.org
834076962c Igor's patch for simpler extended atom indexing (365608, tweaks and r=me).
git-svn-id: svn://10.0.0.236/trunk@217908 18797224-902f-48f8-a5cc-f745e15eee43
2007-01-06 23:25:00 +00:00
brendan%mozilla.org
2da9a2eaba Optimize x.p for arg/var/local x; fix decompiler bugs hiding nearby (363536, r=igor).
git-svn-id: svn://10.0.0.236/trunk@217489 18797224-902f-48f8-a5cc-f745e15eee43
2006-12-27 23:47:13 +00:00
brendan%mozilla.org
543e5891d9 Prep patch for 'plan A' (346642, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@211917 18797224-902f-48f8-a5cc-f745e15eee43
2006-09-18 11:04:30 +00:00
brendan%mozilla.org
ec020514bd Change catch clauses to use lexical scope, etc. (336379, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@207546 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-16 05:01:14 +00:00
brendan%mozilla.org
01d8f43d47 Backing out yet again, another latent bug bites.
git-svn-id: svn://10.0.0.236/trunk@207426 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-15 07:39:01 +00:00
brendan%mozilla.org
208e581b5d Change catch clauses to use lexical scope, etc. (336379, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@207423 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-15 07:03:14 +00:00
brendan%mozilla.org
7dd2751681 Back out last change for now, it ran into a latent block XDR bug.
git-svn-id: svn://10.0.0.236/trunk@207413 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-15 03:51:23 +00:00
brendan%mozilla.org
08081ef816 Change catch clauses to use lexical scope, etc. (336379, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@207404 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-15 01:29:37 +00:00
brendan%mozilla.org
0a940b7247 JS_1_7_ALPHA_BRANCH landing, mainly destructuring optimizations and let completion (336373, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@201636 18797224-902f-48f8-a5cc-f745e15eee43
2006-07-06 01:25:44 +00:00
brendan%mozilla.org
2fb9f8c051 First big wave of js1.7 changes (326466, 336376, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@198099 18797224-902f-48f8-a5cc-f745e15eee43
2006-05-20 22:27:28 +00:00
igor%mir2.org
896b9e308e Bug 327896: JS_STATIC_ASSERT is now used to assert constant conditions during compilation time instead of waiting for runtime to check for JS_ASSERT. r=brendan
git-svn-id: svn://10.0.0.236/trunk@190667 18797224-902f-48f8-a5cc-f745e15eee43
2006-02-21 10:27:50 +00:00
brendan%mozilla.org
8494b10ef8 Fix up disassembly of 24-bit-immediate formats (DEBUG-only 316862, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@186894 18797224-902f-48f8-a5cc-f745e15eee43
2006-01-04 05:53:16 +00:00
brendan%mozilla.org
aae99a8a67 Allow up to 2^23 literals in a script (155081, r=shaver, a=me).
git-svn-id: svn://10.0.0.236/trunk@172641 18797224-902f-48f8-a5cc-f745e15eee43
2005-04-23 02:14:20 +00:00
brendan%mozilla.org
f28e3637eb Expand tabs.
git-svn-id: svn://10.0.0.236/trunk@166467 18797224-902f-48f8-a5cc-f745e15eee43
2004-12-09 01:32:19 +00:00
brendan%mozilla.org
6746fcd9bd Better XML string exclusion, plus js_default_str, based on codesighs (followup to 246441).
git-svn-id: svn://10.0.0.236/trunk@163246 18797224-902f-48f8-a5cc-f745e15eee43
2004-10-05 16:57:13 +00:00
brendan%mozilla.org
e1d64a36be Initial E4X check-in, configured off (246441, rs=shaver).
git-svn-id: svn://10.0.0.236/trunk@163236 18797224-902f-48f8-a5cc-f745e15eee43
2004-10-05 10:19:07 +00:00
brendan%mozilla.org
2e85eaa612 Add JSRESOLVE_DECLARING and JSRESOLVE_CLASSNAME support for better DOM quirk emulation (257602, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@161606 18797224-902f-48f8-a5cc-f745e15eee43
2004-09-01 20:51:39 +00:00
brendan%mozilla.org
9edbb0b2c1 Improve JSRESOLVE_DETECTING by treating 'terminal' uses of, e.g., document.all as detecting (248549, r=jst).
git-svn-id: svn://10.0.0.236/trunk@159266 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-15 18:53:59 +00:00
gerv%gerv.net
123c4a9492 Bug 205418 - Relicense Spidermonkey (js/src) to MPL/LGPL/GPL. Patch by gerv; r,a=brendan.
git-svn-id: svn://10.0.0.236/trunk@149331 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-15 00:11:16 +00:00
brendan%mozilla.org
2532d3d12a Big dynamic footprint win via script filename caching, plus line number fix for strict/const diags (see http://bugzilla.mozilla.org/attachment.cgi?id=127130&action=view for detailed checkin comments; 208030, r/rs=shaver, r=rginda on the jsd change, r=jst on the dom change).
git-svn-id: svn://10.0.0.236/trunk@145239 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-26 22:37:11 +00:00
brendan%mozilla.org
8f59258858 Fix JSOP_BINDNAME to have JOF_SET (which is now the same as JOF_ASSIGNING, so use that where it's a clearer name; 94693, r=me).
git-svn-id: svn://10.0.0.236/trunk@139832 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-20 11:05:10 +00:00
timeless%mac.com
69ae314807 Bug 106386 rid source of misspellings
r=db48x sr=blake a=asa


git-svn-id: svn://10.0.0.236/trunk@116832 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-19 04:30:17 +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
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
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
gerv%gerv.net
ae1d5501a1 Oops.
git-svn-id: svn://10.0.0.236/trunk@103236 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-20 00:02:59 +00:00
scc%mozilla.org
2281a4d137 bug #98089: ripped new license
git-svn-id: svn://10.0.0.236/trunk@103230 18797224-902f-48f8-a5cc-f745e15eee43
2001-09-19 22:39:41 +00:00
brendan%mozilla.org
713ac17d77 - Shaver hacked this fix with advice from me, and I carried it to check-in. We now avoid a heavyweight outer function when the inner one is defined at top-level or in an expression (is not a JSOP_CLOSURE, IOW), and it doesn't refer to any non-local names. See bug 65308 for details on the win. (r=rogerl, sr=brendan)
- Fix scope chain for nested functions at top-level (JSOP_DEFFUN), in a part of another statement (JSOP_CLOSURE), and unnamed in an expression (JSOP_ANONFUNOBJ) to match ECMA-262 13.2.  My bad: fp->varobj was used up till now, instead of fp->scopeChain; we still *bind* the name of a statement-level (top or not) nested function in fp->varobj.  This fixes bug 69559.  (r=rogerl, sr=jband)
- Add an Intern command to the shell, for GC vs. intern'ed atom testing.


git-svn-id: svn://10.0.0.236/trunk@87871 18797224-902f-48f8-a5cc-f745e15eee43
2001-02-24 03:00:56 +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
43d1d6a141 - Eliminate ancient, bogus proxying of function object for its call objects (23346, r=jband@netscape.com).
- Tabs expanded as much as I could stand, without taking too much cvsblame.


git-svn-id: svn://10.0.0.236/trunk@59716 18797224-902f-48f8-a5cc-f745e15eee43
2000-02-04 02:01:49 +00:00