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

Unified Diff: runtime/vm/flow_graph_allocator.h

Issue 10657044: Fix a bug in liveness analysis code and add more comments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_allocator.h
diff --git a/runtime/vm/flow_graph_allocator.h b/runtime/vm/flow_graph_allocator.h
index 8ca9216a0f5953338c683e81e5d6a9eb27673198..7848d2b11822e7b5d6a25d69c61d9430cd34ba02 100644
--- a/runtime/vm/flow_graph_allocator.h
+++ b/runtime/vm/flow_graph_allocator.h
@@ -17,20 +17,49 @@ class FlowGraphAllocator : public ValueObject {
void ResolveConstraints();
+ // Build live-in and live-out sets for each block.
void AnalyzeLiveness();
private:
- void ComputeKillAndGenSets();
+ // Compute initial values for live-out, kill and live-in sets.
+ void ComputeInitialSets();
+
+ // Update live-out set for the given block: live-out should contain
+ // all values that are live-in for block's successors.
+ // Returns true if live-out set was changed.
bool UpdateLiveOut(BlockEntryInstr* instr);
+
+ // Update live-in set for the given block: live-in should contain
+ // all values taht are live-out from the block and are not defined
+ // by this block.
+ // Returns true if live-in set was changed.
bool UpdateLiveIn(BlockEntryInstr* instr);
+
+ // Perform fix-point iteration updating live-out and live-in sets
+ // for blocks until they stop changing.
void ComputeLiveInAndLiveOutSets();
+
+ // Print results of liveness analysis.
void DumpLiveness();
+ // Live-out sets for each block. They contain indices of SSA values
+ // that are live out from this block: that is values that were either
+ // defined in this block or live into it and that are used in some
+ // successor block.
GrowableArray<BitVector*> live_out_;
+
+ // Kill sets for each block. They contain indices of SSA values that
+ // are defined by this block.
GrowableArray<BitVector*> kill_;
- GrowableArray<BitVector*> gen_;
+
+ // Live-in sets for each block. They contain indices of SSA values
+ // that are used by this block or its successors.
GrowableArray<BitVector*> live_in_;
+
const GrowableArray<BlockEntryInstr*>& postorder_;
+
+ // Number of virtual registers. Currently equal to the number of
+ // SSA values.
const intptr_t vreg_count_;
DISALLOW_COPY_AND_ASSIGN(FlowGraphAllocator);
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698