7 Commits

Author SHA1 Message Date
brendan%netscape.com
0c04e27eb1 JSMSG_NO_FORMAL duplicated DUPLICATE_FORMAL, now is reborn as BAD_FORMAL.
git-svn-id: svn://10.0.0.236/trunk@9607 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-09 09:04:35 +00:00
brendan%netscape.com
12a9d81b7f js.c jsemit.c jsemit.h jsgc.c jsinterp.c jsopcode.c jsopcode.def
- Switch improvements:
  - JSOP_CONDSWITCH is a 1 byte nop, not variable length with the same kind
    of immediate operand as JSOP_LOOKUPSWITCH (which is useless except for
    decompilation).  New scheme uses SRC_COMMA notes on each JSOP_CASE opcode,
    usually 2 bytes per note, and a typically-1-byte 2nd offset on SRC_SWITCH:
      1 + 2 * ncases
    vs. the previous JSOP_LOOKUPSWITCH immediate, which consumed:
      4 * ncases
    bytes after the switch opcode just for decompilation.
  - SRC_SWITCH has two offsets, first to end of switch as before, the second
    to first case if JSOP_CONDSWITCH, for decompilation.
  - Optimize switches with all-constant cases using JSOP_TABLESWITH, or if
    that can't be used, JSOP_LOOKUPSWITCH, before falling back on ECMAv2's
    JSOP_CONDSWITCH.
  - Use cx->gcDisabled when evaluating case exprs at compile time for old,
    pre-ECMAv2 switches, to prevent branch-callback-based GC invocations
    from ripping apart the unrooted temporary script for each case expr.
  - Fixed up stale SRC_SWITCH comments in jsemit.h.

jsemit.c jsemit.h
  - TREE_CONTEXT_INIT to match ATOM_LIST_INIT, not English word order.
  - Reorganized JSCodeGenerator to sort of match argument order to
    js_InitCodeGenerator.
  - Got rid of confusing CG_RESET* macros and used memset(cg, 0, sizeof *cg)
    and non-zero-default init in js_InitCodeGenerator.  js_ResetCodeGenerator
    just releases the code and temp arena pools and leaves the cg in a state
    where it must be re-initialized (as before, but more obvious).
  - In the same spirit, don't do partial "resets" or src and trynotes in their
    js_FinishTaking*Notes functions -- those are friends of jsscript.c and are
    not general, idempotent functions.

jsapi.c jsapi.h jsarray.c jsatom.c jsatom.h jscntxt.c jsemit.c jsmsg.def
jsnum.c jsobj.c jsopcode.c jsregexp.c jsscan.c jsstr.c jsxdrapi.
  - Use PR_snprintf rather than sprintf always, so we don't have to worry
    about systems with 64-bit longs that overflow 12-byte buffers and open
    Morris-Worm-type security holes.
  - Trim extra spaces, fix hanging indentation, and similar anal retention.
  - Renamed JSMSG_BAD_PROTO_SORT to JSMSG_BAD_SORT_ARG cuz that's what it
    is complaining about.
  - SRC_CATCHGUARD still lived in comments, but it's SRC_CATCH in code.

jscntxt.c jscntxt.h jsinterp.c
  - Packed nearby JSPackedBools and added a new one: gcDisabled, for use by
    jsemit.c's pre-ECMAv2 switch case expr eval.
  - Rip out old js_InterpreterHooks stuff from original liveconnect (moja).
  - Remove javaData and savedErrors from JSContext.  Leaving it to fur or
    shaver to remove javaData from jsscript.h.


git-svn-id: svn://10.0.0.236/trunk@9475 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-08 05:39:51 +00:00
rogerl%netscape.com
112983b87d New errorNumber handling
git-svn-id: svn://10.0.0.236/trunk@9230 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-03 20:29:37 +00:00
mccabe%netscape.com
cead6ec411 restore npl.
git-svn-id: svn://10.0.0.236/trunk@8932 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-01 01:16:45 +00:00
mccabe%netscape.com
f3c665324e More runtime errors now bound to exceptions.
Most of these will require a second look, but I wanted to get all of
them (that need exceptions) throwing something interesting.


git-svn-id: svn://10.0.0.236/trunk@8931 18797224-902f-48f8-a5cc-f745e15eee43
1998-09-01 01:15:16 +00:00
mccabe%netscape.com
a7b8207a95 Further runtime error work... expose many new errors as catchable
exceptions.  Mostly syntax errors, so far.  Fixed missing #if
JS_HAS_ERROR_EXCEPTIONS


git-svn-id: svn://10.0.0.236/trunk@8856 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-31 09:49:43 +00:00
mccabe%netscape.com
ac4f37b0a5 Propagate lots 'o work from the development branch.
Including:

Preliminary work on internationalizing error messages

Preliminary work on exposing runtime errors as catchable exceptions

ECMA-proposed throw and try/catch/finally, with multiple catch clauses
and catchguards

ECMA-proposed in/instanceof operators

IEEE-conformant number to string conversion

Fixes and other good stuff.


git-svn-id: svn://10.0.0.236/trunk@8770 18797224-902f-48f8-a5cc-f745e15eee43
1998-08-29 00:38:43 +00:00