vitalyr@chromium.org
df91f6b396
Simpler (and a bit faster) keyword matcher.
...
Replaced the keyword matching state machine with a switch on the first char followed up by inlined char comparisons.
R=lrn@chromium.org
TEST=cctest/test-parsing/ScanKeywords
Review URL: http://codereview.chromium.org/7558017
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8866 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-09 13:32:53 +00:00
vitalyr@chromium.org
1dcb6e33cd
Minimize malloc heap allocation on process startup.
...
R=vegorov@chromium.org
BUG=http://b/issue?id=5095592
Review URL: http://codereview.chromium.org/7572018
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8833 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-08-04 15:18:18 +00:00
lrn@chromium.org
e378829b24
Combined identical classes V8JavaScriptScanner and StandAloneJavaScriptScanner.
...
Now only uses the common superclass of the two scanner classes.
Updated comment on KeywordMatcher.
Review URL: http://codereview.chromium.org/7211013
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8362 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-22 09:06:03 +00:00
lrn@chromium.org
12c3e7799c
Make multi-line comments not count when checking whether --> is first on a line.
...
A multi-line comment containing a newline is considered a line-terminator for
other purposes, but a "-->" following such a comment is considered as being
on the same line as the text preceeding the multi-line comment.
This behavior matches JSC matching Firefox.
TEST=cctest/test-parsing/ScanHTMLEndComments
Review URL: http://codereview.chromium.org/7218009
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8351 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-21 13:34:16 +00:00
lrn@chromium.org
480ec43c4e
Make "native" not a keyword.
...
We now only recognize "native function" when it occurs in extension scripts
(parsing with a non-NULL extension), and only if there is no line-terminator
between "native" and "function" (so that it would otherwise be a Syntax Error).
Preparsing never recognizes native functions, which is acceptable since we
never preparse extension scripts (because we don't allow lazy functions
anyway).
BUG=v8:1097
Review URL: http://codereview.chromium.org/7206020
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8326 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-06-20 10:20:57 +00:00
lrn@chromium.org
a932441a0c
Cleanup of ScannerConstants, now named UnicodeCache.
...
The ScannerConstants class was originally static fields on the scanner class.
During creation of the stand-alone preparser and later isolates, it has been
moved into a separate class with a per-isolate instance.
It is used to hold caching unicode Predicate values.
This change renames the class to UnicodeCache, and passes a reference
to the instance down to methods that doesn't have an easy access to
an isolate (to avoid, e.g., having to do an Isolate::Current() for every
number parsed).
Review URL: http://codereview.chromium.org/6824071
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7584 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-04-12 08:27:38 +00:00
lrn@chromium.org
385e4deff5
Make the preparser standalone library and process build in debug mode.
...
It should now be possible to build the preparser using 'scons preparser' in both release and debug modes.
Remove v8.h include from scanner-base.h and other files.
Remove NativeAllocationChecker and all of its kind.
Moved Isolate::PreallocatedStorage* to isolate.cc
Review URL: http://codereview.chromium.org/6749029
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7413 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-29 13:06:48 +00:00
vitalyr@chromium.org
7976ca2cbc
Merge isolates to bleeding_edge.
...
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7271 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 20:35:07 +00:00
vitalyr@chromium.org
76e226f832
Revert r7268: it borked the history.
...
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7269 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 19:41:05 +00:00
vitalyr@chromium.org
6ff7fdebd3
Merge isolates to bleeding_edge.
...
Review URL: http://codereview.chromium.org/6685088
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7268 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-03-18 18:49:56 +00:00
ager@chromium.org
a504d4bc01
Blargh. Yet another shot in the dark attempt to fix win64 compile.
...
BUG=
TEST=
Review URL: http://codereview.chromium.org/6480116
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6819 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-16 13:42:26 +00:00
ager@chromium.org
cde03d2fba
Another attempt to fix win64 compile.
...
BUG=
TEST=
Review URL: http://codereview.chromium.org/6525051
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6818 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-16 13:37:26 +00:00
ager@chromium.org
4235110a82
Speculative fix for win64 build breakage.
...
strstr returns a pointer and we are using an int to store a pointer difference. Using intptr_t instead.
Review URL: http://codereview.chromium.org/6529049
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6816 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2011-02-16 13:24:40 +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
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
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
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
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
7fac48cc87
Fix compile error on Windows (no snprintf support).
...
Luckily the snprintf wasn't really needed.
TBR:whesse
Review URL: http://codereview.chromium.org/4678007
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5814 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-11 13:47:15 +00:00
lrn@chromium.org
fc3bdf4d20
Preparsing now considers catch-blocks as inside a with.
...
Fix issue 928.
Review URL: http://codereview.chromium.org/4639005
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5813 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-11 11:45:25 +00:00
lrn@chromium.org
17f532acb9
Fix Chromium bug 62639.
...
Add missing failure check after expecting an identifier in preparser.
This allowed code to use the non-existing literal.
Review URL: http://codereview.chromium.org/4800001
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5811 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-11 10:18:48 +00:00
lrn@chromium.org
f386f97476
Move part of scanner.* into scanner-base.* for reuse in preparser scanner.
...
Make checks.h not depend on flags.h or global.h (or anything else except
include/v8stdint.h). Only checks.cc has the dependencies (so another
implementation of checks.cc can be provided by the preparser).
Now files depending on checks.h (using ASSERT macros) can include it
directly without depending on all of v8.
Review URL: http://codereview.chromium.org/4576001
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5775 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-05 13:33:40 +00:00
lrn@chromium.org
3c1c4ffb29
Simplify preparsing of "new"-expressions.
...
Review URL: http://codereview.chromium.org/4331003
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5764 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-11-04 07:19:06 +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
antonm@chromium.org
88eb06098e
Fix Win64 build with VS2008.
...
strlen returns size_t and VS2008 is now pretty picky about that.
Review URL: http://codereview.chromium.org/3384019
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5506 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-22 13:24:14 +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
lrn@chromium.org
5628d3c482
Fix parsing of /**/--> on first line of input.
...
BUG=53548
TEST=
Review URL: http://codereview.chromium.org/3330001
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5400 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2010-09-02 07:36:30 +00:00
lrn@chromium.org
d53f05e3e2
Fix warnings on Win64.
...
Set warning level to /W3 and change implicit conversions from size_t
to int. Most "fixes" are simply manifesting the implicit casts or using
a special strlen replacement that returns int.
Review URL: http://codereview.chromium.org/390004
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-11 09:50:06 +00:00
lrn@chromium.org
273e860cc1
Changed keyword token recognition to be done inline in the identifier scanner.
...
Review URL: http://codereview.chromium.org/360048
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3221 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
2009-11-05 10:11:38 +00:00