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

Issue 2142233003: Templatize AstVisitor with its subclass (Closed)

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

Description

Templatize AstVisitor with its subclass This replaces the vtable on AstNode with a NodeType tag. The visitors replace double dispatch with a single switch over the NodeType. For now, visitors with subclasses still have virtual methods themselves. We should probably specialize them later as well. The uint8_t NodeType allows us to better pack memory, saving 8-16 bytes on many AST nodes (with additional packing that I'll do in a follow-up CL) BUG= Committed: https://crrev.com/ebf166df3f34a904c2261e618a2e51afc4613445 Cr-Commit-Position: refs/heads/master@{#37788}

Patch Set 1 #

Total comments: 23

Patch Set 2 : Rebase #

Patch Set 3 : Addressed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+303 lines, -315 lines) Patch
M src/asmjs/asm-wasm-builder.cc View 1 28 chunks +52 lines, -65 lines 0 comments Download
M src/ast/ast.h View 1 2 64 chunks +158 lines, -111 lines 0 comments Download
M src/ast/ast.cc View 1 7 chunks +4 lines, -47 lines 0 comments Download
M src/ast/ast-expression-rewriter.h View 1 2 2 chunks +10 lines, -8 lines 0 comments Download
M src/ast/ast-literal-reindexer.h View 2 chunks +6 lines, -7 lines 0 comments Download
M src/ast/ast-literal-reindexer.cc View 1 chunk +1 line, -4 lines 0 comments Download
M src/ast/ast-numbering.cc View 1 3 chunks +5 lines, -6 lines 0 comments Download
M src/ast/prettyprinter.h View 1 2 4 chunks +7 lines, -8 lines 0 comments Download
M src/compiler/ast-graph-builder.h View 1 2 2 chunks +6 lines, -3 lines 0 comments Download
M src/compiler/ast-graph-builder.cc View 1 5 chunks +5 lines, -5 lines 0 comments Download
M src/compiler/ast-loop-assignment-analyzer.h View 1 chunk +3 lines, -2 lines 0 comments Download
M src/crankshaft/hydrogen.h View 1 2 4 chunks +8 lines, -6 lines 0 comments Download
M src/crankshaft/hydrogen.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M src/crankshaft/typing.h View 2 chunks +4 lines, -4 lines 0 comments Download
M src/full-codegen/full-codegen.h View 1 3 chunks +3 lines, -3 lines 0 comments Download
M src/full-codegen/full-codegen.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M src/interpreter/bytecode-generator.h View 1 1 chunk +4 lines, -4 lines 0 comments Download
M src/parsing/parser.h View 5 chunks +9 lines, -8 lines 0 comments Download
M src/parsing/parser.cc View 1 2 chunks +6 lines, -7 lines 0 comments Download
M src/parsing/parser-base.h View 1 2 chunks +2 lines, -2 lines 0 comments Download
M src/parsing/pattern-rewriter.cc View 1 2 chunks +1 line, -3 lines 0 comments Download
M src/parsing/preparser.h View 1 1 chunk +5 lines, -6 lines 0 comments Download
M src/parsing/rewriter.cc View 3 chunks +2 lines, -4 lines 0 comments Download

Messages

Total messages: 19 (9 generated)
Toon Verwaest
ptal. Depends on https://codereview.chromium.org/2126233002/ vogelheim: ptal at parser
4 years, 5 months ago (2016-07-13 16:40:00 UTC) #2
vogelheim
lgtm (for src/parsing/*, and non-OWNER-lgtm for anything else, modulo some nitpicks.) https://codereview.chromium.org/2142233003/diff/40001/src/ast/ast.h File src/ast/ast.h (right): ...
4 years, 5 months ago (2016-07-14 11:27:35 UTC) #6
Michael Starzinger
LGTM from my end. Modulo Daniel's comments, which all make sense. I looked at everything ...
4 years, 5 months ago (2016-07-14 13:02:45 UTC) #7
Igor Sheludko
lgtm modulo nits: https://codereview.chromium.org/2142233003/diff/40001/src/ast/ast-expression-rewriter.h File src/ast/ast-expression-rewriter.h (right): https://codereview.chromium.org/2142233003/diff/40001/src/ast/ast-expression-rewriter.h#newcode20 src/ast/ast-expression-rewriter.h:20: class AstExpressionRewriter : public AstVisitor<AstExpressionRewriter> { ...
4 years, 5 months ago (2016-07-14 16:39:54 UTC) #8
Toon Verwaest
Addressed comments. @ahaas: ptal at wasm-related changes. https://codereview.chromium.org/2142233003/diff/40001/src/ast/ast-expression-rewriter.h File src/ast/ast-expression-rewriter.h (right): https://codereview.chromium.org/2142233003/diff/40001/src/ast/ast-expression-rewriter.h#newcode20 src/ast/ast-expression-rewriter.h:20: class AstExpressionRewriter ...
4 years, 5 months ago (2016-07-15 07:07:20 UTC) #10
Igor Sheludko
lgtm
4 years, 5 months ago (2016-07-15 07:12:11 UTC) #11
ahaas
On 2016/07/15 at 07:12:11, ishell wrote: > lgtm wasm lgtm
4 years, 5 months ago (2016-07-15 07:28:10 UTC) #12
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/2142233003/80001
4 years, 5 months ago (2016-07-15 07:31:48 UTC) #15
commit-bot: I haz the power
Committed patchset #3 (id:80001)
4 years, 5 months ago (2016-07-15 07:56:16 UTC) #17
commit-bot: I haz the power
4 years, 5 months ago (2016-07-15 07:58:21 UTC) #19
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/ebf166df3f34a904c2261e618a2e51afc4613445
Cr-Commit-Position: refs/heads/master@{#37788}

Powered by Google App Engine
This is Rietveld 408576698