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

Issue 1947403002: [interpreter] Introduce bytecode generation pipeline. (Closed)

Created:
4 years, 7 months ago by oth
Modified:
4 years, 7 months ago
CC:
v8-reviews_googlegroups.com, Michael Achenbach, rmcilroy, Michael Hablich
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[interpreter] Introduce bytecode generation pipeline. This change introduces a pipeline for the final stages of bytecode generation. The peephole optimizer is made distinct from the BytecodeArrayBuilder. A new BytecodeArrayWriter is responsible for writing bytecode. It also keeps track of the maximum register seen and offers a potentially smaller frame size. R=rmcilroy@chromium.org LOG=N BUG=v8:4280 Committed: https://crrev.com/02b7373ab135a516c4f553a2f553d086d4c12579 Cr-Commit-Position: refs/heads/master@{#36220}

Patch Set 1 #

Patch Set 2 : Attempt to fix compilation with gcc/msvc and introduce nop to simplify source positions in peephole… #

Total comments: 2

Patch Set 3 : Nits. #

Patch Set 4 : Address msvc complaint. #

Patch Set 5 : Fix return type of BytecodeSourceInfo::is_statement() #

Total comments: 20

Patch Set 6 : Incorporate review comments. #

Total comments: 52

Patch Set 7 : Stop emitting Nop's before forward branches. #

Patch Set 8 : Incorporate comments on patch set 6. #

Total comments: 28

Patch Set 9 : Additional tests. #

Patch Set 10 : Remove unreadable git cl formatting. #

Total comments: 6

Patch Set 11 : Incorporate review comments from rmcilroy on patchsets 8 & 10. #

Patch Set 12 : Rebase. #

Patch Set 13 : Missed review comment addressed. #

Patch Set 14 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2414 lines, -836 lines) Patch
M BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download
M src/compiler/bytecode-graph-builder.cc View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M src/interpreter/bytecode-array-builder.h View 1 2 3 4 5 6 7 8 9 10 10 chunks +20 lines, -32 lines 0 comments Download
M src/interpreter/bytecode-array-builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 50 chunks +236 lines, -441 lines 0 comments Download
M src/interpreter/bytecode-array-iterator.cc View 1 2 3 4 5 6 7 1 chunk +9 lines, -20 lines 0 comments Download
A src/interpreter/bytecode-array-writer.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +50 lines, -0 lines 0 comments Download
A src/interpreter/bytecode-array-writer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +103 lines, -0 lines 0 comments Download
M src/interpreter/bytecode-generator.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -0 lines 0 comments Download
A src/interpreter/bytecode-peephole-optimizer.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +58 lines, -0 lines 0 comments Download
A src/interpreter/bytecode-peephole-optimizer.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +173 lines, -0 lines 0 comments Download
A src/interpreter/bytecode-pipeline.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +138 lines, -0 lines 0 comments Download
A src/interpreter/bytecode-pipeline.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +162 lines, -0 lines 0 comments Download
M src/interpreter/bytecode-traits.h View 1 7 chunks +131 lines, -46 lines 0 comments Download
M src/interpreter/bytecodes.h View 1 2 3 4 5 6 7 9 chunks +56 lines, -10 lines 0 comments Download
M src/interpreter/bytecodes.cc View 1 2 3 4 5 6 7 7 chunks +171 lines, -16 lines 0 comments Download
M src/interpreter/interpreter.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +21 lines, -8 lines 0 comments Download
M src/interpreter/source-position-table.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +4 lines, -7 lines 0 comments Download
M src/interpreter/source-position-table.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +12 lines, -31 lines 0 comments Download
M src/log.cc View 1 2 3 4 5 6 7 1 chunk +8 lines, -5 lines 0 comments Download
M src/v8.gyp View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +6 lines, -0 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ClassDeclarations.golden View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Generators.golden View 1 2 3 4 5 6 11 chunks +13 lines, -18 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/LogicalExpressions.golden View 1 2 3 4 5 6 2 chunks +3 lines, -7 lines 0 comments Download
M test/unittests/interpreter/bytecode-array-builder-unittest.cc View 1 9 chunks +25 lines, -90 lines 0 comments Download
M test/unittests/interpreter/bytecode-array-iterator-unittest.cc View 7 chunks +60 lines, -0 lines 0 comments Download
A test/unittests/interpreter/bytecode-array-writer-unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +233 lines, -0 lines 0 comments Download
A test/unittests/interpreter/bytecode-peephole-optimizer-unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +359 lines, -0 lines 0 comments Download
A test/unittests/interpreter/bytecode-pipeline-unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +198 lines, -0 lines 0 comments Download
A test/unittests/interpreter/bytecode-utils.h View 1 2 3 4 5 6 7 8 1 chunk +37 lines, -0 lines 0 comments Download
M test/unittests/interpreter/bytecodes-unittest.cc View 1 2 3 4 5 6 7 8 4 chunks +104 lines, -96 lines 0 comments Download
M test/unittests/interpreter/source-position-table-unittest.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +8 lines, -8 lines 0 comments Download
M test/unittests/unittests.gyp View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 46 (16 generated)
oth
Ross, PTAL. This is already quite large and there are more tests to follow. A ...
4 years, 7 months ago (2016-05-05 15:03:06 UTC) #1
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1947403002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1947403002/1
4 years, 7 months ago (2016-05-05 15:06:32 UTC) #3
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_win_nosnap_shared_rel_ng on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_nosnap_shared_rel_ng/builds/1276)
4 years, 7 months ago (2016-05-05 15:11:28 UTC) #5
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1947403002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1947403002/20001
4 years, 7 months ago (2016-05-05 21:12:36 UTC) #7
oth
It struck that inserting NOPs simplifies the peephole optimizer and the interaction with source positions. ...
4 years, 7 months ago (2016-05-05 21:15:07 UTC) #8
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_win_nosnap_shared_rel_ng on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_nosnap_shared_rel_ng/builds/1286) v8_win_rel_ng on ...
4 years, 7 months ago (2016-05-05 21:17:06 UTC) #10
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1947403002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1947403002/60001
4 years, 7 months ago (2016-05-06 08:44:16 UTC) #12
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_win64_rel_ng on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win64_rel_ng/builds/6893)
4 years, 7 months ago (2016-05-06 08:51:50 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1947403002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1947403002/80001
4 years, 7 months ago (2016-05-06 09:59:26 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-06 10:29:17 UTC) #18
rmcilroy
Overall looks nice. I've got a couple of high-level comments. https://codereview.chromium.org/1947403002/diff/80001/src/interpreter/bytecode-peephole-optimizer.cc File src/interpreter/bytecode-peephole-optimizer.cc (right): https://codereview.chromium.org/1947403002/diff/80001/src/interpreter/bytecode-peephole-optimizer.cc#newcode72 ...
4 years, 7 months ago (2016-05-06 15:25:49 UTC) #19
oth
Thanks for the feedback. Incorporated nearly everything: i) Checking out the perf implications of stack ...
4 years, 7 months ago (2016-05-09 11:02:17 UTC) #20
oth
On 2016/05/09 11:02:17, oth wrote: > Thanks for the feedback. > > Incorporated nearly everything: ...
4 years, 7 months ago (2016-05-09 15:03:56 UTC) #21
oth
On 2016/05/09 15:03:56, oth wrote: > On 2016/05/09 11:02:17, oth wrote: > > Thanks for ...
4 years, 7 months ago (2016-05-09 15:44:09 UTC) #22
rmcilroy
A few more comments, mostly nits, looks great overall. https://codereview.chromium.org/1947403002/diff/100001/src/interpreter/bytecode-array-builder.cc File src/interpreter/bytecode-array-builder.cc (right): https://codereview.chromium.org/1947403002/diff/100001/src/interpreter/bytecode-array-builder.cc#newcode113 src/interpreter/bytecode-array-builder.cc:113: ...
4 years, 7 months ago (2016-05-10 11:14:10 UTC) #23
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1947403002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1947403002/140001
4 years, 7 months ago (2016-05-11 13:14:40 UTC) #25
oth
Thanks for the feedback, nearly everything incorporated. No rush to make another pass just now ...
4 years, 7 months ago (2016-05-11 13:17:31 UTC) #26
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-11 13:44:58 UTC) #28
oth
Yang, PTAL at source-position-table.{h,cc}. The filtering of source positions is moved into BytecodeSourceInfo::Update() in bytecode-node.h. ...
4 years, 7 months ago (2016-05-12 11:41:05 UTC) #30
Yang
lgtm
4 years, 7 months ago (2016-05-12 12:03:52 UTC) #31
rmcilroy
LGTM with some last nits. https://codereview.chromium.org/1947403002/diff/100001/src/interpreter/bytecode-array-writer.cc File src/interpreter/bytecode-array-writer.cc (right): https://codereview.chromium.org/1947403002/diff/100001/src/interpreter/bytecode-array-writer.cc#newcode105 src/interpreter/bytecode-array-writer.cc:105: int BytecodeArrayWriter::GetMeasuredFrameSize() { On ...
4 years, 7 months ago (2016-05-12 12:15:14 UTC) #32
oth
Thanks, all done. https://codereview.chromium.org/1947403002/diff/140001/src/interpreter/bytecode-array-builder.cc File src/interpreter/bytecode-array-builder.cc (right): https://codereview.chromium.org/1947403002/diff/140001/src/interpreter/bytecode-array-builder.cc#newcode114 src/interpreter/bytecode-array-builder.cc:114: } On 2016/05/12 12:15:13, rmcilroy wrote: ...
4 years, 7 months ago (2016-05-12 14:59:53 UTC) #33
rmcilroy
https://codereview.chromium.org/1947403002/diff/100001/src/interpreter/bytecode-array-writer.cc File src/interpreter/bytecode-array-writer.cc (right): https://codereview.chromium.org/1947403002/diff/100001/src/interpreter/bytecode-array-writer.cc#newcode105 src/interpreter/bytecode-array-writer.cc:105: int BytecodeArrayWriter::GetMeasuredFrameSize() { On 2016/05/12 12:15:13, rmcilroy wrote: > ...
4 years, 7 months ago (2016-05-12 15:19:47 UTC) #34
oth
On 2016/05/12 15:19:47, rmcilroy wrote: > https://codereview.chromium.org/1947403002/diff/100001/src/interpreter/bytecode-array-writer.cc > File src/interpreter/bytecode-array-writer.cc (right): > > https://codereview.chromium.org/1947403002/diff/100001/src/interpreter/bytecode-array-writer.cc#newcode105 > ...
4 years, 7 months ago (2016-05-12 15:35:28 UTC) #35
oth
Thanks, done. https://codereview.chromium.org/1947403002/diff/100001/src/interpreter/bytecode-array-writer.cc File src/interpreter/bytecode-array-writer.cc (right): https://codereview.chromium.org/1947403002/diff/100001/src/interpreter/bytecode-array-writer.cc#newcode105 src/interpreter/bytecode-array-writer.cc:105: int BytecodeArrayWriter::GetMeasuredFrameSize() { On 2016/05/12 15:19:47, rmcilroy ...
4 years, 7 months ago (2016-05-12 15:44:31 UTC) #36
Michael Starzinger
LGTM on "compiler", I did't look at the rest (yet). Let me know if I ...
4 years, 7 months ago (2016-05-12 16:06:46 UTC) #37
oth
On 2016/05/12 16:06:46, Michael Starzinger wrote: > LGTM on "compiler", I did't look at the ...
4 years, 7 months ago (2016-05-12 18:12:53 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1947403002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1947403002/260001
4 years, 7 months ago (2016-05-12 18:46:08 UTC) #42
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 7 months ago (2016-05-12 19:18:17 UTC) #44
commit-bot: I haz the power
4 years, 7 months ago (2016-05-12 19:20:16 UTC) #46
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/02b7373ab135a516c4f553a2f553d086d4c12579
Cr-Commit-Position: refs/heads/master@{#36220}

Powered by Google App Engine
This is Rietveld 408576698