Commit Graph

164 Commits

Author SHA1 Message Date
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
kmillikin@chromium.org
9c503a8330 Fix some inconsistent formatting.
I noticed we sometimes had extra spaces before and after the "const"
keyword.  Probably the result of a search and replace gone wrong.

This is a whitespace only change.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5519 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-24 08:25:31 +00:00
lrn@chromium.org
a98baf9666 Remove unused variable from Scanner class.
BUG=None
TEST=compiles

Patch from Thiago Farina <tfarina@chromium.org>

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5490 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-20 08:43:35 +00:00
lrn@chromium.org
81b0236d76 Make preparsing data reusable.
Fix bug in writing symbol ids over 128.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5485 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-17 12:55:27 +00:00
lrn@chromium.org
cb514b72db Made predata smaller by storing symbol data in variable length base-128.
Remove position from symbol data - they must come in the correct order anyway.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5458 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-15 10:54:35 +00:00
whesse@chromium.org
fc83faa8fd Move inlined function declarations and support from codegen.* to runtime.*.
Review URL: http://codereview.chromium.org/3293002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5451 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-14 14:52:53 +00:00
lrn@chromium.org
67d8302779 Avoid collecting symbol info for one-off preparsing.
Review URL: http://codereview.chromium.org/3356010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5431 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-09 11:49:21 +00:00
lrn@chromium.org
7d3711ef75 Avoid (some) symbol lookups at parse time if preparse data is available.
Review URL: http://codereview.chromium.org/3308010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5421 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-07 12:52:16 +00:00
erik.corry@gmail.com
663f378da5 Get gcc to check that we don't ignore return values of functions that can
fail to allocate because we need a GC.
Review URL: http://codereview.chromium.org/3274008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5379 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-31 08:05:42 +00:00
lrn@chromium.org
7b89a5f2b8 Reordered function entries in PreParse data to be ordered by start position.
Also add skip to entry, to skip pre-data for the body of the function.
Preparser data is now only accessed linearly, in the same order it was created.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5361 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-27 08:26:29 +00:00
lrn@chromium.org
99ce72bd8a Use collector for preparse data.
This is in preparation of adding more data to the preparse record.
Using a collector instead of a list avoids copying data when the backing
store grows.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5334 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-25 06:46:53 +00:00
kasperl@chromium.org
a342aa03d5 Add position information for compares, binary ops, and count
operations.
Review URL: http://codereview.chromium.org/3120027

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5332 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-24 13:51:23 +00:00
kasperl@chromium.org
98ac5d813f Introduce a new intermediate AST node for encapsulating the
increment part of a count operation.
Review URL: http://codereview.chromium.org/3150032

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5328 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-24 12:56:45 +00:00
lrn@chromium.org
b1e27e2cd5 Created collector class and used it to collect identifiers during scanning.
The collector class automatically expands to hold the values added to it,
like a List, but doesn't ensure that the backing store is contiguous, which
allows it to avoid copying back and forth as the buffer grows.

This is in preparation for identifyng identical symbols during preparsing.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5325 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-24 10:53:44 +00:00
kasperl@chromium.org
3527e29e8e Remove the full codegen syntax checker completely but be
careful to avoid making code with loops run too slowly.
Review URL: http://codereview.chromium.org/3107033

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5324 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-24 09:04:17 +00:00
kasperl@chromium.org
7b51dc7edb Cleanup the AST code by removing unused parts and get rid of the
flow graph code completely. Add new AST node for null compares
and use it to make the full codegens better at generating code
for null comparisons.
Review URL: http://codereview.chromium.org/3146037

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5323 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-24 07:26:49 +00:00
kasperl@chromium.org
528eb97b3a Move the function name inferrer code from the AstOptimizer to
the parser in preparation for not using the optimizer when 
using the full codegen. Code covered by existing tests.
Review URL: http://codereview.chromium.org/3141034

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5321 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-23 13:26:03 +00:00
vitalyr@chromium.org
3202df6c69 Copy-on-write arrays.
Object model changes
----------------------------------------
New fixed_cow_array_map is used for the elements array of a JSObject
to mark it as COW. The JSObject's map and other fields are not
affected. The JSObject's map still has the "fast elements" bit set. It
means we can do only the receiver map check in keyed loads and the
receiver and the elements map checks in keyed stores. So introducing
COW arrays doesn't hurt performance of these operations. But note that
the elements map check is necessary in all mutating operations because
the "has fast elements" bit now means "has fast elements for reading".
EnsureWritableFastElements can be used in runtime functions to perform
the necessary lazy copying.

Generated code changes
----------------------------------------
Generic keyed load is updated to only do the receiver map check (this
could have been done earlier). FastCloneShallowArrayStub now has two
modes: clone elements and use COW elements. AssertFastElements macro
is added to check the elements when necessary. The custom call IC
generators for Array.prototype.{push,pop} are updated to avoid going
to the slow case (and patching the IC) when calling the builtin should
work.

COW enablement
----------------------------------------
Currently we only put shallow and simple literal arrays in the COW
mode. This is done by the parser.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5275 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-16 16:06:46 +00:00
lrn@chromium.org
6267578925 Removed support for object literal get/set with number/string property name.
It doesn't work correctly for array indices.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5232 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-10 12:44:13 +00:00
lrn@chromium.org
53690b68fa Changed layout of object literal parser.
Review URL: http://codereview.chromium.org/3032064

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5206 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-09 08:54:29 +00:00
sgjesse@chromium.org
88b19a9d0c Re-apply r5165 (Added support for ES5's propertyname production)
TBR=lrn@chromium.org
Review URL: http://codereview.chromium.org/3073031

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5192 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-06 08:03:44 +00:00
sgjesse@chromium.org
1844e149ab Revert r5165 (Added support for ES5's propertyname production)
This is to test in Chromium without this change.

TBR=lrn@chromium.org
Review URL: http://codereview.chromium.org/3027043

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5182 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-05 14:46:34 +00:00
lrn@chromium.org
24cf5459f5 Added support for ES5's propertyname production.
Object initialisers and dot-notation property access allows keywords in ES5.
Also allowed non-identifiers after "get" or "set" in an object initialiser.

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5165 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-08-02 12:09:10 +00:00
kaznacheev@chromium.org
db23321704 Create a separate class to encapsulate ScopeInfo serialization.
The static ScopeInfo members moved into this class.
The new class is named ScopeInfoObject which I am not proud of,
better ideas are very welcome.

Also got rid of the sentinels in the serialized scope info which saves 3 words per function
and is not slower.
 
Review URL: http://codereview.chromium.org/2908009

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5067 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-14 11:18:09 +00:00
kaznacheev@chromium.org
0243bc875c Move serialized scope info from Code object to SharedFunctionInfo.
The scope info is now stored in a FixedArray referenced from SharedFunctionInfo.


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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5056 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-07-13 13:06:33 +00:00