58 Commits

Author SHA1 Message Date
brendan%mozilla.org
83e65a3dd5 Avoid O(n^2) hazard under JS_ARENA_RELEASE, simplifying arena-pool usage and eliminating debug code (416628, r=igor).
git-svn-id: svn://10.0.0.236/trunk@245389 18797224-902f-48f8-a5cc-f745e15eee43
2008-02-11 08:55:03 +00:00
brendan%mozilla.org
7980b3bafb Final js1.8 feature: sugar for object destructuring (404734, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@244500 18797224-902f-48f8-a5cc-f745e15eee43
2008-01-30 06:27:13 +00:00
igor%mir2.org
3357de22b8 Bug 410649: function statement and destructuring parameter name clash now favours the function. r,a=brendan
git-svn-id: svn://10.0.0.236/trunk@243600 18797224-902f-48f8-a5cc-f745e15eee43
2008-01-20 10:34:06 +00:00
brendan%mozilla.org
efa68f7304 Fixes and improvements for property instrumentation (411630, r=igor).
* Menu of -D flags for enabling instrumentation, as a commented-out CFLAGS +=
  setting for convenient testing.
* js_FindProperty and js_LookupPropertyWithFlags return indexes into the scope
  and prototype chains, respectively, to support internal instrumentation, and
  to pave the way for the return of the property cache (bug 365851)..
* jsutil.[ch] JSBasicStats struct and functions for computing mean/sigma/max
  and auto-scaling histogram.
* JS_SCOPE_DEPTH_METER instrumentation for compile- and run-time scope chain
  length instrumentation:
+ At compile time, rt->hostenvScopeDepthStats and rt->lexicalScopeDepthStats
  meter scope chains passed into the compile and evaluate APIs.
+ At runtime, rt->protoLookupDepthStats and rt->scopeSearchDepthStats track
  steps along the prototype and scope chains until the sought-after property
  is found.
* JS_ARENAMETER uses JSBasicStats now.
* Added rt->liveScopePropsPreSweep to fix the property tree stats code that
  rotted when property tree sweeping moved to after the finalization phase.
* Un-bitrotted some DEBUG_brendan code, turned some off for myself via XXX.
* Mac OS X toolchain requires initialized data shared across dynamic library
  member files, outlaws common data, so initialize extern metering vars.
* Old HASHMETER code in jshash.[ch] is now JS_HASHMETER-controlled and based
  on JSBasicStats.
* DEBUG_scopemeters macro renamed JS_DUMP_SCOPE_METERS; uses JSBasicStats now.
* Disentangle DEBUG and DUMP_SCOPE_STATS (now JS_DUMP_PROPTREE_STATS) and fix
  inconsistent thread safety for liveScopeProps (sometimes atomic-incremented,
  sometimes runtime-locked).
* Compiler-modeled maxScopeDepth will propagate via JSScript to runtime for
  capability-based, interpreter-inlined cache hit qualifier bits, to bypass
  scope and prototype chain lookup by optimizing for common monomorphic get,
  set, and call site referencing a prototype property in a well-named object
  (no shadowing or mutation in 99.9% of the cases).


git-svn-id: svn://10.0.0.236/trunk@242973 18797224-902f-48f8-a5cc-f745e15eee43
2008-01-13 00:31:32 +00:00
igor%mir2.org
f54fd20d96 Bug 404935: No compiler pseudo-frames when compiling functions. r,a=brendan
git-svn-id: svn://10.0.0.236/trunk@240106 18797224-902f-48f8-a5cc-f745e15eee43
2007-11-29 14:49:43 +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
4bb91702f9 bug 397289: removing JSParseNode.pn_ts. r,a=brendan
git-svn-id: svn://10.0.0.236/trunk@239363 18797224-902f-48f8-a5cc-f745e15eee43
2007-11-13 22:18:17 +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
1d235bcf1e Bug 397210: JSTokenStream is stored in JSParseContext. r=brendan
git-svn-id: svn://10.0.0.236/trunk@237113 18797224-902f-48f8-a5cc-f745e15eee43
2007-10-02 23:10:09 +00:00
igor%mir2.org
27b680de93 Backing out the patch 397210.
git-svn-id: svn://10.0.0.236/trunk@237017 18797224-902f-48f8-a5cc-f745e15eee43
2007-10-01 20:46:10 +00:00
igor%mir2.org
bab33931e0 Bug 397210: JSTokenStream is stored in JSParseContext. r=brendan
git-svn-id: svn://10.0.0.236/trunk@237014 18797224-902f-48f8-a5cc-f745e15eee43
2007-10-01 20:25:26 +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
crowder%fiverocks.com
2e9c5abf21 Bug 357016: spidermonkey should be buildable by a C++ compiler, patch by
crowder/Jason Orendorff, r=brendan


git-svn-id: svn://10.0.0.236/trunk@229375 18797224-902f-48f8-a5cc-f745e15eee43
2007-07-05 20:37:48 +00:00
igor%mir2.org
2283248466 Bug 349326: for-in loop now always closes iterator objects. r=brendan
git-svn-id: svn://10.0.0.236/trunk@229141 18797224-902f-48f8-a5cc-f745e15eee43
2007-07-02 12:13:27 +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
brendan%mozilla.org
7991ccd56e Rename strict equality ops (cleanup pre-patch for 363536, r=igor).
git-svn-id: svn://10.0.0.236/trunk@217234 18797224-902f-48f8-a5cc-f745e15eee43
2006-12-20 08:12:18 +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
ec8c177ea4 Fix decompilation to preserve braces required by let, and also fix switch body block to have scope for let at top level of case statement (349634, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@209421 18797224-902f-48f8-a5cc-f745e15eee43
2006-09-08 05:03:54 +00:00
brendan%mozilla.org
cfcef5ecbd Fix array comprehension code gen bug that broke constant folding (349653, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@208974 18797224-902f-48f8-a5cc-f745e15eee43
2006-09-01 06:16:14 +00:00
brendan%mozilla.org
63802ab69d Destructuring catch variables, plus TOK_LEXICALSCOPE cleanup (336379, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@207711 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-17 08:13:18 +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
0e7750c08e Revise try/catch/finally AST to pave way for block scope and destructuring (336379, r=mrbkap).
git-svn-id: svn://10.0.0.236/trunk@207193 18797224-902f-48f8-a5cc-f745e15eee43
2006-08-11 23:26:18 +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
brendan%mozilla.org
036b7c131b E4X, configured off, code-complete.
git-svn-id: svn://10.0.0.236/trunk@165420 18797224-902f-48f8-a5cc-f745e15eee43
2004-11-17 07:43:01 +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
340570a787 - Decorate PN_LIST nodes with pn_extra flags whose constant names describe
their meaning better, adding a flag for 'for (var x ... in o)'.
- Set these flags from the parser, in a future-proof way (|=, not =, given the
  zero initialized pn_extra flags member of pn_list).
- Test list flags in the code generator, including PNX_FORINVAR in conjunction
  with whether the for..in loop is of the oddball form 'for (var x = i in o)'.
- Thereby fix failure to emit a JSOP_DEFVAR in the case that a function wraps
  a for..in loop in a with statement (252892, r=shaver).
- The same fix cured another bug, not reported, where 'for (var x = i in o)'
  in a function without any 'with' statement would emit the wrong opcode
  (JSOP_FORNAME, not JSOP_FORVAR).


git-svn-id: svn://10.0.0.236/trunk@160101 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-30 00:00:09 +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
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
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
7cc2d1c1ff Fix broken left-associativity and constant folding for + chains involving some string terms (196290, r=shaver by telepathy).
git-svn-id: svn://10.0.0.236/trunk@139787 18797224-902f-48f8-a5cc-f745e15eee43
2003-03-19 19:33:33 +00:00
brendan%mozilla.org
452ecec045 - Move left-associative binary tree flattening from the post-order position
in js_FoldConstants where it was added (suboptimally: it worked, but it ran
  so late that js_FoldConstants recursion was not reduced, only js_EmitTree
  recursion), to NewBinary, where it avoids JSParseNode allocations up front
  and reduces recursion in all parse-tree walking.
- This change enables js_FoldConstants to see a very long concatenation of
  string literals as a PN_LIST node, so it can quickly concatenate without
  running afoul of O(n^2) problems inherent in js_ConcatStrings applied to
  two atomized strings (the old way of folding string concatenations, still
  used for any pairwise string literal concatenation).
- Further optimize the first change for the second by having NewBinary set a
  new pn_strcat flag (overlaying the pn_extra field) of the PN_LIST arm of
  the JSParseNode.pn_u union, whenever it sees at least one string literal in
  a concatenation that might be folded (whose operands might all be constants
  of string or number type).
- Notes:
  - only string and number constants are folded (not boolean or null
  constants);
  - only all-constant left-associated binary expression chains are folded,
    so 2 * foo * 3 is not folded using commutativity of * over numbers, nor
    is "hi" + " there" + foo folded to "hi there" + foo.
  - gcc3.2 -O and objdump -x say I added 708 bytes of instructions with this
    change.  I tried to keep it down to what was necessary for common script;
    I don't think JS needs an optimizing-compiler-strength constant folder,
    and I don't think this 1K bloat is too high a price to pay for this fix.
    But I'll certainly work on reducing footprint elsewhere, if I can.
- Bug 174341, r=shaver.


git-svn-id: svn://10.0.0.236/trunk@138638 18797224-902f-48f8-a5cc-f745e15eee43
2003-02-27 23:04:46 +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
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
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
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
df4a97d00e Comment change only: document TOK_TRY and TOK_CATCH nodes.
git-svn-id: svn://10.0.0.236/trunk@81588 18797224-902f-48f8-a5cc-f745e15eee43
2000-10-22 22:47:40 +00:00
brendan%mozilla.org
a1e0219a1d Spruce up a couple of comments.
git-svn-id: svn://10.0.0.236/trunk@66642 18797224-902f-48f8-a5cc-f745e15eee43
2000-04-21 01:49:49 +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