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

Issue 9601011: Implement postfix indexed increment. (Closed)

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

Description

Implement postfix indexed increment. Chosen because of its wartiness. A pair of new computations are introduced to allow the IL to express duplication of temporaries and storing to temporaries. These will be translated away by the optimizing compiler, but allow the instruction stream to represent exactly the deoptimization state we are intereseted in (with at most one deopt point per instruction). Translation of: test(a, i) { return a[i]++; } is 0: [target] t0 <-#0 t1 <-LoadLocal(a) t2 <-LoadLocal(i) t3 <-CopyTemp(-1) t4 <-CopyTemp(-1) t3 <-InstanceCall([], t3, t4) SetTemp(-3) t4 <-#1 t3 <-InstanceCall(+, t3, t4) InstanceCall([]=, t1, t2, t3) return t0 R=srdjan@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=5012

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+164 lines, -18 lines) Patch
M runtime/vm/flow_graph_builder.h View 2 chunks +6 lines, -2 lines 0 comments Download
M runtime/vm/flow_graph_builder.cc View 10 chunks +91 lines, -9 lines 1 comment Download
M runtime/vm/flow_graph_compiler_x64.cc View 1 chunk +15 lines, -0 lines 0 comments Download
M runtime/vm/intermediate_language.h View 6 chunks +52 lines, -7 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Kevin Millikin (Google)
This has the advantage that the load, add/subtract, and store are all normal instructions. That ...
8 years, 9 months ago (2012-03-05 15:58:36 UTC) #1
srdjan
8 years, 9 months ago (2012-03-05 21:44:37 UTC) #2
LGTM in order to move forward and reach our weekly goal.

(note the brief comment about node->id(), something that we wil
l be computing differently in the new compiler)

The suggested solution seems complex, but it seems to work. Note that we plan to
 get rid of IncrOpIndexedNode, IncrOpInstancedFieldNode and
IncrOpStaticFieldNode, in which case that code and nodes could be removed.

https://chromiumcodereview.appspot.com/9601011/diff/1/runtime/vm/flow_graph_b...
File runtime/vm/flow_graph_builder.cc (right):

https://chromiumcodereview.appspot.com/9601011/diff/1/runtime/vm/flow_graph_b...
runtime/vm/flow_graph_builder.cc:233: new InstanceCallComp(node->id(),
node->token_index(), name,
FYI: In the old compiler node->id() is used for deoptimization purposes (deopt
points identifier) and for inline cache data mapping (code -> node). The new
compiler will probably have its own id-s, i.e., we may want to skip passing and
storing the AST's node-ids. It is OK to still pass them around, so that we can
compare and generate code that has the id-s added.

Powered by Google App Engine
This is Rietveld 408576698