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

Unified Diff: runtime/vm/intermediate_language.h

Issue 10832180: Eliminate phis that do not reach any non-environment uses. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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
« runtime/vm/flow_graph_allocator.cc ('K') | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language.h
diff --git a/runtime/vm/intermediate_language.h b/runtime/vm/intermediate_language.h
index 07491af2ef982fbef7f61269672084cc4676966c..74124c372872e84b00b6df777aace86bfb1c7194 100644
--- a/runtime/vm/intermediate_language.h
+++ b/runtime/vm/intermediate_language.h
@@ -2362,7 +2362,8 @@ class BindInstr : public Definition {
class PhiInstr : public Definition {
public:
- explicit PhiInstr(intptr_t num_inputs) : inputs_(num_inputs) {
+ explicit PhiInstr(intptr_t num_inputs)
+ : inputs_(num_inputs), is_alive_(false) {
for (intptr_t i = 0; i < num_inputs; ++i) {
inputs_.Add(NULL);
}
@@ -2381,10 +2382,15 @@ class PhiInstr : public Definition {
virtual bool CanDeoptimize() const { return false; }
+ // Phi is alive if it reaches a non-environment use.
+ bool is_alive() const { return is_alive_; }
+ void mark_alive() { is_alive_ = true; }
+
DECLARE_INSTRUCTION(Phi)
private:
GrowableArray<Value*> inputs_;
+ bool is_alive_;
DISALLOW_COPY_AND_ASSIGN(PhiInstr);
};
@@ -2690,6 +2696,10 @@ class Environment : public ZoneAllocated {
return values_;
}
+ GrowableArray<Value*>* values_ptr() {
+ return &values_;
+ }
+
void InitializeLocations() {
location_count_ = values_.length();
if (location_count_ > 0) {
« runtime/vm/flow_graph_allocator.cc ('K') | « runtime/vm/flow_graph_builder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698