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

Issue 9471010: Expand the instruction visitor to visit computations and values. (Closed)

Created:
8 years, 10 months ago by Kevin Millikin (Google)
Modified:
8 years, 9 months ago
Reviewers:
srdjan
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Expand the instruction visitor to visit computations and values. For compilation passes we will want a visitor that can reach computations and values, rather than virtual functions in the computation/value classes. Implement the visitor signature and double dispatching. Use it to remove the virtual Print functions. R=srdjan@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=4664

Patch Set 1 #

Total comments: 1

Patch Set 2 : Small cleanup of comments and identifier naming. #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+231 lines, -143 lines) Patch
M runtime/vm/flow_graph_builder.h View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 1 7 chunks +84 lines, -16 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.h View 2 chunks +13 lines, -5 lines 0 comments Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/intermediate_language.h View 1 13 chunks +118 lines, -56 lines 10 comments Download
M runtime/vm/intermediate_language.cc View 1 chunk +13 lines, -63 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Kevin Millikin (Google)
It is ambiguous whether we are visiting a Value as a Value or as a ...
8 years, 10 months ago (2012-02-27 11:52:27 UTC) #1
srdjan
LGTM with questions and comments http://codereview.chromium.org/9471010/diff/3001/runtime/vm/intermediate_language.h File runtime/vm/intermediate_language.h (right): http://codereview.chromium.org/9471010/diff/3001/runtime/vm/intermediate_language.h#newcode3 runtime/vm/intermediate_language.h:3: // BSD-style license that ...
8 years, 10 months ago (2012-02-27 22:53:10 UTC) #2
Kevin Millikin (Google)
8 years, 9 months ago (2012-02-28 08:54:23 UTC) #3
http://codereview.chromium.org/9471010/diff/3001/runtime/vm/intermediate_lang...
File runtime/vm/intermediate_language.h (right):

http://codereview.chromium.org/9471010/diff/3001/runtime/vm/intermediate_lang...
runtime/vm/intermediate_language.h:3: // BSD-style license that can be found in
the LICENSE file.
On 2012/02/27 22:53:10, srdjan wrote:
> Maybe now it is a good time to split Computations and Instructions in two
> different header files?

Sure, it's getting big enough.  I hesitated because of the naming issue: we
already have instructions.{h,cc}.

Instruction is such a juicy name for the IL instructions, but it makes sense for
machine instructions too.

Do you have any suggestions?

http://codereview.chromium.org/9471010/diff/3001/runtime/vm/intermediate_lang...
runtime/vm/intermediate_language.h:100: intptr_t index_;
On 2012/02/27 22:53:10, srdjan wrote:
> const ?

Yes, done.

http://codereview.chromium.org/9471010/diff/3001/runtime/vm/intermediate_lang...
runtime/vm/intermediate_language.h:121: 
On 2012/02/27 22:53:10, srdjan wrote:
> What additional value classes do you expect to come into the hierarchy? IMO,
the
> macros would be overkill for only two classes.

Definitely SSA phi values.  Possibly stack and context variable values, which
can be treated as values if the variables are definitely not assigned between a
definition and use.

I agree the macros look like overkill, and I won't complain if we decide to
remove them.  For now, I wanted a clear identification of what changes when we
add a new class.

http://codereview.chromium.org/9471010/diff/3001/runtime/vm/intermediate_lang...
runtime/vm/intermediate_language.h:146: : name_(name), arguments_(arguments) { }
On 2012/02/27 22:53:10, srdjan wrote:
> ASSERT(!arguments->IsEmpty())  // must have at least receiver.

OK.

http://codereview.chromium.org/9471010/diff/3001/runtime/vm/intermediate_lang...
runtime/vm/intermediate_language.h:479: class FlowGraphVisitor {
On 2012/02/27 22:53:10, srdjan wrote:
> Is this a ValueObject or ZoneAllocated?
> What is the advantage of merging Instruction and Computation visitors into
one?
> 
> Please add comment describing what this class does.

ValueObject base class added.

I don't think it makes sense to separate visiting of instruction and computation
at this point.  It seems like they're pretty tightly coupled  The instruction
visitor needs a computation visitor to drive it and there is some convenience
advantage to shared state in this case.

Comment added.

Powered by Google App Engine
This is Rietveld 408576698