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

Issue 165056: Add support for (some) assignment expressions to the CFG builder and... (Closed)

Created:
11 years, 4 months ago by Kevin Millikin (Chromium)
Modified:
9 years, 7 months ago
Reviewers:
William Hesse
CC:
v8-dev
Visibility:
Public.

Description

Add support for (some) assignment expressions to the CFG builder and fast-mode compiler. 1. We avoid generating a useless temporary for assignments with nontrivial right-hand sides. Instead of translating id = expr into: ... tmp = <last expr instruction> id = tmp we generate directly ... id = <last expr instruction> by passing a data destination ('hint') down the AST. The semantics is to use the destination as a result location if a temp is needed. It may be ignored. NULL indicates I don't care and you should generate a temp. 2. We correctly handle assignments as subexpressions. When building the CFG for an expression we accumulate the assigned variables and we emit a move to a fresh temporary if a value in a variable is in jeopardy of being overwritten. Committed: http://code.google.com/p/v8/source/detail?r=2643

Patch Set 1 #

Total comments: 4

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+449 lines, -125 lines) Patch
M src/arm/cfg-arm.cc View 6 chunks +58 lines, -12 lines 0 comments Download
M src/cfg.h View 1 22 chunks +154 lines, -41 lines 0 comments Download
M src/cfg.cc View 14 chunks +115 lines, -46 lines 0 comments Download
M src/ia32/cfg-ia32.cc View 6 chunks +61 lines, -13 lines 0 comments Download
M src/x64/cfg-x64.cc View 6 chunks +61 lines, -13 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Kevin Millikin (Chromium)
A bunch of identifiers have been renamed. Reitveld is flaky right now so I'm not ...
11 years, 4 months ago (2009-08-06 14:47:03 UTC) #1
William Hesse
LGTM. http://codereview.chromium.org/165056/diff/1/4 File src/cfg.cc (right): http://codereview.chromium.org/165056/diff/1/4#newcode63 Line 63: if (fun->scope()->num_stack_slots() > kPointerSize) { times kBitsPerByte. ...
11 years, 4 months ago (2009-08-06 15:37:44 UTC) #2
Kevin Millikin (Chromium)
11 years, 4 months ago (2009-08-06 16:58:19 UTC) #3
http://codereview.chromium.org/165056/diff/1/4
File src/cfg.cc (right):

http://codereview.chromium.org/165056/diff/1/4#newcode63
Line 63: if (fun->scope()->num_stack_slots() > kPointerSize) {
On 2009/08/06 15:37:44, William Hesse wrote:
> times kBitsPerByte.

Thanks.  Turns out we have kBitsPerPointer.  Who knew.

http://codereview.chromium.org/165056/diff/1/2
File src/cfg.h (right):

http://codereview.chromium.org/165056/diff/1/2#newcode751
Line 751: // A StatementBuilder maintains a CFG fragment accumulator.  When it
visits
On 2009/08/06 15:37:44, William Hesse wrote:
> I would call this a BlockBuilder or a StatementList builder, or a basic block
> builder.  Unless there is a new one for each statement that is added to the
CFG.

I agree the name stinks (it's not building a statement).

BlockBuilder is too specific (it can build a graph that may have branches and
joins, not just blocks) and too generic (the 'ExpressionBuilder' is doing the
same thing, so 'BlockBuilder' doesn't differentiate).

StatementListBuilder is the wrong emphasis.  It is primarily applied to
statements not lists of them, but it can be folded over a list of statements in
an obvious way.

I'm probably going to call it 'StatementCfgBuilder' and eventually give it a
proper Build function.  For now I'll just leave it (it's simple to change).

Powered by Google App Engine
This is Rietveld 408576698