Commit Graph

188 Commits

Author SHA1 Message Date
antonm@chromium.org
ab24485760 Bypass JS accessors when building error array.
In the presence of JS accessors for elements on Object.prototype JSArray::SetFastElement
may throw or its behaviour can be altered.  Instead operate on plain FixedArrays and
turn them into JSArry later.

BUG=v8:1130
TEST=test/mjsunit/regress/regress-1130.js

Review URL: http://codereview.chromium.org/6481001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6730 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-10 15:02:13 +00:00
whesse@chromium.org
afec61e870 Fix typo in r6697: Use assertThrows correctly in the added test regress-1122.js.
Review URL: http://codereview.chromium.org/6460030

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6698 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-09 13:16:40 +00:00
whesse@chromium.org
602d5cf427 Fix a bug that occurs when functions are defined with more than 16,382 parameters.
Review URL: http://codereview.chromium.org/6447007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6697 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-09 12:46:22 +00:00
ager@chromium.org
096c21522b Fix wrong assumption in parser that parsing a function literal cannot throw an exception.
Review URL: http://codereview.chromium.org/6453009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6686 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-08 18:46:13 +00:00
lrn@chromium.org
48fadffcc4 Fix bug in JSON.parse for objects containing "__proto__" as key.
It added the __proto__ key as a normal key, which made it visible
in enumeration, while reading still hit the hard-coded accessor.

Review URL: http://codereview.chromium.org/6451002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6674 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-08 11:38:15 +00:00
sandholm@chromium.org
f64976e62d Improve ScanJsonNumber.
Review URL: http://codereview.chromium.org/6334106

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6658 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-07 08:57:06 +00:00
peterhal@chromium.org
39957aa741 Issue 117 - strict mode and future reserved words
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6653 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-04 18:36:37 +00:00
mmaly@chromium.org
87233c49c8 Pass strict mode to eval.
Code review feedback.

Code Review URL: http://codereview.chromium.org/6286043/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6652 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-04 18:15:49 +00:00
lrn@chromium.org
2d15eb9a90 Fix bug in object literals with large array indexes as strings.
Review URL: http://codereview.chromium.org/6410028

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6577 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-02 14:02:58 +00:00
mmaly@chromium.org
d07f1d62ff Strict mode eval/arguments LHS.
Review URL: http://codereview.chromium.org/6335013/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6503 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-26 19:21:46 +00:00
mmaly@chromium.org
2b47762e3a Strict mode object property validation.
Review URL: http://codereview.chromium.org/6335010/

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6475 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 18:42:35 +00:00
mmaly@chromium.org
f5a2860534 Strict mode parameter validation.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6474 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-25 17:21:45 +00:00
mmaly@chromium.org
8d79f3a788 Strict mode octal literals.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6446 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-24 18:13:18 +00:00
mmaly@chromium.org
4cb51b51e6 First part of strict mode.
- var eval | arguments
- catch (eval | arguments)
- 'with' is disabled
- function can't be named eval or arguments

Add FLAG_strict_mode

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6422 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-20 18:51:47 +00:00
mmaly@chromium.org
d6f88b6688 Revert strict mode (Mozilla test failure).
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6374 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-18 23:01:50 +00:00
mmaly@chromium.org
b4c88d5de4 First part of ES5 strict mode.
- var eval | arguments
- catch (eval | arguments)
- 'with' is disabled
- function can't be named eval or arguments
- function parameter name cannot be eval or arguments
- no duplicate parameter names allowed

Add FLAG_strict_mode

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6369 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-18 16:43:53 +00:00
lrn@chromium.org
f09705ab9b Make invalid break/continue statements an early syntax error.
Previously we delayed the throwing of syntax errors until runtime, so
unreachable errors didn't get reported.
To match a change in JSC, we now stop parsing and report the error immediately.

BUG=69736
TEST=

Review URL: http://codereview.chromium.org/6355006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6341 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-17 09:36:10 +00:00
lrn@chromium.org
3800b24f69 Don't lazily compile functions that are immediately receded by '('.
We heuristically expect those functions to be called immediately.

Review URL: http://codereview.chromium.org/6311005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6309 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-14 10:50:13 +00:00
lrn@chromium.org
90fd0ee897 Change interpretation of malformed \c? escapes in RegExp to match JSC.
Review URL: http://codereview.chromium.org/6171001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6225 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-07 12:35:42 +00:00
lrn@chromium.org
a50e69bda5 Avoid calling inherited setters when creating object literals and their boilerplates.
Fix issue 1015.

Review URL: http://codereview.chromium.org/6118001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6205 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-06 14:00:50 +00:00
fschneider@chromium.org
83c7c699eb Do not transform a/b into a * (1/b) in the parser for integer constants.
Strength reduction should be performed at a later stage. This
change avoid going to a double representation the case of
integer division.


Review URL: http://codereview.chromium.org/6044010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6174 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-05 11:25:42 +00:00
lrn@chromium.org
e7ecb74b8a Don't let JSON parsed objects hit inherited setters.
Review URL: http://codereview.chromium.org/6101001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6154 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-04 12:19:55 +00:00
lrn@chromium.org
351f80adee Fix compile-problem in (currently) unused stand-alone preparser function.
Allow object initializers to define getters using string and number literals.

Review URL: http://codereview.chromium.org/5985010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6150 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-01-04 12:07:16 +00:00
lrn@chromium.org
c9928c0595 Change scanner buffers to not use utf-8.
Make preparser keep its symbol text itself instead of relying on the scanner.

Review URL: http://codereview.chromium.org/6075005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6115 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-22 20:14:19 +00:00
sandholm@chromium.org
a496150a9e Minor optimization in regexp parse.
Review URL: http://codereview.chromium.org/6014002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6081 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-20 10:44:41 +00:00
lrn@chromium.org
94bb378ee5 Make RegExp character class match JSC.
See http://trac.webkit.org/changeset/73594

Review URL: http://codereview.chromium.org/5723002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5974 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-13 08:33:32 +00:00
lrn@chromium.org
6691d531ab Revert 5911 (RegExp fail on invalid range syntax).
Review URL: http://codereview.chromium.org/5703001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5953 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-09 12:07:52 +00:00
lrn@chromium.org
b55add7e20 Optimized scanner to avoid virtual calls for every character read.
Review URL: http://codereview.chromium.org/5545006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5935 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 14:03:59 +00:00
kasperl@chromium.org
90b3370374 Update V8 to version 3.0 (re-land r5920).
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5922 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 11:31:57 +00:00
kasperl@chromium.org
51b494d096 Revert r5920. Will re-land shortly.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5921 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 11:01:02 +00:00
kasperl@chromium.org
e5860bd6a8 Update V8 to version 3.0.
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5920 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-07 09:11:56 +00:00
lrn@chromium.org
be20c55b3e Change RegExp syntax to fail on invalid ranges like [\d-x], [x-\d] and [\d-\d].
The previous behavior was to treat the "-" as verbatim if the range was invalid.
This change matches the JSC changeset http://trac.webkit.org/changeset/72813/

Review URL: http://codereview.chromium.org/5464001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5911 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-12-02 08:02:37 +00:00
lrn@chromium.org
84f2f5ee90 Preparser extracted into separate files that can be compiled to a library.
No scons target yet.

Review URL: http://codereview.chromium.org/5295004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5899 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-29 13:24:37 +00:00
lrn@chromium.org
dc390d0e1f Untemplated preparser.h and made it depend on virtual types.
Extracted preparse-data specification and logging classes.

Review URL: http://codereview.chromium.org/5166006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5877 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-23 11:46:36 +00:00
ager@chromium.org
1e8413e188 Force pretenuring of closures that are immediately assigned to
properties. For these closures we would like to be able to use
constant functions and for that we need the closures allocated in old
space.
Review URL: http://codereview.chromium.org/5220007

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-22 09:57:21 +00:00
lrn@chromium.org
afbbf485fb Merge preparser Scanner with main JavaScript scanner.
Optimize scanning of keywords.

Review URL: http://codereview.chromium.org/5188009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5858 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-19 09:02:59 +00:00
lrn@chromium.org
2d4aa6295b Extract scanner base/JS/JSON and move base and JS to scanner-base.
Remove templates from prescanner.

Review URL: http://codereview.chromium.org/5136002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5854 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-18 13:07:02 +00:00
lrn@chromium.org
9902e43293 Add separate scanner only intended for preparsing.
Review URL: http://codereview.chromium.org/5063003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5837 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-17 12:00:22 +00:00
lrn@chromium.org
0464b33625 Fix bug in parser that allows "(foo):42" as a labeled statement.
Fixes issue 918.

Review URL: http://codereview.chromium.org/5044003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5830 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-16 12:10:48 +00:00
lrn@chromium.org
1341dde85f Revert premature addition to parser.
TBR:ricow

Review URL: http://codereview.chromium.org/5055003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5829 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-16 08:16:13 +00:00
lrn@chromium.org
47c1870996 Move static scanner fields to scanner-base.h
Review URL: http://codereview.chromium.org/5026005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5828 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-16 08:01:45 +00:00
lrn@chromium.org
7f764978ee Remove old preparser option and behavior from the parser.
Review URL: http://codereview.chromium.org/4244003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5752 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-02 11:45:47 +00:00
lrn@chromium.org
42b6151247 Stand-alone parser template.
Uses existing Scanner and ParserLog.
Generates same preparse-data as existing preparser.

Review URL: http://codereview.chromium.org/4112012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5750 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-02 07:21:37 +00:00
lrn@chromium.org
81a3f7bfb5 Make Parser class have no friends and fewer things to depend on it.
Review URL: http://codereview.chromium.org/4146006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5719 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-27 12:33:48 +00:00
lrn@chromium.org
938d88e193 Separate JSON parsing from the JavaScript parser.
Switch JSON parsing to creating the value directly instead of createing
code to create the value.

Review URL: http://codereview.chromium.org/4135004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5715 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-27 09:19:43 +00:00
erik.corry@gmail.com
0dcaac1939 Make Failure inherit from MaybeObject instead of Object.
Review URL: http://codereview.chromium.org/3970005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5698 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-25 15:22:03 +00:00
kmillikin@chromium.org
bef3ae07db Begin a more aggressive refactoring of the Compiler interface.
The plan is to use the CompilationInfo class to communicate inputs and
outputs to compilation pipeline phases, which each return a boolean
success/failure flag.

The intent is to make it easier to compose small pieces of the
pipeline without having to grow a custom function each time, each
taking a half dozen arguments.

This change modifies the very front end (the parser).

Review URL: http://codereview.chromium.org/3586006

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5581 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-04 11:35:46 +00:00
kmillikin@chromium.org
d0fcd24c03 Make some free functions into static members of class Parser.
Review URL: http://codereview.chromium.org/3518005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5576 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-10-01 14:10:47 +00:00
kmillikin@chromium.org
c019508bad Cleanup of the parser.
The lazy parsing functions took a host of arguments that can all be
derived from the SharedFunctionInfo, and the SharedFunctionInfo is
always available when parsing lazily.  Change the interface to take a
single CompilationInfo or SharedFunctionInfo argument.

Also remove a flag in the parser that was always false when it was read.

Review URL: http://codereview.chromium.org/3538005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5561 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-30 09:28:58 +00:00
lrn@chromium.org
8f7bfea235 Avoid logging preparse-data inside lazily compiled functions.
Reduces size of preparser data significantly when there are nested functions.
Also allows us to drop the "skip" fields of function entries,
that tells us how much preparse-data to skip when skipping the function source.

Review URL: http://codereview.chromium.org/3412034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5541 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-28 07:50:32 +00:00