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

Issue 9429056: Recognize basic block entries in the flow graph. (Closed)

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

Description

Recognize 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
Unified diffs Side-by-side diffs Delta from patch set Stats (+110 lines, -141 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 6 chunks +29 lines, -14 lines 4 comments Download
M runtime/vm/intermediate_language.h View 7 chunks +45 lines, -49 lines 0 comments Download
M runtime/vm/intermediate_language.cc View 1 chunk +34 lines, -76 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Kevin Millikin (Google)
I already know that: (1) it's obvious that we need some type testing or casting ...
8 years, 10 months ago (2012-02-22 17:06:06 UTC) #1
srdjan
LGTM https://chromiumcodereview.appspot.com/9429056/diff/1/runtime/vm/flow_graph_builder.cc File runtime/vm/flow_graph_builder.cc (right): https://chromiumcodereview.appspot.com/9429056/diff/1/runtime/vm/flow_graph_builder.cc#newcode878 runtime/vm/flow_graph_builder.cc:878: while (current != NULL && !current->IsBlockEntry()) { More ...
8 years, 10 months ago (2012-02-22 17:41:10 UTC) #2
srdjan
Make sure you run the tests with --use_new_compiler On 2012/02/22 17:41:10, srdjan wrote: > LGTM ...
8 years, 10 months ago (2012-02-22 18:31:45 UTC) #3
Kevin Millikin (Google)
8 years, 10 months ago (2012-02-23 09:08:04 UTC) #4
https://chromiumcodereview.appspot.com/9429056/diff/1/runtime/vm/flow_graph_b...
File runtime/vm/flow_graph_builder.cc (right):

https://chromiumcodereview.appspot.com/9429056/diff/1/runtime/vm/flow_graph_b...
runtime/vm/flow_graph_builder.cc:878: while (current != NULL &&
!current->IsBlockEntry()) {
On 2012/02/22 17:41:10, srdjan wrote:
> More parenthesis, please

Thanks for the reminder.

https://chromiumcodereview.appspot.com/9429056/diff/1/runtime/vm/flow_graph_b...
runtime/vm/flow_graph_builder.cc:899: intptr_t index =
postorder_block_entries_.length() - 1;
On 2012/02/22 17:41:10, srdjan wrote:
> AS a for loop maybe?
> 
> intptr_t number = 0;
> for (intptr_t index = postorder_block_entries_.length() - 1;
>     i >=0; index--) {
> 
> }

Done.

Powered by Google App Engine
This is Rietveld 408576698