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

Issue 1266713004: [Intepreter] Addition of BytecodeArrayBuilder and accumulator based bytecodes. (Closed)

Created:
5 years, 4 months ago by oth
Modified:
5 years, 4 months ago
Reviewers:
picksi, rmcilroy
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[Intepreter] BytecodeArrayBuilder and accumulator based bytecodes. The BytecodeArrayBuilder has responsibility for emitting the BytecodeArray. It will be used by the AST walker. Bytecode now uses an accumulator plus registers rather being pure register based. Update BytecodeArray::Disassemble to print operand information. BUG=v8:4280 LOG=N Committed: https://crrev.com/6ab1f70e12d5a8d44a5e3df3960899f9265558a2 Cr-Commit-Position: refs/heads/master@{#29970}

Patch Set 1 #

Patch Set 2 : Tweak BytecodeArray::Disassemble(). #

Total comments: 30

Patch Set 3 : Move generator to a separate CL and patch set 1 comments. #

Total comments: 18

Patch Set 4 : Incorporate patch set 3 comments. #

Patch Set 5 : Add test for BytecodeArrayBuilder, fix initialization bug, and change temporary register api to sco… #

Patch Set 6 : Rebase and fix FrameSizesLookGood. #

Patch Set 7 : Fix MSVC/gcc-pedantic compilation. #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+571 lines, -15 lines) Patch
A src/interpreter/bytecode-array-builder.h View 1 2 3 4 1 chunk +97 lines, -0 lines 0 comments Download
A src/interpreter/bytecode-array-builder.cc View 1 2 3 4 5 6 1 chunk +220 lines, -0 lines 4 comments Download
M src/interpreter/bytecodes.h View 1 2 3 4 5 1 chunk +22 lines, -3 lines 0 comments Download
M src/interpreter/interpreter.cc View 1 2 3 1 chunk +96 lines, -10 lines 0 comments Download
M src/objects.cc View 1 2 3 4 5 2 chunks +21 lines, -2 lines 4 comments Download
M test/cctest/cctest.gyp View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A test/cctest/interpreter/test-bytecode-array-builder.cc View 1 2 3 4 5 1 chunk +112 lines, -0 lines 0 comments Download
M tools/gyp/v8.gyp View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 30 (12 generated)
oth
Ross, just sharing progress. Needs tests. Feedback appreciated. Thanks.
5 years, 4 months ago (2015-07-30 09:00:13 UTC) #2
rmcilroy
Some random comment, only looked at Bytecode emitter so far. https://codereview.chromium.org/1266713004/diff/20001/src/interpreter/bytecode-array-builder.cc File src/interpreter/bytecode-array-builder.cc (right): https://codereview.chromium.org/1266713004/diff/20001/src/interpreter/bytecode-array-builder.cc#newcode6 ...
5 years, 4 months ago (2015-07-30 10:12:25 UTC) #3
oth
Thanks, good feedback as usual. https://codereview.chromium.org/1266713004/diff/20001/src/interpreter/bytecode-array-builder.cc File src/interpreter/bytecode-array-builder.cc (right): https://codereview.chromium.org/1266713004/diff/20001/src/interpreter/bytecode-array-builder.cc#newcode6 src/interpreter/bytecode-array-builder.cc:6: #include "src/interpreter/bytecode-array-builder.h" On 2015/07/30 ...
5 years, 4 months ago (2015-07-30 15:38:43 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1266713004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1266713004/40001
5 years, 4 months ago (2015-07-30 15:47:31 UTC) #6
commit-bot: I haz the power
Dry run: No L-G-T-M from a valid reviewer yet. Only full committers are accepted. Even ...
5 years, 4 months ago (2015-07-30 15:47:32 UTC) #8
rmcilroy
Also: - Update title to mention this also adds a BytecodeArrayBuilder - Update description to ...
5 years, 4 months ago (2015-07-31 09:56:19 UTC) #9
oth
Thanks! All incorporated. Tests to follow on this CL before committing. I should have updated ...
5 years, 4 months ago (2015-07-31 11:20:59 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/1266713004/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1266713004/80001
5 years, 4 months ago (2015-08-01 06:59:26 UTC) #12
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux_gcc_compile_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_gcc_compile_rel/builds/4945)
5 years, 4 months ago (2015-08-01 07:03:51 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/1266713004/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1266713004/100001
5 years, 4 months ago (2015-08-03 09:00:22 UTC) #16
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_linux_gcc_compile_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_gcc_compile_rel/builds/4965)
5 years, 4 months ago (2015-08-03 09:04:44 UTC) #18
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1266713004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1266713004/120001
5 years, 4 months ago (2015-08-03 09:22:43 UTC) #20
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 4 months ago (2015-08-03 09:47:43 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1266713004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1266713004/120001
5 years, 4 months ago (2015-08-03 09:59:12 UTC) #25
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 4 months ago (2015-08-03 10:42:22 UTC) #26
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/6ab1f70e12d5a8d44a5e3df3960899f9265558a2 Cr-Commit-Position: refs/heads/master@{#29970}
5 years, 4 months ago (2015-08-03 10:42:37 UTC) #27
picksi
I missed the boat a bit a bit (as the code has landed!)... but I ...
5 years, 4 months ago (2015-08-03 11:06:01 UTC) #29
oth
5 years, 4 months ago (2015-08-03 15:39:59 UTC) #30
Message was sent while issue was closed.
Thanks, have put changes into: 

https://codereview.chromium.org/1259193004

https://codereview.chromium.org/1266713004/diff/120001/src/interpreter/byteco...
File src/interpreter/bytecode-array-builder.cc (right):

https://codereview.chromium.org/1266713004/diff/120001/src/interpreter/byteco...
src/interpreter/bytecode-array-builder.cc:147:
DCHECK_EQ(Bytecodes::NumberOfOperands(bytecode), 3);
On 2015/08/03 11:06:01, picksi wrote:
> This function does a DCHECK_EQ, the following functions use DCHECK, is this
> intentional?

Fixed, thanks!

https://codereview.chromium.org/1266713004/diff/120001/src/interpreter/byteco...
src/interpreter/bytecode-array-builder.cc:196: return static_cast<Bytecode>(-1);
On 2015/08/03 11:06:01, picksi wrote:
> Should we have an error ByteCode that is -1, instead of casting it here?

In this instance, it's not recoverable error. The failure mode of
UNIMPLEMENTED() is a fatal which makes the source easy to find. There are more
operands to come here.

The test for the BytecodeArrayBuilder checks all bytecodes can be generated by
the builder. A function in the builder generating an invalid bytecode would
probably get used.

https://codereview.chromium.org/1266713004/diff/120001/src/objects.cc
File src/objects.cc (right):

https://codereview.chromium.org/1266713004/diff/120001/src/objects.cc#newcode...
src/objects.cc:11614: int bytes = 0;
On 2015/08/03 11:06:01, picksi wrote:
> Can we name 'bytes' to say what this is (the size of a bytecode+params, the
size
> of a function?)? It is not clear!

Reworked in https://codereview.chromium.org/1259193004

https://codereview.chromium.org/1266713004/diff/120001/src/objects.cc#newcode...
src/objects.cc:11628: for (int j = 1; j < bytes; j++) {
On 2015/08/03 11:06:01, picksi wrote:
> Should this for-loop be pulled out into a separate function? It looks to be
> conceptually at a lower level (disassembling a single instruction?).
> 
> Also, the value of 'j' is used as j-1, j and j+1. Is there a way to rework
this
> to not need some many variations!

Reworked in https://codereview.chromium.org/1259193004.

Powered by Google App Engine
This is Rietveld 408576698