76 Commits

Author SHA1 Message Date
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
66979b2420 No strict warnings without the strict option, and other js1.5/mozilla1.0 tidying (129972, r=shaver, sr=jband, a=asa).
git-svn-id: svn://10.0.0.236/trunk@116505 18797224-902f-48f8-a5cc-f745e15eee43
2002-03-14 00:14:48 +00:00
brendan%mozilla.org
f780c9a84e 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).
git-svn-id: svn://10.0.0.236/trunk@115266 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-23 03:49:27 +00:00
brendan%mozilla.org
70118ca998 Quick followup to last checkin -- warning fixes (d'oh!)
git-svn-id: svn://10.0.0.236/trunk@113772 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-06 07:56:29 +00:00
brendan%mozilla.org
31cf9fbeb3 Fix call and new expression parsenode beginning line number, where the arglist is on another line from the function or constructor, to avoid a bogus assertion in UPDATE_LINENO_NOTES, which is now replaced by better comments and an avoided gratuitous store to cg->currentLine (123371, r=rginda, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@113771 18797224-902f-48f8-a5cc-f745e15eee43
2002-02-06 07:39:20 +00:00
brendan%mozilla.org
c81d5d8b4b Don't double-drop a property when strict-warning about duplicate formals (115436, r=khanson, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@110768 18797224-902f-48f8-a5cc-f745e15eee43
2001-12-19 02:10:26 +00:00
brendan%mozilla.org
989357e2ad Don't warn or 'correct' = to == in a condition unless the right operand has greater precedence than == (106244, r=shaver, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@108556 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 05:20:57 +00:00
rginda%netscape.com
db72e1cb29 bug 108257, "source notes broken for functions compiled via JS_CompileUCFunctionForPrincipals", sr=brendan, r=shaver
no need to emit the function body after calling FunctionBody


git-svn-id: svn://10.0.0.236/trunk@107131 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-03 00:10:47 +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
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
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
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
97dea81da0 Support ref()++ etc. for native ref (75688) and fix exn_toSource (96284); sr=shaver&jband.
git-svn-id: svn://10.0.0.236/trunk@101627 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-22 04:59:28 +00:00
rginda%netscape.com
b34bd1f46f remove js_EmitTree call (And friends) because this stuff has already been taken care of by the Statements() call.
See bug 82188
patch=brendan, r=me, sr=jband


git-svn-id: svn://10.0.0.236/trunk@100264 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-03 05:20:59 +00:00
brendan%mozilla.org
130b8c8934 Always select JSOP_EVAL for unqualified eval calls (77578, r=rogerl, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@99167 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-13 06:13:56 +00:00
brendan%mozilla.org
afe0723131 Fix Function.prototype.to{Source,String} to parenthesize function objects that were expressed rather than declared (73760, r=rogerl, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@91805 18797224-902f-48f8-a5cc-f745e15eee43
2001-04-10 01:10:28 +00:00
brendan%mozilla.org
38d9d8b234 Fix 'import *;' (70308, r=shaver, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@88135 18797224-902f-48f8-a5cc-f745e15eee43
2001-02-28 00:17:19 +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
b32bfc9ddd Fix duplicate parsenode recycle in constant-folded if/else or ?: (69607, r=shaver, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@87647 18797224-902f-48f8-a5cc-f745e15eee43
2001-02-22 07:30:57 +00:00
brendan%mozilla.org
94c7e8ce8d Fix constant folder to recycle moved node, not whole tree, when simplifying 'true ? foo() : bar()' into 'foo()' (69345, r=shaver, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@87415 18797224-902f-48f8-a5cc-f745e15eee43
2001-02-20 01:25:39 +00:00
brendan%mozilla.org
c372c27928 Fix related eval and setTimeout regressions caused by bug 68498's patch (69165&69175, r=jband, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@87312 18797224-902f-48f8-a5cc-f745e15eee43
2001-02-19 00:31:20 +00:00
shaver%mozilla.org
e340798f8e Fold constants correctly when emitting as we compile (TCF_COMPILING).
(#69304, r=jband, sr=brendan)


git-svn-id: svn://10.0.0.236/trunk@87310 18797224-902f-48f8-a5cc-f745e15eee43
2001-02-18 20:58:08 +00:00
brendan%mozilla.org
cb6ad315e2 The rest of the fix for bug 68498, see the extensive comments in that bug (r=jband, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@87167 18797224-902f-48f8-a5cc-f745e15eee43
2001-02-16 02:04:12 +00:00
brendan%mozilla.org
554bf9f199 Fix compile-statements-as-we-go to work with warn-about-missing-final-return (66928, r=jband, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@86274 18797224-902f-48f8-a5cc-f745e15eee43
2001-02-06 01:23:29 +00:00
brendan%mozilla.org
88999be56e Fixes for bug 33390 (r=mccabe, sr=shaver)
- Optimize compile (parse+emit) operation to generate code for each top-level
  statement or function in turn, recycling JSParseNodes as we go for greatly
  reduced "long linear script" footprint.
- Fix O(n**2) growth problems in bytecode and srcnote generation.
- Add js_ParseTokenStream entry point to compiler, for tree-generation without
  code-generation.  Move JSOP_EVAL instruction selection from code-generator to
  parser, to match other such specializations and enable js_ParseTokenStream.
- Fix js_CompileTokenStream (and get it right in new js_ParseTokenStream) to
  respect JSOPTION_VAROBJFIX.
- Clean up bracing, multi-line conditions, and overlong lines.


git-svn-id: svn://10.0.0.236/trunk@85619 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-27 08:00:45 +00:00
brendan%mozilla.org
1c7d4471fa Fixes for bug 61898 (which has morphed), r=rogerl, sr=jband.
- Optimize integer ++ and -- to avoid double-to-int, which is quite costly for
  some compilers (ftol on Windows with MSVC).
- Optimized arguments[i] and arguments.length references to use bytecodes that
  avoid creating an arguments object for the current frame.  This entailed
  simplifying the compiler to avoid flagging functions and scripts that set
  arguments, since we have code in jsfun.c to catch such sets at runtime.
- The code generator now eliminates useless expression statements, giving a
  strict warning about them.
- Rationalized jsemit.c's LookupArgOrVar to have well-defined results in *pn.
  Eliminate bytecode specializations for argument and local variable gets and
  sets from jsparse.c -- these precede jsemit.c's LookupArgOrVar and frustrate
  it, by setting pn_slot non-negative too early.
- Code generation errors set report->filename and report->lineno, rather than
  hacking "{0}, line {1}: " into the localized message.
- Bogus JSFRAME_VAROBJBUG removed, JSOPTION_VAROBJFIX is sufficient.
- Spruce up jsinterp.c macros to use JS_BEGIN/END_MACRO brackets if possible.
- Avoid calling JS_PropertyStub.  The call is too costly compared to a branch
  in the caller.


git-svn-id: svn://10.0.0.236/trunk@85537 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-26 00:59:50 +00:00
sspitzer%netscape.com
7305affabb back out brendan (Career Limiting Move) to fix blocker bug #66545.
a=leaf


git-svn-id: svn://10.0.0.236/trunk@85497 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-25 18:06:57 +00:00
brendan%mozilla.org
c1463a8801 Fixes for bug 61898 (which has morphed), r=rogerl, sr=jband.
- Optimize integer ++ and -- to avoid double-to-int, which is quite costly for
  some compilers (ftol on Windows with MSVC).
- Optimized arguments[i] and arguments.length references to use bytecodes that
  avoid creating an arguments object for the current frame.  This entailed
  simplifying the compiler to avoid flagging functions and scripts that set
  arguments, since we have code in jsfun.c to catch such sets at runtime.
- The code generator now eliminates useless expression statements, giving a
  strict warning about them.
- Rationalized jsemit.c's LookupArgOrVar to have well-defined results in *pn.
- Code generation errors set report->filename and report->lineno, rather than
  hacking "{0}, line {1}: " into the localized message.
- Bogus JSFRAME_VAROBJBUG removed, JSOPTION_VAROBJFIX is sufficient.
- Spruce up jsinterp.c macros to use JS_BEGIN/END_MACRO brackets if possible.
- Avoid calling JS_PropertyStub.  The call is too costly compared to a branch
  in the caller.


git-svn-id: svn://10.0.0.236/trunk@85488 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-25 09:22:19 +00:00
brendan%mozilla.org
79e8b4e37f - Treat 08, 09, 078, 079, etc. as decimal, but warn that they're not legal
ECMA-262 octal literals.  Old code would split 08 into 0 and 8 if JS1.2 or
  other non-ECMA version, and always split 078 into 07 and 8, resulting in
  missing ; syntax errors.

- Fix CheckFinalReturn to be aware of JS_HAS_EXCEPTIONS, finally (sic).  Lots
  of help from jag (Peter Annema, disttsc@bart.nl), thank him.

Both changes got lumped under bug 49233, and are r=jband, sr=shaver.


git-svn-id: svn://10.0.0.236/trunk@81459 18797224-902f-48f8-a5cc-f745e15eee43
2000-10-19 19:21:53 +00:00
brendan%mozilla.org
612a3ff881 Fix uninitialized var bug found by one warning, silence another that's a can't-happen (r=jwbaker@acm.org).
git-svn-id: svn://10.0.0.236/trunk@78887 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-12 19:42:01 +00:00
brendan%mozilla.org
c4ea797337 Fix C++ portability and AIX compilation problem due to last C++ porting attempt (48976, r=jdunn@netscape.com).
git-svn-id: svn://10.0.0.236/trunk@78593 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-09 05:53:00 +00:00
brendan%mozilla.org
b0b7fd8115 Followup for 44997, r=shaver:
- #if JS_HAS_LVALUE_RETURN around cx->rval2/rval2set defs and uses.
- Instrument different kinds of invocations, #ifdef DEBUG only.
- Clean up basis case of empty switch statement to use high = -1, low = 0,
  requiring care when optimizing in-range tests using unsigned casts, but
  freeing the interpreter and decompiler from having to do an extra test
  before looping from low to high.
- Clean up all codegen to use JUMP_OFFSET_LEN, ATOM_INDEX_LEN, etc. instead of
  magic 2 or 4.
- Add JSOP_TRY and JSOP_FINALLY no-ops to save a srcnote per JSOP_NOP, and to
  make decompilation and jit'ing easier.
- Minimize number of source notes to maximize SRC_XDELTA span.
- Use JSSCRIPT_FIND_CATCH_START in throw code.
- Indentation and bracing nits picked.


git-svn-id: svn://10.0.0.236/trunk@77900 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-01 18:42:22 +00:00
brendan%mozilla.org
3c54211db3 Support ECMA reference type return from native methods (44997, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@77793 18797224-902f-48f8-a5cc-f745e15eee43
2000-09-01 00:45:50 +00:00
mccabe%netscape.com
aa91430462 Fix to 39141.
Check for empty element case in array literals ( first element in [,'foo'] ) now uses the next token instead of the previous one when constructing the node, so the first element gets TOK_COMMA instead of TOK_LB.

This fixes a crash from previously accepted JS.

r=rogerl


git-svn-id: svn://10.0.0.236/trunk@77230 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-26 01:44:35 +00:00
brendan%mozilla.org
6c9b35da11 Add strict warning about trailing comma in object initializers being non-ECMA (50001, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@76986 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-23 23:55:43 +00:00
brendan%mozilla.org
d2bc829802 Cleanups from tlundeen@webcrossing.com, plus fun->call=>native renaming.
git-svn-id: svn://10.0.0.236/trunk@69736 18797224-902f-48f8-a5cc-f745e15eee43
2000-05-15 03:54:50 +00:00
brendan%mozilla.org
50400ce9b5 Functions that use unqualified __parent__ or __proto__ must be heavyweight (36625, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@66641 18797224-902f-48f8-a5cc-f745e15eee43
2000-04-21 01:47:20 +00:00
brendan%mozilla.org
66bc1e6c09 Clean up ugly whitespace, some of which survived my r=brendan comments.
git-svn-id: svn://10.0.0.236/trunk@65282 18797224-902f-48f8-a5cc-f745e15eee43
2000-04-05 02:17:38 +00:00
rogerl%netscape.com
663a94b57f r=brendan,rginda
Added ECMA3 compliant getter/setter syntax.
Fixed bugs
	- #28686, mishandling of \$ in replace()
	- #27902, eval not detected as heavyweight indicator for non ECMA
			context version.


git-svn-id: svn://10.0.0.236/trunk@62083 18797224-902f-48f8-a5cc-f745e15eee43
2000-03-02 23:21:03 +00:00
brendan%mozilla.org
2e5e3a4050 Fix crash reported in bug 26595 (r=jband@netscape.com) via better compilation-frame conditioning.
git-svn-id: svn://10.0.0.236/trunk@59830 18797224-902f-48f8-a5cc-f745e15eee43
2000-02-05 01:54:13 +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
brendan%mozilla.org
b7a83ca82c JS1.5 fixes (17290, 21618, plus shaver's 22243 fix, r=shaver@mozilla.org).
git-svn-id: svn://10.0.0.236/trunk@58086 18797224-902f-48f8-a5cc-f745e15eee43
2000-01-18 11:06:05 +00:00
rogerl%netscape.com
2db1cd9984 r=brendan
Bug #20444, delete of non-reference


git-svn-id: svn://10.0.0.236/trunk@56426 18797224-902f-48f8-a5cc-f745e15eee43
1999-12-22 22:01:19 +00:00
brendan%mozilla.org
51687cf23b Fix obscure eval bug and ECMA conformance issue (20256, r=rginda@netscape.com).
git-svn-id: svn://10.0.0.236/trunk@54865 18797224-902f-48f8-a5cc-f745e15eee43
1999-12-01 04:30:04 +00:00
brendan%mozilla.org
ca2032e66d Eliminate Closure per ECMA ed. 3, fix brutal sharing of lambdas (20076, r=rogerl,shaver).
git-svn-id: svn://10.0.0.236/trunk@54474 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-25 03:25:30 +00:00
shaver%netscape.com
3676f93091 - report function name, if any, when warning about mismatched return
- change catchguard syntax to avoid ECMA conflict
- light XDR cleanup


git-svn-id: svn://10.0.0.236/trunk@54364 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-24 03:36:25 +00:00
brendan%mozilla.org
1c2d96a428 - Add JS_HAS_FUN_EXPR_STMT jsconfig.h macro and use it to ifdef a special case explicitly specified by ECMA ed. 3 to be an error: a function expression that's a statement (not at top-level). This allows one to wrap functions in if and else statements and conditionally define them.
(More work is needed to conform to ECMA ed. 3 by removing Closure objects; also we want more efficient closure calling, soon.)

- Move mislocated call to js_FoldConstants from jsemit.c's js_EmitTree, the TOK_FUNCTION case, back to jsparse.c.  This avoids redundant fold-walks over non-top-level functions.  Folding should be done at tree-gen time, not at code-gen time.

- Eliminate dead code in if-else and ?: when folding constants.

- Release tempPool arena space before early return on error in js_FoldConstants, just to be nice (all arena space gets released eventually, when the compiler finishes).


git-svn-id: svn://10.0.0.236/trunk@53898 18797224-902f-48f8-a5cc-f745e15eee43
1999-11-18 20:19:56 +00:00