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

Issue 214883002: Two-threaded parser (Closed)

Created:
6 years, 9 months ago by marja
Modified:
5 years, 8 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev, dcarney, Michael Starzinger, ulan, Dmitry Lomov (no reviews), Sven Panne
Visibility:
Public.

Description

Two-threaded parser This is how it works: - The background thread runs PreParser to find lazy functions. The main thread runs Parser, and uses the data produced by the background thread to skip over lazy functions. - This can only work for external strings, since they're stored outside the V8 heap. ExternalTwoByteStringUtf16CharacterStream and ExternalOneByteStringUtf16CharacterStream keep a Handle<String> but they are safe to use in the background thread, since they don't access the Handle after the constructor. - The "cached data" is still produced by Parser like before, and stored like before. BUG=

Patch Set 1 : first working version #

Patch Set 2 : . #

Patch Set 3 : moar #

Patch Set 4 : even more working than before #

Patch Set 5 : . #

Patch Set 6 : . #

Patch Set 7 : . #

Patch Set 8 : not so accidental comma? #

Patch Set 9 : fixed #

Patch Set 10 : . #

Patch Set 11 : . #

Patch Set 12 : . #

Patch Set 13 : saner version #

Patch Set 14 : quality++ #

Patch Set 15 : rebased #

Patch Set 16 : moar #

Patch Set 17 : rebased #

Patch Set 18 : rebased #

Patch Set 19 : . #

Patch Set 20 : . #

Patch Set 21 : . #

Patch Set 22 : . #

Patch Set 23 : . #

Patch Set 24 : rebased #

Patch Set 25 : . #

Patch Set 26 : more tests #

Patch Set 27 : code review (svenpanne) #

Total comments: 10

Patch Set 28 : rebased #

Patch Set 29 : partial code review #

Patch Set 30 : rest of code review #

Patch Set 31 : rest of code review #

Patch Set 32 : . #

Patch Set 33 : share the background thread between tasks #

Patch Set 34 : . #

Patch Set 35 : naming #

Patch Set 36 : . #

Total comments: 4

Patch Set 37 : rebased #

Patch Set 38 : code review (mstarzinger) #

Patch Set 39 : rebased #

Patch Set 40 : rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+653 lines, -84 lines) Patch
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +3 lines, -0 lines 0 comments Download
M src/isolate.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 3 chunks +6 lines, -0 lines 0 comments Download
M src/isolate.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 4 chunks +13 lines, -0 lines 0 comments Download
M src/parser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 2 chunks +16 lines, -0 lines 0 comments Download
M src/parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 11 chunks +113 lines, -52 lines 0 comments Download
A src/parser-thread.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 1 chunk +95 lines, -0 lines 0 comments Download
A src/parser-thread.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 1 chunk +223 lines, -0 lines 0 comments Download
M src/preparse-data.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 2 chunks +2 lines, -1 line 0 comments Download
M src/preparser.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 5 chunks +9 lines, -3 lines 0 comments Download
M src/preparser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 2 chunks +12 lines, -4 lines 0 comments Download
M src/scanner-character-streams.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 2 chunks +23 lines, -3 lines 0 comments Download
M src/scanner-character-streams.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 1 chunk +44 lines, -9 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 10 chunks +71 lines, -11 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +2 lines, -0 lines 0 comments Download
M tools/parser-shell.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 3 chunks +21 lines, -1 line 0 comments Download

Messages

Total messages: 11 (0 generated)
marja
svenpanne, ptal, {dcarney,ulan,dslomov,mstarzinger}, you might also want to have a look. Try jobs are in ...
6 years, 8 months ago (2014-04-15 09:07:16 UTC) #1
Sven Panne
I only had a quick look so far, but I have already one suggestion: Instead ...
6 years, 8 months ago (2014-04-15 11:21:30 UTC) #2
marja
On 2014/04/15 11:21:30, Sven Panne wrote: > I only had a quick look so far, ...
6 years, 8 months ago (2014-04-15 12:08:09 UTC) #3
Sven Panne
https://codereview.chromium.org/214883002/diff/530001/src/parser-thread.cc File src/parser-thread.cc (right): https://codereview.chromium.org/214883002/diff/530001/src/parser-thread.cc#newcode60 src/parser-thread.cc:60: mutex_.Lock(); Use LockGuard here... https://codereview.chromium.org/214883002/diff/530001/src/parser-thread.cc#newcode70 src/parser-thread.cc:70: mutex_.Lock(); ... and ...
6 years, 8 months ago (2014-04-16 11:55:35 UTC) #4
marja
Thanks for comments! Relaying some offline code review discussions: mstarzinger@ suggested adding a flag to ...
6 years, 8 months ago (2014-04-16 14:33:09 UTC) #5
marja
svenpanne, could you take another look? Some more offline code review: jochen@ said I should ...
6 years, 8 months ago (2014-04-17 15:17:20 UTC) #6
Michael Starzinger
LGTM with one comment. In general I am not a big fan of "transferring ownership" ...
6 years, 8 months ago (2014-04-23 09:07:10 UTC) #7
ulan
One suggestion, maybe for subsequent CL: https://codereview.chromium.org/214883002/diff/690001/src/parser-thread.cc File src/parser-thread.cc (right): https://codereview.chromium.org/214883002/diff/690001/src/parser-thread.cc#newcode94 src/parser-thread.cc:94: preparser.set_allow_lazy(true); Would it ...
6 years, 8 months ago (2014-04-23 10:18:20 UTC) #8
Sven Panne
https://codereview.chromium.org/214883002/diff/690001/src/parser-thread.cc File src/parser-thread.cc (right): https://codereview.chromium.org/214883002/diff/690001/src/parser-thread.cc#newcode94 src/parser-thread.cc:94: preparser.set_allow_lazy(true); On 2014/04/23 10:18:20, ulan wrote: > Would it ...
6 years, 8 months ago (2014-04-23 10:36:28 UTC) #9
Sven Panne
What's the state of this CL?
6 years, 6 months ago (2014-06-13 11:14:05 UTC) #10
marja
6 years, 6 months ago (2014-06-13 11:20:05 UTC) #11
On 2014/06/13 11:14:05, Sven Panne wrote:
> What's the state of this CL?

On hold; the new best bet is to parse on a background thread while loading (for
that, https://codereview.chromium.org/314603004/ is the first step). After that
is done, this one might get resurrected (so we'd use several background
threads), but it's pretty questionable. At the moment I'm not doing anything
with this CL.

I'll remove reviewers so that this doesn't show up on your lists... (for future
reference, the list was mstarzinger@, ulan@, svenpanne@).

Powered by Google App Engine
This is Rietveld 408576698