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

Issue 2330473002: Class fields, part 3 (backends)

Created:
4 years, 3 months ago by bakkot
Modified:
4 years, 3 months ago
CC:
rmcilroy, v8-mips-ports_googlegroups.com, v8-ppc-ports_googlegroups.com, v8-reviews_googlegroups.com, v8-x87-ports_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Class fields, part 3 (backends) This is the final part of a WIP implementation of the stage-2 proposal to add fields to classes: https://github.com/tc39/proposal-class-public-fields See design doc: https://docs.google.com/document/d/1WRtNm3ZLNJT1WVr8aq4RJuByYgfuAFAhj20LwTW6JVE/ The feature is available behind --harmony-class-fields. This patch adds support for the feature to all backends except Crankshaft, which does not implement classes. The backend changes required are fairly small and identical across backends. It also adds tests, since with this patch the feature is functional. There are three things backends do in this patch: - assign the class being constructed to a hidden variable, so that static field initializers can have the correct home object and receiver (which is necessary if the static field initializers are called while the class is being created, instead of immediately after) - evaluate the (potentially computed) names of non-static fields and store those names in variables, to be referenced when instantiating the class - evaluate the initializers of static fields and define the corresponding property on the class to hold the resulting value. BUG=v8:5367

Patch Set 1 #

Patch Set 2 : clean up test #

Patch Set 3 : clean up test properly #

Total comments: 6

Patch Set 4 : comments #

Patch Set 5 : add test #

Patch Set 6 : rebase #

Patch Set 7 : arguments #

Total comments: 3

Patch Set 8 : bytecode test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1644 lines, -29 lines) Patch
M src/compiler/ast-graph-builder.cc View 1 2 3 3 chunks +49 lines, -1 line 0 comments Download
M src/full-codegen/arm/full-codegen-arm.cc View 1 2 3 2 chunks +29 lines, -2 lines 0 comments Download
M src/full-codegen/arm64/full-codegen-arm64.cc View 1 2 3 2 chunks +29 lines, -2 lines 0 comments Download
M src/full-codegen/full-codegen.cc View 1 2 3 1 chunk +14 lines, -0 lines 0 comments Download
M src/full-codegen/ia32/full-codegen-ia32.cc View 1 2 3 2 chunks +28 lines, -1 line 0 comments Download
M src/full-codegen/mips/full-codegen-mips.cc View 1 2 3 2 chunks +29 lines, -2 lines 0 comments Download
M src/full-codegen/mips64/full-codegen-mips64.cc View 1 2 3 2 chunks +29 lines, -2 lines 0 comments Download
M src/full-codegen/ppc/full-codegen-ppc.cc View 1 2 3 2 chunks +29 lines, -2 lines 0 comments Download
M src/full-codegen/s390/full-codegen-s390.cc View 1 2 3 2 chunks +29 lines, -2 lines 0 comments Download
M src/full-codegen/x64/full-codegen-x64.cc View 1 2 3 2 chunks +29 lines, -2 lines 0 comments Download
M src/full-codegen/x87/full-codegen-x87.cc View 1 2 3 2 chunks +28 lines, -1 line 0 comments Download
M src/interpreter/bytecode-generator.cc View 1 2 3 3 chunks +44 lines, -1 line 0 comments Download
M src/parsing/parser-base.h View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A test/cctest/interpreter/bytecode_expectations/ClassFields.golden View 1 2 3 4 5 6 7 1 chunk +239 lines, -0 lines 0 comments Download
M test/cctest/interpreter/generate-bytecode-expectations.cc View 1 2 3 4 5 6 7 9 chunks +11 lines, -0 lines 0 comments Download
M test/cctest/interpreter/test-bytecode-generator.cc View 1 2 3 4 5 6 7 1 chunk +27 lines, -0 lines 0 comments Download
A + test/mjsunit/harmony/class-fields-arguments.js View 1 chunk +7 lines, -9 lines 0 comments Download
A test/mjsunit/harmony/class-fields-async-syntax.js View 1 chunk +89 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/class-fields-attributes.js View 1 chunk +26 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/class-fields-evaluation-order.js View 1 chunk +104 lines, -0 lines 0 comments Download
A + test/mjsunit/harmony/class-fields-function-name-inference.js View 1 chunk +4 lines, -2 lines 0 comments Download
A test/mjsunit/harmony/class-fields-proxy.js View 1 2 3 4 1 chunk +54 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/class-fields-scoping.js View 1 2 1 chunk +314 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/class-fields-super.js View 1 chunk +147 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/class-fields-syntax.js View 1 chunk +163 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/class-fields-to-name.js View 1 chunk +41 lines, -0 lines 0 comments Download
A test/mjsunit/harmony/class-fields-visibility.js View 1 chunk +51 lines, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 49 (37 generated)
bakkot
PTAL, after previous two patches are done (or concurrently).
4 years, 3 months ago (2016-09-09 17:22:19 UTC) #3
Dan Ehrenberg
The mechanism here and the code implementing it seems reasonable to me, but better comments ...
4 years, 3 months ago (2016-09-10 04:06:54 UTC) #4
bakkot
> It'd also be nice if you could give an overview of the three things ...
4 years, 3 months ago (2016-09-12 23:05:15 UTC) #7
Dan Ehrenberg
lgtm
4 years, 3 months ago (2016-09-13 18:25:12 UTC) #8
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/2330473002/120001
4 years, 3 months ago (2016-09-16 01:22:18 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/24225)
4 years, 3 months ago (2016-09-16 01:26:28 UTC) #35
Dan Ehrenberg
Ping Benedikt, could you do a backend review?
4 years, 3 months ago (2016-09-16 01:31:13 UTC) #37
rmcilroy
https://codereview.chromium.org/2330473002/diff/120001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2330473002/diff/120001/src/interpreter/bytecode-generator.cc#newcode1584 src/interpreter/bytecode-generator.cc:1584: continue; Drive-by - could you add an example of ...
4 years, 3 months ago (2016-09-16 09:33:36 UTC) #39
bakkot
https://codereview.chromium.org/2330473002/diff/120001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2330473002/diff/120001/src/interpreter/bytecode-generator.cc#newcode1584 src/interpreter/bytecode-generator.cc:1584: continue; On 2016/09/16 at 09:33:35, rmcilroy wrote: > Drive-by ...
4 years, 3 months ago (2016-09-16 18:59:53 UTC) #40
rmcilroy
https://codereview.chromium.org/2330473002/diff/120001/src/interpreter/bytecode-generator.cc File src/interpreter/bytecode-generator.cc (right): https://codereview.chromium.org/2330473002/diff/120001/src/interpreter/bytecode-generator.cc#newcode1584 src/interpreter/bytecode-generator.cc:1584: continue; On 2016/09/16 18:59:53, bakkot wrote: > On 2016/09/16 ...
4 years, 3 months ago (2016-09-19 10:06:08 UTC) #41
Benedikt Meurer
LGTM (although I'm not an expert here). Adding Michi as reviewer for graph builder changes.
4 years, 3 months ago (2016-09-20 03:20:38 UTC) #44
Michael Starzinger
4 years, 3 months ago (2016-09-20 08:50:56 UTC) #45
LGTM. Thanks!

Powered by Google App Engine
This is Rietveld 408576698