69 Commits

Author SHA1 Message Date
brendan%mozilla.org
6ecd20e4a8 Fix js_LineNumberToPC to cope with code reordering, especially in JSOP_CONDSWITCH (1113352, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@168505 18797224-902f-48f8-a5cc-f745e15eee43
2005-01-29 18:31:46 +00:00
brendan%mozilla.org
d5fcaaf973 Silence a DEBUG_brendan blurb.
git-svn-id: svn://10.0.0.236/trunk@166736 18797224-902f-48f8-a5cc-f745e15eee43
2004-12-15 02:59:00 +00:00
brendan%mozilla.org
2e6bee01c4 Don't forget to call the new-script and destroy-script hooks in js_FilterXMLList, so the debugger knows about the script cloned there.
git-svn-id: svn://10.0.0.236/trunk@165772 18797224-902f-48f8-a5cc-f745e15eee43
2004-11-25 06:57:17 +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
c73434d76b Add scoped local root support, plus a few cleanups from the huge e4x patch (40757, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@161009 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-19 17:57:36 +00:00
brendan%mozilla.org
01497fded6 Remove bogus instanceof equivalence of distinct constructor function objects
that have the same native or script internally.  We no longer need this hack,
given regexp cloning done for precompiled scripts and functions (i.e., those
not eval'd or compile-and-go executed via a JS_Evaluate* API).

Fix a script_compile bug found during the scan of JSFRAME_EVAL occasioned by
the instanceof fix.

Bug 254067, r=shaver@mozilla.org.


git-svn-id: svn://10.0.0.236/trunk@160359 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-04 17:56:31 +00:00
brendan%mozilla.org
f7b9ce6db4 Avoid harmless UMC from purify when XDR-decoding (252047, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@159893 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-27 01:28:39 +00:00
brendan%mozilla.org
7cf55aa042 Mangle JS_STATIC_DLL_CALLBACK names a bit in case they're not hidden.
git-svn-id: svn://10.0.0.236/trunk@158200 18797224-902f-48f8-a5cc-f745e15eee43
2004-06-20 02:29:19 +00:00
brendan%mozilla.org
25a4d6d341 - Improve global variable performance from 3x slower to 1.2x slower than
locals (169559, r=shaver).
- Also fix longstanding bug where global regexps in precompiled scripts were
  wrongly shared among threads/contexts (165201, r=shaver).
- Also fix strict-aliasing gcc warning causes (206599, r=bryner).


git-svn-id: svn://10.0.0.236/trunk@154749 18797224-902f-48f8-a5cc-f745e15eee43
2004-04-13 01:25:17 +00:00
brendan%mozilla.org
dbe6162d4d Move script_filename_table into JSRuntime where it belongs (235145, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@153079 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-22 03:21:15 +00:00
dbaron%dbaron.org
58150a14fa Backing out brendan's checkin due to tinderbox orange.
git-svn-id: svn://10.0.0.236/trunk@153077 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-22 01:11:47 +00:00
brendan%mozilla.org
2247a47000 Move script_filename_table into JSRuntime where it belongs (235145, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@153072 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-21 19:41:52 +00:00
brendan%mozilla.org
42c8b66573 NARCISSUS ifdefs and related general fixes (r=shaver).
git-svn-id: svn://10.0.0.236/trunk@152659 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-11 07:21:59 +00:00
brendan%mozilla.org
b2008e8627 Don't JS_ReportOutOfMemory while holding script_filename_table_lock (r=self).
git-svn-id: svn://10.0.0.236/trunk@150775 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-30 07:54:09 +00:00
brendan%mozilla.org
9d6a799abb Followup patch to cope with lightweight function calls (direct or via natives) to exec (227432, r=shaver, a=dbaron).
git-svn-id: svn://10.0.0.236/trunk@150182 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-10 00:24:13 +00:00
brendan%mozilla.org
c03099810d Fix Script.prototype.exec called from native code (227432, r=shaver, a=asa).
git-svn-id: svn://10.0.0.236/trunk@150073 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-05 04:21:05 +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
1208f020d1 Use eval's object principals if possible, ditto for other eval-like methods (223041, r=caillon, sr=shaver).
git-svn-id: svn://10.0.0.236/trunk@148699 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-02 01:04:50 +00:00
brendan%mozilla.org
1280510f81 Don't under-malloc for short script filename entry (223810, r=shaver, a=dbaron).
git-svn-id: svn://10.0.0.236/trunk@148444 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-27 19:13:01 +00:00
brendan%mozilla.org
09482f96d1 Split jsconfig.h JS_HAS_XDR macro for better code factoring.
git-svn-id: svn://10.0.0.236/trunk@147873 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-11 18:17:53 +00:00
brendan%mozilla.org
42a28f9704 Remove false comment (whew).
git-svn-id: svn://10.0.0.236/trunk@147823 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-10 01:46:55 +00:00
brendan%mozilla.org
92cda301e0 Late-breaking security fix (221526, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@147718 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-07 23:02:29 +00:00
brendan%mozilla.org
fe4e2f8b11 Eliminate unnecessary local variable.
git-svn-id: svn://10.0.0.236/trunk@147133 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-23 00:07:24 +00:00
brendan%mozilla.org
e27c6498b5 Restore next-to-last rev, which is harmless.
git-svn-id: svn://10.0.0.236/trunk@145944 18797224-902f-48f8-a5cc-f745e15eee43
2003-08-13 05:25:04 +00:00
darin%meer.net
6c2d85c7d5 backing out changes for bug 215878 to clear tinderbox orange (startup crash)
git-svn-id: svn://10.0.0.236/trunk@145943 18797224-902f-48f8-a5cc-f745e15eee43
2003-08-13 05:17:14 +00:00
brendan%mozilla.org
89fa1a1033 Fix js_FinishTakingSrcNotes 'logic gap' bug (215878, r=shaver, a=dveditz).
git-svn-id: svn://10.0.0.236/trunk@145932 18797224-902f-48f8-a5cc-f745e15eee43
2003-08-12 23:42:55 +00:00
brendan%mozilla.org
082f42b64a I can't believe that after all the work for bug 208030, I forgot to re-base js_GetSrcNote's notion of note origin to the script's prolog, from its main entry point (214761).
git-svn-id: svn://10.0.0.236/trunk@145647 18797224-902f-48f8-a5cc-f745e15eee43
2003-08-06 06:56:01 +00:00
brendan%mozilla.org
7c3cf78ac7 Fix off-by-N in CG_COUNT_FINAL_SRCNOTES (214210).
git-svn-id: svn://10.0.0.236/trunk@145326 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-29 09:11:04 +00:00
brendan%mozilla.org
89c23462fb Undo critical part of last change to try to fix crashing testerboxes.
git-svn-id: svn://10.0.0.236/trunk@145273 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-28 18:30:12 +00:00
brendan%mozilla.org
2a40dbb3c5 Minor cleanups to last checkin.
git-svn-id: svn://10.0.0.236/trunk@145263 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-28 05:46:18 +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
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
rginda%netscape.com
db9ee285d0 bug 110903, patch=brendan, sr=shaver, r=me
Call new script hook for scripts created via xdr.


git-svn-id: svn://10.0.0.236/trunk@108541 18797224-902f-48f8-a5cc-f745e15eee43
2001-11-20 02:47:41 +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
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
f031c3036a Shrink principals struct back to where it was last week -- but it could go further (93043, r=shaver, sr=jst).
git-svn-id: svn://10.0.0.236/trunk@100615 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-09 01:15:57 +00:00
brendan%mozilla.org
f5bc62edea FASTLOAD_20010703_BRANCH landing, r=dbaron, sr=shaver.
git-svn-id: svn://10.0.0.236/trunk@100030 18797224-902f-48f8-a5cc-f745e15eee43
2001-07-31 19:05:34 +00:00
rginda%netscape.com
6cb853ad8b create a dummy stack frame before calling out to the new-script-hook. The dummy frame prevents the script from being affected by any GC the hook may trigger. See bug 77636. author=shaver, r=me, sr=brendan
git-svn-id: svn://10.0.0.236/trunk@95736 18797224-902f-48f8-a5cc-f745e15eee43
2001-05-22 23:57:37 +00:00
brendan%mozilla.org
f6b51cdcaf - [jsemit.c] Fix horrid stupid bugs generating JSOP_ARGCNT and JSOP_ARGSUB,
where any occurrence of arguments.length or arguments[0], e.g., would be
  "optimized" to use those bytecodes.  This is just wrong if the occurrence
  is an operand of delete, ++, --, or the left-hand-side of an assignment
  operator!

- [jsfun.c, jsinterp.c]  args_getProperty etc. must use JS_GetInstancePrivate,
  not JS_GetPrivate, as the arguments object is exposed, and can be made a
  prototype of other objects that do not have private data, or private data
  that's a JSStackFrame*.  Same goes for fun_getProperty, js_GetArgument, etc.

- [jsfun.c, jsobj.c, jsstr.c]  No need to specialize fun_delProperty and
  str_delProperty to help convince users and ECMA conformance tests that
  fun.length and str.length are direct properties of instances, instead of
  being delegated to Function.prototype.length and String.prototype.length.
  This special case is done universally in js_DeleteProperty for all SHARED
  and PERMANENT proto-properties.

- [jshash.c]  Sneaking this followup-fix for bug 69271 in: use JS_HASH_BITS
  rather than hardcoded 32.

- [jsobj.c, jsscope.[ch]]  Fix misnamed js_HashValue (it takes a jsid, so it
  is now js_HashId).

- [jsscript.c] script_compile needs to call JS_InstanceOf, to ensure that obj
  is a Script object.


git-svn-id: svn://10.0.0.236/trunk@90066 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-22 02:52:42 +00:00
brendan%mozilla.org
22cc58b856 bugs 31003 and (mostly) 68045, r=rogerl, sr=shaver&hyatt
- Fix bug where script jssrcnote vector terminator was not XDRed.
- Ensure that memory is cleared by serializing zero padding bytes as needed
  under JS_XDRBytes and JS_XDRString.
- Fix JS_XDRValue to handle undefined and null JS types properly (bug 31003).
  Also make it cast from jsint to uint32 and back carefully, so as to work
  with negative numbers even on targets where jsval is a signed 64 bit type.
- Add JS_XDRScript public API.
- Optimize the per-JSXDRState class registry so it uses a JSDHashTable upon
  searching for a class-id by name in an overpopulated (for linear search)
  registry table.
- Clean up API nits such as JS_XDRNewBase => JS_XDRInitBase, with parameter
  list rotation to put cx last (JS_XDRInitBase is an infallible init helper,
  not an error-reporting, cx-comes-first, API entry point).
- Fix some XXX comments, unneeded masks, other nits.
- Make sure all JS XDR API functions start with JS_XDR.


git-svn-id: svn://10.0.0.236/trunk@88604 18797224-902f-48f8-a5cc-f745e15eee43
2001-03-06 01:56:30 +00:00
brendan%mozilla.org
e92f541879 2nd attempt: Fix API botch where 'var x=0' vs. 'x=0' could put x in a different object (65553, r=mccabe, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@85199 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-20 01:41:55 +00:00
kin%netscape.com
b027ec74ff Temporary fix for Bug #65828: mozilla installer.exe fails with "-229 script error"
Backing out Brendan's previous checkin for bug #65553 (jsapi.c, jsdbgapi.c, jsemit.c, jsinterp.c, jsinterp.h, jsobj.c, and jsscript.c), so we can get smoke tests going.

r=attinasi@netscape.com (sheriff)


git-svn-id: svn://10.0.0.236/trunk@85091 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-18 22:10:12 +00:00
brendan%mozilla.org
a8e8c0ed81 Fix API botch where 'var x=0' vs. 'x=0' could put x in a different object (65553, r=mccabe, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@85067 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-18 03:00:31 +00:00
brendan%mozilla.org
50b1d4d1f6 Fix leak on IS_BIG_ENDIAN malloc failure early return (r=mccabe,sr=jband).
git-svn-id: svn://10.0.0.236/trunk@83307 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 06:53:33 +00:00
jband%netscape.com
a9d947a466 fix bug 59588. Since js_MarkAtom is called *so* often but is usually short-circuited, we add a macro to get the shortcircuit flag in the 3 callers and avoid most of the calls. r=mccabe sr=brendan
git-svn-id: svn://10.0.0.236/trunk@83304 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-06 06:03:30 +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
e85122f78b Clean up JSObjectOps layering violations by adding mark and clear ops; JSClass gets a corresponding mark op so classes with unregistered roots in private data can mark them. The JS API gets a new JS_MarkGCThing entry point for JSObjectOps.mark implementors. Prerequisite check-in for bug 49816 and others (r=shaver).
git-svn-id: svn://10.0.0.236/trunk@77238 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-26 02:30:22 +00:00
brendan%mozilla.org
ee6d41f982 Re-constipate JSClass.name.
git-svn-id: svn://10.0.0.236/trunk@76709 18797224-902f-48f8-a5cc-f745e15eee43
2000-08-19 19:17:32 +00:00