Commit Graph

30 Commits

Author SHA1 Message Date
Jochen Eisinger
f5a508f31f Disable other background modules while testing the CompilerDispatcher
R=rmcilroy@chromium.org,mlippautz@chromium.org
BUG=v8:6069

Change-Id: Iea0134ef3a0252f5a6f4ae2154218776dc6ff96d
Reviewed-on: https://chromium-review.googlesource.com/453960
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Jochen Eisinger <jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43786}
2017-03-14 14:01:03 +00:00
rmcilroy
6d42c4504a [complier] Enable parallel eager inner function compilation with compiler dispatcher.
Enable enqueueing of eager inner function compilation onto the compiler
dispatcher. This enables these tasks to be performed in parallel to
compilation of the outer functio (only for Ignition functions).
We currently synchronize to ensure all inner function compilations
 are complete before executing the outer function - future work will
allow outer function execution to happenin parallel to inner function
compilation.

BUG=v8:5203,v8:5215

Review-Url: https://codereview.chromium.org/2611313002
Cr-Commit-Position: refs/heads/master@{#42667}
2017-01-25 22:41:57 +00:00
machenbach
6715439932 Revert of [complier] Enable parallel eager inner function compilation with compiler dispatcher. (patchset #11 id:260001 of https://codereview.chromium.org/2611313002/ )
Reason for revert:
Some crashes on mac:
https://build.chromium.org/p/client.v8/builders/V8%20Mac%20-%20debug/builds/11982/steps/Ignition%20-%20turbofan/logs/regress-crbug-429159
https://build.chromium.org/p/client.v8/builders/V8%20Mac%20GC%20Stress/builds/10966

Original issue's description:
> [complier] Enable parallel eager inner function compilation with compiler dispatcher.
>
> Enable enqueueing of eager inner function compilation onto the compiler
> dispatcher. This enables these tasks to be performed in parallel to
> compilation of the outer functio (only for Ignition functions).
> We currently synchronize to ensure all inner function compilations
>  are complete before executing the outer function - future work will
> allow outer function execution to happenin parallel to inner function
> compilation.
>
> BUG=v8:5203,v8:5215
>
> Review-Url: https://codereview.chromium.org/2611313002
> Cr-Commit-Position: refs/heads/master@{#42413}
> Committed: f12661a1ec

TBR=jochen@chromium.org,marja@chromium.org,mstarzinger@chromium.org,rmcilroy@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5203,v8:5215

Review-Url: https://codereview.chromium.org/2637123002
Cr-Commit-Position: refs/heads/master@{#42416}
2017-01-17 15:28:42 +00:00
rmcilroy
f12661a1ec [complier] Enable parallel eager inner function compilation with compiler dispatcher.
Enable enqueueing of eager inner function compilation onto the compiler
dispatcher. This enables these tasks to be performed in parallel to
compilation of the outer functio (only for Ignition functions).
We currently synchronize to ensure all inner function compilations
 are complete before executing the outer function - future work will
allow outer function execution to happenin parallel to inner function
compilation.

BUG=v8:5203,v8:5215

Review-Url: https://codereview.chromium.org/2611313002
Cr-Commit-Position: refs/heads/master@{#42413}
2017-01-17 14:56:47 +00:00
jochen
f40fdd1f3b [compiler-dispatcher] make it so that we can always parse on bg threads
BUG=v8:5215
R=rmcilroy@chromium.org,hpayer@chromium.org,vogelheim@chromium.org,marja@chromium.org

Review-Url: https://codereview.chromium.org/2625413004
Cr-Commit-Position: refs/heads/master@{#42361}
2017-01-16 10:49:16 +00:00
jochen
4246200c4c Remove old debug code from compiler-dispatcher-job-unittest
R=marja@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2606223002
Cr-Commit-Position: refs/heads/master@{#42007}
2017-01-02 11:56:50 +00:00
jochen
87bf033799 Don't compile inner functions when compiling via the dispatcher
BUG=v8:5394
R=mstarzinger@chromium.org,rmcilroy@chromium.org

Review-Url: https://codereview.chromium.org/2579973002
Cr-Commit-Position: refs/heads/master@{#41754}
2016-12-16 12:38:17 +00:00
jochen
4f2cb8fe82 Reland of "Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID"
Original CL description:
> Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID
>
> Now that SharedFunctionInfos have a unique ID (and the IDs are dense),
> we can use them as an index into an array, instead of using a
> WeakFixedArray where we have to do a linear scan.
>
> Hooking up liveedit is a bit more involved, see
> https://docs.google.com/presentation/d/1FtNa3U7WsF5bPhY9uGoJG5Y9hnz5VBDabfOWpb4unWI/edit
> for an overview
>
> BUG=v8:5589
> R=verwaest@chromium.org,jgruber@chromium.org
>
> Review-Url: https://codereview.chromium.org/2547483002

BUG=v8:5589
TBR=verwaest@chromium.org,jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2577063002
Cr-Commit-Position: refs/heads/master@{#41734}
2016-12-15 17:19:55 +00:00
kozyatinskiy
3dea2c8354 Revert of Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID (patchset #11 id:190001 of https://codereview.chromium.org/2547483002/ )
Reason for revert:
LiveEdit is broken in some cases.

Original issue's description:
> Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID
>
> Now that SharedFunctionInfos have a unique ID (and the IDs are dense),
> we can use them as an index into an array, instead of using a
> WeakFixedArray where we have to do a linear scan.
>
> Hooking up liveedit is a bit more involved, see
> https://docs.google.com/presentation/d/1FtNa3U7WsF5bPhY9uGoJG5Y9hnz5VBDabfOWpb4unWI/edit
> for an overview
>
> BUG=v8:5589
> R=verwaest@chromium.org,jgruber@chromium.org
>
> Committed: https://crrev.com/6595e7405769dc9d49e9568d61485efc6d468baf
> Cr-Commit-Position: refs/heads/master@{#41600}

TBR=jgruber@chromium.org,verwaest@chromium.org,yangguo@chromium.org,jochen@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=v8:5589,chromium:673950
NOPRESUBMIT=true

Review-Url: https://codereview.chromium.org/2578433002
Cr-Commit-Position: refs/heads/master@{#41684}
2016-12-14 02:05:05 +00:00
jochen
1bdf908db0 Add a basic compiler dispatcher
It doesn't schedule steps yet, but there are tests.

BUG=v8:5215
R=rmcilroy@chromium.org,marja@chromium.org

Review-Url: https://codereview.chromium.org/2558293004
Cr-Commit-Position: refs/heads/master@{#41650}
2016-12-12 15:36:25 +00:00
jochen
6595e74057 Store SharedFunctionInfos of a Script in a FixedArray indexed by their ID
Now that SharedFunctionInfos have a unique ID (and the IDs are dense),
we can use them as an index into an array, instead of using a
WeakFixedArray where we have to do a linear scan.

Hooking up liveedit is a bit more involved, see
https://docs.google.com/presentation/d/1FtNa3U7WsF5bPhY9uGoJG5Y9hnz5VBDabfOWpb4unWI/edit
for an overview

BUG=v8:5589
R=verwaest@chromium.org,jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2547483002
Cr-Commit-Position: refs/heads/master@{#41600}
2016-12-08 17:07:11 +00:00
jochen
cfebe6034c Assign unique IDs to FunctionLiterals
They're supposed to be stable across several parse passes, so we'll also
store them in the associated SharedFunctionInfos

To achieve this, the PreParser and Parser need to generated the same number of
FunctionLiterals. To achieve this, we teach the PreParser about desuggaring of
class literals.

For regular functions, the function IDs are assigned in the order they occur in
the source. For arrow functions, however, we only know that it's an arrow function
after parsing the parameter list, and so the ID assigned to the arrow function is
larger than the IDs assigned to functions defined in the parameter list. This
implies that we have to reset the function ID counter to before the parameter list
when re-parsing an arrow function. To be able to do this, we store the number of
function literals found in the parameter list of arrow functions as well.

BUG=v8:5589

Review-Url: https://codereview.chromium.org/2481163002
Cr-Commit-Position: refs/heads/master@{#41309}
2016-11-28 11:40:53 +00:00
jochen
0f0912dd23 Change the CompilerDispatcherJob to take a SharedFunctionInfo
This means we can no longer take the closure's context to parse, but
need to rely on the outer scope info.

Since it's not possible to get that, however, for lazy functions, we
introduce a new field to SharedFunctionInfo that stores the outer scope
info whenever available.

BUG=v8:5215
R=marja@chromium.org,verwaest@chromium.org,jgruber@chromium.org

Review-Url: https://codereview.chromium.org/2358503002
Cr-Commit-Position: refs/heads/master@{#39548}
2016-09-20 12:08:42 +00:00
jochen
94492437d9 Fully deserialize the scope chain after parsing, not before
To avoid a dependency on the heap during parsing, we only create a scope chain
without linking to the associated ScopeInfo objects before parsing. This is
enough to avoid special cases during parsing of arrow functions / eval.

Looking at the outer scope's variables during parsing was only needed for hosting
sloppy block functions inside eval. To be able to do this now, we hoist for the
outer-most eval scope after parsing, in DeclarationScope::Analyze.

DeclarationScope::Analyze is also where we replace the outer scope chain with the
fully deserialized version, so variables can be resolved.

Also, this unifies background and foreground thread parsing, as we don't have to
worry about ScopeInfos getting accessed before we're back on the main thread.

BUG=v8:5215
R=verwaest@chromium.org,marja@chromium.org,adamk@chromium.org

Review-Url: https://codereview.chromium.org/2306413002
Cr-Commit-Position: refs/heads/master@{#39452}
2016-09-15 16:41:26 +00:00
rmcilroy
a550528dd2 [Ignition] Add test of bytecode compilation on background thread.
BUG=v8:5203

Review-Url: https://codereview.chromium.org/2278153003
Cr-Commit-Position: refs/heads/master@{#39207}
2016-09-06 13:34:44 +00:00
marja
7a6fb4d0e9 Include only stuff you need, part 7: Fix scopes.h -> ast.h.
Rebuilding (after touching certain files) is crazy slow because
includes are out of control.

BUG=v8:5294

Review-Url: https://codereview.chromium.org/2312683002
Cr-Commit-Position: refs/heads/master@{#39161}
2016-09-05 11:54:34 +00:00
rmcilroy
677948255b Fix CompilerDispatcherJobTest::CompileFailureToFinalize on local runs.
BUG=

Review-Url: https://codereview.chromium.org/2276343003
Cr-Commit-Position: refs/heads/master@{#38909}
2016-08-25 13:57:56 +00:00
rmcilroy
b2734f6a1b [Test] Fix CompilerDispatcher test.
Review-Url: https://codereview.chromium.org/2281463002
Cr-Commit-Position: refs/heads/master@{#38900}
2016-08-25 11:29:43 +00:00
rmcilroy
c2d2d4d1ce [Compiler] Add compile operations to CompilerDispatcherJob.
Adds compile operations to the CompilerDispatcherJob interface. As such,
introduces Compiler::PrepareUnoptimizedCompilationJob and updates the
unoptimized compilation path to use CompilationJobs. Also unifies
FinalizeCompilationJob to deal with both optimized and unoptimized
compilation jobs.

A dummy FullCodegenCompilationJob is also introduced, where all the work
is done in the ExecuteJob phase, which cannot be run on a
background thread.

BUG=v8:5203

Review-Url: https://codereview.chromium.org/2251713002
Cr-Commit-Position: refs/heads/master@{#38897}
2016-08-25 10:25:12 +00:00
jochen
b79259f632 Finalizing parsing in a compile job should immediately report errors
When preparing compilation, we can't delay error reporting either.

Also put handles during internalization into a deferred handle scope.

BUG=v8:5215
R=marja@chromium.org,rmcilory@chromium.org

Review-Url: https://codereview.chromium.org/2268983002
Cr-Commit-Position: refs/heads/master@{#38817}
2016-08-23 12:10:55 +00:00
marja
f9d6076115 Cleanup: Move ParseInfo to a separate file.
This makes us able to get rid of dependencies to parser.h from places
which only need the ParseInfo, and also gets rid of the curious Parser
<-> Compiler circular dependency.

Also IWYUd where necessary.

BUG=

Review-Url: https://codereview.chromium.org/2268513002
Cr-Commit-Position: refs/heads/master@{#38777}
2016-08-22 11:33:58 +00:00
jochen
912577a3ef Reland "Hook up compiler dispatcher jobs to lazy parser."
Original issue description:
> The lazy parser actually parses eagerly. It's called lazy because it
> parses functions that were previously lazy parsed. D'uh.
>
> BUG=v8:5215
> R=marja@chromium.org
>
> Review-Url: https://codereview.chromium.org/2220463002
> Cr-Commit-Position: refs/heads/master@{#38375}

BUG=v8:5215
TBR=marja@chromium.org

Review-Url: https://codereview.chromium.org/2218033003
Cr-Commit-Position: refs/heads/master@{#38387}
2016-08-05 13:19:27 +00:00
machenbach
e0ac9a1e3c Revert of Hook up compiler dispatcher jobs to lazy parser. (patchset #3 id:40001 of https://codereview.chromium.org/2220463002/ )
Reason for revert:
Need to revert https://codereview.chromium.org/2216563003 - just reland rebased version

Original issue's description:
> Hook up compiler dispatcher jobs to lazy parser.
>
> The lazy parser actually parses eagerly. It's called lazy because it
> parses functions that were previously lazy parsed. D'uh.
>
> BUG=v8:5215
> R=marja@chromium.org
>
> Committed: https://crrev.com/255cc15f98507e2bba49574f4dc38c74deb0ca2c
> Cr-Commit-Position: refs/heads/master@{#38375}

TBR=marja@chromium.org,jochen@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:5215

Review-Url: https://codereview.chromium.org/2211393003
Cr-Commit-Position: refs/heads/master@{#38378}
2016-08-05 12:37:21 +00:00
jochen
255cc15f98 Hook up compiler dispatcher jobs to lazy parser.
The lazy parser actually parses eagerly. It's called lazy because it
parses functions that were previously lazy parsed. D'uh.

BUG=v8:5215
R=marja@chromium.org

Review-Url: https://codereview.chromium.org/2220463002
Cr-Commit-Position: refs/heads/master@{#38375}
2016-08-05 12:03:09 +00:00
jochen
7036d96b57 Add a mode to completely deserialize scope chains
This will allow for the background parser to parse inner functions

BUG=v8:5215
R=marja@chromium.org,verwaest@chromium.org

Review-Url: https://codereview.chromium.org/2198043002
Cr-Commit-Position: refs/heads/master@{#38291}
2016-08-03 13:31:04 +00:00
jochen
f22ef1207d Add parser finalization step
BUG=v8:5215
R=vogelheim@chromium.org,marja@chromium.org

Review-Url: https://codereview.chromium.org/2193813002
Cr-Commit-Position: refs/heads/master@{#38203}
2016-08-01 11:30:18 +00:00
jochen
cbcc231991 Clean up compiler dispatcher job a bit
BUG=v8:5215
R=vogelheim@chromium.org,marja@chromium.org

Review-Url: https://codereview.chromium.org/2197573002
Cr-Commit-Position: refs/heads/master@{#38174}
2016-07-29 10:56:58 +00:00
jochen
edd65cc428 Teach compiler jobs how to actually parse
BUG=v8:5215
R=marja@chromium.org,vogelheim@chromium.org

Review-Url: https://codereview.chromium.org/2190333002
Cr-Commit-Position: refs/heads/master@{#38170}
2016-07-29 10:09:26 +00:00
jochen
3ca98851df Add a prepare to parse step to CompilerDispatcherJob
R=marja@chromium.org
BUG=v8:5215

Review-Url: https://codereview.chromium.org/2191443003
Cr-Commit-Position: refs/heads/master@{#38114}
2016-07-28 07:49:17 +00:00
jochen
b5b9dd730a Introduce a holder for compile jobs
Next step will be to add methods for parsing and then compiling.

BUG=v8:5215
R=marja@chromium.org

Review-Url: https://codereview.chromium.org/2171323002
Cr-Commit-Position: refs/heads/master@{#37980}
2016-07-22 12:22:37 +00:00