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

Issue 2581683003: Introduce {ConstantElementsPair} struct for type safety. (Closed)

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

Description

Introduce {ConstantElementsPair} struct for type safety. This introduces an explicit struct for the communication channel between the {ArrayLiteral} AST node and the corresponding runtime methods. Those methods take a pair of {ElementsKind} as well as an array (can either be a FixedArray or a FixedDoubleArray) of constant values. For bonus points it also reduces the size of the involved heap object by one word (i.e. length field of FixedArray not needed anymore). R=mvstanton@chromium.org Review-Url: https://codereview.chromium.org/2581683003 Cr-Commit-Position: refs/heads/master@{#41752} Committed: https://chromium.googlesource.com/v8/v8/+/92b370ee642743d4d795536900da7715c73152c9

Patch Set 1 #

Patch Set 2 : Fix compilation on some ports. #

Patch Set 3 : Re-cemment bytecode tests. #

Total comments: 2

Patch Set 4 : Addressed comments. #

Patch Set 5 : Rebased. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+141 lines, -83 lines) Patch
M include/v8.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/ast/ast.h View 1 2 3 4 2 chunks +5 lines, -5 lines 0 comments Download
M src/ast/ast.cc View 1 2 3 4 1 chunk +3 lines, -5 lines 0 comments Download
M src/ast/ast-types.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M src/ast/compile-time-value.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/ast/compile-time-value.cc View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/compiler/bytecode-graph-builder.cc View 1 2 3 4 2 chunks +4 lines, -4 lines 0 comments Download
M src/compiler/js-operator.h View 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/js-operator.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M src/compiler/types.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M src/crankshaft/hydrogen.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M src/factory.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 4 1 chunk +9 lines, -0 lines 0 comments Download
M src/full-codegen/arm/full-codegen-arm.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M src/full-codegen/arm64/full-codegen-arm64.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/ia32/full-codegen-ia32.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/mips/full-codegen-mips.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/mips64/full-codegen-mips64.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/ppc/full-codegen-ppc.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M src/full-codegen/s390/full-codegen-s390.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M src/full-codegen/x64/full-codegen-x64.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/full-codegen/x87/full-codegen-x87.cc View 1 chunk +1 line, -1 line 0 comments Download
M src/interpreter/bytecode-array-builder.h View 1 chunk +3 lines, -2 lines 0 comments Download
M src/interpreter/bytecode-array-builder.cc View 1 chunk +2 lines, -1 line 0 comments Download
M src/objects.h View 1 2 3 4 4 chunks +25 lines, -1 line 0 comments Download
M src/objects-debug.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M src/objects-inl.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M src/objects-printer.cc View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M src/runtime/runtime-literals.cc View 7 chunks +21 lines, -17 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ArrayLiterals.golden View 1 2 4 chunks +6 lines, -6 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ArrayLiteralsWide.golden View 1 2 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/interpreter/bytecode_expectations/CallRuntime.golden View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/interpreter/bytecode_expectations/CountOperators.golden View 1 2 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ForIn.golden View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/ForOf.golden View 1 2 3 4 3 chunks +3 lines, -3 lines 0 comments Download
M test/cctest/interpreter/bytecode_expectations/Generators.golden View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M test/cctest/interpreter/bytecode_expectations/SuperCallAndSpread.golden View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M test/unittests/interpreter/bytecode-array-builder-unittest.cc View 2 chunks +9 lines, -4 lines 0 comments Download

Messages

Total messages: 40 (30 generated)
Michael Starzinger
As for motivation, this is to avoid bugs like these: https://codereview.chromium.org/2542633002/
4 years ago (2016-12-15 12:25:25 UTC) #3
mvstanton
LGTM, just one nit. Thanks for this cleanup! https://codereview.chromium.org/2581683003/diff/40001/src/objects-printer.cc File src/objects-printer.cc (right): https://codereview.chromium.org/2581683003/diff/40001/src/objects-printer.cc#newcode1315 src/objects-printer.cc:1315: HeapObject::PrintHeader(os, ...
4 years ago (2016-12-16 09:10:18 UTC) #14
Michael Starzinger
Thanks! Comments addressed. Landing now-ish. https://codereview.chromium.org/2581683003/diff/40001/src/objects-printer.cc File src/objects-printer.cc (right): https://codereview.chromium.org/2581683003/diff/40001/src/objects-printer.cc#newcode1315 src/objects-printer.cc:1315: HeapObject::PrintHeader(os, "ContstantElementsPair"); On 2016/12/16 ...
4 years ago (2016-12-16 09:19:02 UTC) #17
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/2581683003/60001
4 years ago (2016-12-16 10:03:16 UTC) #22
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/30765)
4 years ago (2016-12-16 10:06:46 UTC) #24
Toon Verwaest
hydrogen.cc lgtm
4 years ago (2016-12-16 10:20:06 UTC) #26
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/2581683003/60001
4 years ago (2016-12-16 10:21:45 UTC) #28
commit-bot: I haz the power
Failed to apply patch for src/objects-inl.h: While running git apply --index -p1; error: patch failed: ...
4 years ago (2016-12-16 10:23:30 UTC) #30
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/2581683003/70001
4 years ago (2016-12-16 10:55:06 UTC) #37
commit-bot: I haz the power
4 years ago (2016-12-16 10:57:15 UTC) #40
Message was sent while issue was closed.
Committed patchset #5 (id:70001) as
https://chromium.googlesource.com/v8/v8/+/92b370ee642743d4d795536900da7715c73...

Powered by Google App Engine
This is Rietveld 408576698