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 2894293003: Save/restore only live registers in the generator suspend/resume. (Closed)

Created:
3 years, 7 months ago by Jarin
Modified:
3 years, 6 months ago
Reviewers:
neis, rmcilroy
CC:
v8-reviews_googlegroups.com, rmcilroy, adamk
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

This is a first step towards reducing the number of stores/loads when suspending/resuming a generator. Unfortunately, even for an empty generator, we still use 8 register for various things (try-finally, copies of generator object, parser-introduced temporaries). I will try to get rid of these in separate CLs. Changes: - SuspendGenerator bytecode now takes register list to save. - ResumeGenerator was split into two bytecodes: * Resume generator reads the state out and marks the generator as 'executing'. * RestoreGeneratorRegisters reloads the registers from the generator. + this required adding support for output register list. - Introduced generator_object_ register in the bytecode generator. * in subsequent CLs, I will make better use of it, the goal is to get rid if the .generator_object local variable. - Taught register optimizer to flush unassigned registers. BUG=v8:6379 Review-Url: https://codereview.chromium.org/2894293003 Cr-Commit-Position: refs/heads/master@{#45675} Committed: https://chromium.googlesource.com/v8/v8/+/f0645612c42d170b449ae65205fdcbf2c48ae57b

Patch Set 1 #

Patch Set 2 : Fix loop variable assignment to account for restore-generator-registers #

Patch Set 3 : Fix and rebaseline tests #

Patch Set 4 : Actual test fix #

Patch Set 5 : Explicit register lists for suspend/resume #

Patch Set 6 : Fix typo #

Patch Set 7 : Fix register range for suspend #

Patch Set 8 : Fix #

Patch Set 9 : Fix comments #

Total comments: 24

Patch Set 10 : Address review comments. #

Total comments: 8

Patch Set 11 : Address more comments #

Total comments: 1

Patch Set 12 : Tweak #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2105 lines, -1900 lines) Patch
M src/compiler/bytecode-analysis.h View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M src/compiler/bytecode-analysis.cc View 1 2 3 4 3 chunks +28 lines, -25 lines 0 comments Download
M src/compiler/bytecode-graph-builder.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +24 lines, -9 lines 0 comments Download
M src/compiler/js-operator.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download
M src/interpreter/bytecode-array-builder.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +4 lines, -1 line 0 comments Download
M src/interpreter/bytecode-array-builder.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +20 lines, -4 lines 0 comments Download
M src/interpreter/bytecode-decoder.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M src/interpreter/bytecode-generator.h View 1 2 3 4 5 6 2 chunks +5 lines, -2 lines 0 comments Download
M src/interpreter/bytecode-generator.cc View 1 2 3 4 5 6 7 8 9 10 8 chunks +20 lines, -12 lines 0 comments Download
M src/interpreter/bytecode-operands.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M src/interpreter/bytecode-register-optimizer.h View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M src/interpreter/bytecode-register-optimizer.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -1 line 0 comments Download
M src/interpreter/bytecodes.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +5 lines, -2 lines 0 comments Download
M src/interpreter/interpreter-assembler.h View 1 2 3 4 2 chunks +7 lines, -5 lines 0 comments Download
M src/interpreter/interpreter-assembler.cc View 1 2 3 4 5 6 7 2 chunks +18 lines, -16 lines 0 comments Download
M src/interpreter/interpreter-generator.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +36 lines, -11 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ForAwaitOf.golden View 1 2 3 4 5 6 7 8 9 10 18 chunks +553 lines, -535 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ForOfLoop.golden View 1 2 3 4 5 6 7 8 9 10 12 chunks +326 lines, -316 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Generators.golden View 1 2 3 4 5 6 7 8 9 10 12 chunks +342 lines, -327 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Modules.golden View 1 2 3 4 5 6 7 8 9 10 15 chunks +460 lines, -427 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/StandardForLoop.golden View 1 2 3 4 5 6 7 8 9 10 6 chunks +211 lines, -201 lines 0 comments Download
A test/mjsunit/harmony/generators-reduced.js View 1 chunk +15 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/regress-generators-resume.js View 1 chunk +18 lines, -0 lines 0 comments Download
M test/unittests/interpreter/bytecode-array-builder-unittest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -1 line 0 comments Download
M test/unittests/interpreter/interpreter-assembler-unittest.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 50 (33 generated)
Jarin
Could you take a look, please?
3 years, 6 months ago (2017-06-01 09:38:37 UTC) #21
rmcilroy
Overall looks good. A couple of comments and suggestions. https://codereview.chromium.org/2894293003/diff/160001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2894293003/diff/160001/src/interpreter/bytecode-generator.cc#newcode988 src/interpreter/bytecode-generator.cc:988: ...
3 years, 6 months ago (2017-06-01 10:44:44 UTC) #23
Jarin
https://codereview.chromium.org/2894293003/diff/160001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2894293003/diff/160001/src/interpreter/bytecode-generator.cc#newcode988 src/interpreter/bytecode-generator.cc:988: .ResumeGenerator(generator_object_) On 2017/06/01 10:44:44, rmcilroy wrote: > How about ...
3 years, 6 months ago (2017-06-01 12:48:22 UTC) #26
rmcilroy
https://codereview.chromium.org/2894293003/diff/160001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2894293003/diff/160001/src/interpreter/bytecode-generator.cc#newcode988 src/interpreter/bytecode-generator.cc:988: .ResumeGenerator(generator_object_) On 2017/06/01 12:48:22, Jarin wrote: > On 2017/06/01 ...
3 years, 6 months ago (2017-06-01 13:20:23 UTC) #29
neis
https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc File src/interpreter/interpreter-generator.cc (right): https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc#newcode3697 src/interpreter/interpreter-generator.cc:3697: // Maybe we can rename this to RestoreGeneratorState. https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc#newcode3733 ...
3 years, 6 months ago (2017-06-01 13:34:37 UTC) #30
neis
Other than that, lgtm!
3 years, 6 months ago (2017-06-01 13:36:35 UTC) #31
rmcilroy
https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc File src/interpreter/interpreter-generator.cc (right): https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc#newcode3697 src/interpreter/interpreter-generator.cc:3697: // On 2017/06/01 13:34:37, neis wrote: > Maybe we ...
3 years, 6 months ago (2017-06-01 14:04:20 UTC) #32
rmcilroy
https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc File src/interpreter/interpreter-generator.cc (right): https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc#newcode3733 src/interpreter/interpreter-generator.cc:3733: On 2017/06/01 13:34:37, neis wrote: > You're still writing ...
3 years, 6 months ago (2017-06-01 14:05:00 UTC) #33
adamk
Re: reducing register use, I have a WIP CL to slim down register use in ...
3 years, 6 months ago (2017-06-01 17:36:18 UTC) #34
Jarin
Could you take another look, please? https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc File src/interpreter/interpreter-generator.cc (right): https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc#newcode3697 src/interpreter/interpreter-generator.cc:3697: // On 2017/06/01 ...
3 years, 6 months ago (2017-06-02 09:35:50 UTC) #37
rmcilroy
https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc File src/interpreter/interpreter-generator.cc (right): https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc#newcode3697 src/interpreter/interpreter-generator.cc:3697: // On 2017/06/02 09:35:49, Jarin wrote: > On 2017/06/01 ...
3 years, 6 months ago (2017-06-02 09:42:06 UTC) #38
Jarin
On 2017/06/02 09:42:06, rmcilroy wrote: > https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc > File src/interpreter/interpreter-generator.cc (right): > > https://codereview.chromium.org/2894293003/diff/180001/src/interpreter/interpreter-generator.cc#newcode3697 > ...
3 years, 6 months ago (2017-06-02 09:45:55 UTC) #39
rmcilroy
LGTM, thanks.
3 years, 6 months ago (2017-06-02 10:00:29 UTC) #40
neis
https://codereview.chromium.org/2894293003/diff/200001/src/isolate.cc File src/isolate.cc (right): https://codereview.chromium.org/2894293003/diff/200001/src/isolate.cc#newcode1321 src/isolate.cc:1321: CHECK(js_frame->ReadInterpreterRegister(context_reg)->IsContext()); Maybe remove this again, I guess it's a ...
3 years, 6 months ago (2017-06-02 10:04:40 UTC) #43
neis
On 2017/06/02 09:42:06, rmcilroy wrote: > I'm not quite sure what you mean here - ...
3 years, 6 months ago (2017-06-02 10:05:28 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2894293003/220001
3 years, 6 months ago (2017-06-02 10:24:48 UTC) #47
commit-bot: I haz the power
3 years, 6 months ago (2017-06-02 11:55:55 UTC) #50
Message was sent while issue was closed.
Committed patchset #12 (id:220001) as
https://chromium.googlesource.com/v8/v8/+/f0645612c42d170b449ae65205fdcbf2c48...

Powered by Google App Engine
This is Rietveld 408576698