Commit Graph

194 Commits

Author SHA1 Message Date
Brendan Eich
c9fed979f6 Bug 542002 - Optimize to flat closures even if some upvars can't be copied (r=jorendorff). 2010-02-10 15:17:52 -08:00
Igor Bukanov
836b8a84eb bug 540805 - using reference counting only for empty scopes. r=jorendorff 2010-01-27 09:50:17 +03:00
Brendan Eich
1699be3a87 Bug 541455 - Do not drop "mumble"; would-be directives in the parser, let them be completion values (or useless expressions for the emitter to cull) (r=jimb). 2010-01-22 12:17:13 -08:00
Brendan Eich
7d53217541 Fast followup fix for thinko (536564, r=jorendorff). 2010-01-14 14:22:00 -08:00
Brendan Eich
983aa690e9 Analyze module pattern and private-statics pattern in order to despecialize from methods to slots/sprops (536564, r=jorendorff). 2010-01-14 09:33:14 -08:00
Blake Kaplan
2453f5bb11 Bug 537673 - Don't constant-fold a parenthesized callee expression. r=jorendoff 2010-01-07 15:58:44 -08:00
Brendan Eich
85a5badeef ES5-conformance fix to make a new RegExp for each regexp literal evaluation (98409, r=igor/jwalden). 2010-01-06 15:12:54 -08:00
Jason Orendorff
e5ac8476fd Backed out changeset 3862a7e48e79 due to tinderbox failures on js1_5/GC/regress-324278.js. 2010-01-05 12:48:09 -06:00
Brendan Eich
1b4fbd91e6 ES5-conformance fix to make a new RegExp for each regexp literal evaluation (98409, r=jwalden). 2010-01-04 12:25:44 -08:00
Brendan Eich
f19c7e9d1b Fix js_FindDuplicateFormal to crack the fun->u.i.names union correctly, and spruce it up with C++ (532041, r=jimb). 2009-12-01 14:48:05 -08:00
Robert Sayre
8dac81dafc Merge 2009-12-01 15:51:22 -05:00
Robert Sayre
4ea539c658 Relanding: Bye-bye middle-deletes and their O(n^2) worst case complexity; hello dictionary-mode scopes (473228, r=jorendorff). Backed out changeset ee7bfc1923ad 2009-12-01 15:49:15 -05:00
Robert Sayre
8be5b171b9 Backed out changeset c03ebf340688. Bye-bye middle-deletes and their O(n^2) worst case complexity; hello dictionary-mode scopes (473228, r=jorendorff). 2009-12-01 09:56:16 -05:00
Robert Sayre
5d34830070 Backout bug 473228 and its follow-up, temporarily, to attempt a clean merge of other stuff. 2009-12-01 09:57:20 -05:00
Jim Blandy
35e434274a Bug 499524: Always check for duplicates when destructuring params are present. r=igor
Detect duplicate names in parameter lists that include destructuring
parameters, regardless of whether the duplication becomes before or
after the destructuring. Let strict mode complaints take care of
themselves after the body has been parsed.

In BindDestructuringArg, there should never be an entry in tc->decls
for the given name if the call to js_LookupLocal didn't detect a
duplicate argument, so we can simply assert that tc->decl.lookup
returns NULL, instead of checking it.

In HashLocalName, we can tighten the assertion: both the new and
existing entries must be JSLOCAL_ARG, since we detect all non-ARG
(i.e., destructuring) duplicates early.
2009-11-26 10:23:52 -08:00
Brendan Eich
c731045c51 Bye-bye middle-deletes and their O(n^2) worst case complexity; hello dictionary-mode scopes (473228, r=jorendorff). 2009-11-20 16:14:42 -08:00
Jason Orendorff
d3dfa97516 Bug 509354 - Crash [@ DecompileDestructuringLHS] with destructuring and "arguments". r=mrbkap. 2009-11-20 11:33:30 -06:00
Jim Blandy
e412a5c444 Bug 514575: Forbid rebinding 'eval' or 'arguments' in ES5 strict mode code. r=mrbkap 2009-11-19 14:08:02 -08:00
Jim Blandy
740a8791c2 Bug 514562: Forbid assignments to 'eval' and 'arguments' in strict mode code. r=mrbkap
Drafts of the ES5 spec required a type error to be raised when an
assignment to "arguments" is evaluated in function code. In
ECMA/TC39/2009/050, this condition has been changed to a syntax error
in all code. By the rules of chapter 16, implementations must report
it early.
2009-11-19 14:08:02 -08:00
Jim Blandy
18f28c0cac Bug 514580: Forbid duplicate formal parameter names in strict mode code. r=mrbkap
Note: this patch changes the JSOPTION_STRICT warning from a TypeError
into a SyntaxError, if JSOPTION_WERROR is also set.
2009-11-19 14:08:02 -08:00
Jim Blandy
14f017ccd9 Bug 514572: Forbid deletion of variables, arguments and functions in ES5 strict mode. r=jorendorff 2009-11-19 12:35:55 -08:00
Jim Blandy
4ebb8ece60 Bug 514567: Detect duplicate property names. r=jorendorff 2009-11-19 12:35:55 -08:00
Jim Blandy
dccc422655 Bug 514576: Forbid 'with' statements in strict mode code. r=mrbkap 2009-11-19 09:49:00 -08:00
Jim Blandy
a1ea615b02 Bug 521868: Make code passed to a direct call to eval inherit the caller's strictness. r=jorendorff 2009-11-19 09:48:59 -08:00
Jim Blandy
34a27f0c88 Bug 514585: Recognize "use strict" directives. r=igor 2009-11-18 13:33:53 -08:00
Jim Blandy
ae0ff5874f Bug 514585: Remove macro wrappers for js_NewPrinter and JS_InitArenaPool. r=igor
These macros were intended to help avoid passing unused parameters
when JS_ARENAMETER is not defined, but they're not worth the trouble.
The unused parameter doesn't elicit warnings, and the performance
impact of passing the unneeded argument is negligible.

This also removes support for JS_ARENA_CONST_ALIGN_MASK, which is not
used.
2009-11-18 13:33:53 -08:00
Blake Kaplan
f0cd93b989 Bug 461170 - Detect when typeof is applied to an expression before constant folding so we correctly throw unbound name exceptions from the folded expression. r=brendan 2009-11-06 18:27:17 +01:00
Igor Bukanov
0d38a472cc bug 524346 - using jsval, not jsdouble *, for nan and +-oo. r=brendan 2009-10-28 14:57:31 +03:00
Igor Bukanov
8785797ba7 Backed out changeset 14c76164f4c2 - patch for bug 524346 caused test fails 2009-10-27 19:21:47 +03:00
Igor Bukanov
ed4f6edf7f bug 524346 - using jsval, not jsdouble *, for nan and +-oo. r=brendan 2009-10-27 13:26:57 +03:00
Jason Orendorff
e66886b51c Bug 515885 - Assertion failure: !scope->owned(), at ../jsobj.cpp. r=brendan. 2009-10-23 14:35:53 -05:00
Brendan Eich
9f9a05b0c3 Don't build a stack frame to execute empty scripts (516827, r=igor). 2009-10-18 17:41:24 -07:00
Jim Blandy
d87d9403e2 Bug 517990: Remove unused 'TS' parameter from NewNameNode and NewBindingNode. r=mrbkap 2009-10-08 10:29:03 -07:00
Jim Blandy
416f219573 Bug 515233: Move the TSF_DESTRUCTURING flag to the tree context. r=igor
The flag TSF_DESTRUCTURING is used by the parser to modify the way
variables in the destructuring pattern get represented in the parse
tree.  It is never set or used by the tokenizer.  This patch moves it
to JSTreeContext::flags, where it belongs, now that that field is wide
enough to hold it.

It also renames the flag TCF_DECL_DESTRUCTURING, since the flag is
only used for destructuring patterns that occur in declarations; it is
not set when processing assignment-like destructuring patterns.
2009-10-08 10:29:03 -07:00
Jim Blandy
f06be32d20 Bug 515233: Widen JSTreeContext::flags to 32 bits. r=igor
All the bits in this uint16 field are currently in use.  Adding bits
for projects like strict mode entails relocating existing flags, which
is additional work.  Furthermore, it seems that this has already
inspired people to put flags in places they don't belong:
TSF_DESTRUCTURING is a JSTokenStream flag, but is only used by the
parser.

This patch widens the field to 32 bits, and adjusts JSFunctionBox and
a few other places to match.

We should really replace these all with bitfields.
2009-10-08 10:29:03 -07:00
Jim Blandy
f4a407f114 Bug 515233: Make the static level its own parameter to JSCompiler::compileScript. r=igor
Pre-patch, the initial static level at which a script should be
compiled to run is passed in the upper sixteen bits of the tcflags
parameter to JSCompiler::compileScript; because JSTreeContext::tcflags
is a uint16, while the tcflags parameter is a uint32, we know the
parameter's upper bits are free.

However, we would like to enlarge JSTreeContext::tcflags to 32 bits,
as we already have a handful of new flags that belong there.  This
patch moves the static level to its own parameter, which has a default
argument.
2009-10-08 10:29:03 -07:00
Jim Blandy
0d6cdd1921 Bug 514585: Use bitfields in JSScript instead of a flag word. r=brendan
This is behavior-neutral cleanup in preparation for the real patch.
2009-10-08 10:29:03 -07:00
Jim Blandy
b101872320 Bug 514567: Fix error processing in PrimaryExpr. r=brendan
This code seems to assume that one can proceed if pn3 is NULL, but we
never check it again further down.  Instead, we create TOK_COLON nodes
whose left (and perhaps right) children are NULL.  It seems to me that
the TOK_RC case in js_EmitTree will choke on this.
2009-10-08 10:29:02 -07:00
Brendan Eich
2cf8dc9cf7 Remove now-redundant USE2DEF flags propagation before LinkUseToDef, which does it (510783 followup, r=mrbkap). 2009-09-17 19:44:24 -07:00
Brendan Eich
59ee053a5e Propagate USE2DEF flags in LinkUseToDef, duh (510783, r=mrbkap). 2009-09-17 18:56:23 -07:00
David Anderson
92ad5b2859 Renamed JSOP_LOOP to JSOP_TRACE, which now also gets emitted at the start of scripts (bug 515806, r=brendan). 2009-09-14 17:26:16 -07:00
Brendan Eich
79d774b114 Bug 515815 - TM: Regression on shell test case regress-452498-224.js (r=igor). 2009-09-11 10:47:47 -07:00
Brendan Eich
1cef550e73 Fix obvious thinko that bites Gary's fuzzer (515892, r=igor tomorrow, I trust). 2009-09-11 00:00:52 -07:00
Brendan Eich
016b0f207a Bug 514981 - JSStackFrame::sharp{Array,Depth} should be locals allocated due to #n[#=] usage (r=igor). 2009-09-09 20:21:15 -07:00
Jason Orendorff
e170e4b573 Bug 511728 - Misc. cleanup from bug 503080. r=igor.
--HG--
extra : rebase_source : f4b7b385bbece2316912ce67c77a49ac8fca6e5c
2009-09-09 15:53:37 -05:00
Brendan Eich
cce4dce512 Join lambdas assigned or initialized as methods to the compiler-created function object if we can, with a read barrier to clone on method value extractions other than call expressions (471214, r=jorendorff). 2009-09-03 14:41:19 -07:00
Andreas Gal
d4c110a6b1 Avoid bit twiddling on double values (513063, r=brendan). 2009-08-27 13:59:19 -07:00
Jason Orendorff
df3e3a355d Bug 510709 - Assertion failure: PN_TYPE(pn) == TOK_FUNCTION, at ../jsparse.cpp. r=brendan. 2009-08-27 12:28:28 -07:00
Brendan Eich
b063d31520 Back out changeset aff171a8c4f0 (bug 471214). 2009-08-26 09:34:41 -07:00
Brendan Eich
bd8f55c0ad Join function objects where possible (471214, r=igor). 2009-08-25 23:42:37 -07:00