Chromium Code Reviews
DescriptionRecognize basic block entries in the flow graph.
Also, instead of keeping a list of all instructions, keep a list of only
block entries. The printing implementation is changed (for the better) to
use the new representation. With --use_new_compiler and --print_flow_graph
the function:
main() {
var f = 1;
var n = 5;
while (n > 0) {
f = f * n;
n = n - 1;
}
print(f);
}
prints as:
0: [target]
StoreLocal(f, #1)
StoreLocal(n, #5) goto 1
1: [join]
t0 <-LoadLocal(n)
t0 <-InstanceCall(>, t0, #0)
if t0 goto(2, 3)
2: [target]
t0 <-LoadLocal(f)
t1 <-LoadLocal(n)
t0 <-InstanceCall(*, t0, t1)
StoreLocal(f, t0)
t0 <-LoadLocal(n)
t0 <-InstanceCall(-, t0, #1)
StoreLocal(n, t0) goto 1
3: [target]
t0 <-LoadLocal(f)
StaticCall(print, t0)
return #null
R=srdjan@google.com
BUG=
TEST=
Committed: https://code.google.com/p/dart/source/detail?r=4515
Patch Set 1 #
Total comments: 4
Messages
Total messages: 4 (0 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||