Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Issue 5188009: Merge preparser Scanner with main JavaScript scanner. (Closed)

Created:
10 years, 1 month ago by Lasse Reichstein
Modified:
9 years, 6 months ago
CC:
v8-dev
Visibility:
Public.

Description

Merge preparser Scanner with main JavaScript scanner. Optimize scanning of keywords.

Patch Set 1 #

Total comments: 12

Patch Set 2 : Address review. Fix thinko in keyword matcher. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+124 lines, -1136 lines) Patch
M src/parser.cc View 1 5 chunks +14 lines, -41 lines 0 comments Download
D src/prescanner.h View 1 chunk +0 lines, -1054 lines 0 comments Download
M src/scanner.h View 1 1 chunk +5 lines, -3 lines 0 comments Download
M src/scanner.cc View 3 chunks +11 lines, -3 lines 0 comments Download
M src/scanner-base.h View 1 6 chunks +57 lines, -13 lines 0 comments Download
M src/scanner-base.cc View 1 8 chunks +37 lines, -22 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein
10 years, 1 month ago (2010-11-19 07:55:27 UTC) #1
Søren Thygesen Gjesse
LGTM http://codereview.chromium.org/5188009/diff/1/src/parser.cc File src/parser.cc (right): http://codereview.chromium.org/5188009/diff/1/src/parser.cc#newcode4639 src/parser.cc:4639: // Create a Scannerfor the preparser to use ...
10 years, 1 month ago (2010-11-19 08:17:20 UTC) #2
Lasse Reichstein
10 years, 1 month ago (2010-11-19 08:51:24 UTC) #3
http://codereview.chromium.org/5188009/diff/1/src/parser.cc
File src/parser.cc (right):

http://codereview.chromium.org/5188009/diff/1/src/parser.cc#newcode4639
src/parser.cc:4639: // Create a Scannerfor the preparser to use as input, and
preparse the source.
On 2010/11/19 08:17:21, Søren Gjesse wrote:
> Scannerfor -> Scanner for

Done.

http://codereview.chromium.org/5188009/diff/1/src/parser.cc#newcode4644
src/parser.cc:4644: int kLiteralFlags) {
On 2010/11/19 08:17:21, Søren Gjesse wrote:
> kLiteralFlags -> literal_flags.

Done.

http://codereview.chromium.org/5188009/diff/1/src/parser.cc#newcode4644
src/parser.cc:4644: int kLiteralFlags) {
I'm afraid it doesn't make any sense :)
The PartialParserRecorder is not the one deciding which literals to record in
the scanner. The PartialParserRecorder has some needs for literals (the
CompleteParserRecorder needs strings and identifiers recorded in order to make
preparser data for symbols, the PartialParserRecorder doesn't), but the scanner
is also used by the real parser which doesn't have a PartialParserRecorder.

I still don't *like* this approach, and I'll try to find a better one where we
don't have to make a test for each character that is scanned.
And perhaps without using utf-8 as intermediate storage.

http://codereview.chromium.org/5188009/diff/1/src/parser.cc#newcode4673
src/parser.cc:4673: const int kNoLiteralsFlag = 0;
I was split about that. Should the LiteralType be the type of elements in a set,
or the type of the set itself. I went for the former, so the full and empty set
are defined separatly.  

Let's add the full and empty set of literal types to the type.

http://codereview.chromium.org/5188009/diff/1/src/scanner-base.h
File src/scanner-base.h (right):

http://codereview.chromium.org/5188009/diff/1/src/scanner-base.h#newcode339
src/scanner-base.h:339: // More specialized literal scope.
Elaborated.

http://codereview.chromium.org/5188009/diff/1/src/scanner.h
File src/scanner.h (right):

http://codereview.chromium.org/5188009/diff/1/src/scanner.h#newcode120
src/scanner.h:120: static const int kAllLiteralsFlag = kLiteralNumber |
kLiteralString
Done.

Powered by Google App Engine
This is Rietveld 408576698