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

Unified Diff: src/hydrogen-dce.h

Issue 18791002: Turn dead code elimination into a proper HPhase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use local worklists. Created 7 years, 5 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 | « src/hydrogen.cc ('k') | src/hydrogen-dce.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-dce.h
diff --git a/src/hydrogen-escape-analysis.h b/src/hydrogen-dce.h
similarity index 79%
copy from src/hydrogen-escape-analysis.h
copy to src/hydrogen-dce.h
index 6ba6e823c54f25f2ef4c45a13c9aedba37cfa566..19749f279a2e1cb632ba5a300033e5a9f038638f 100644
--- a/src/hydrogen-escape-analysis.h
+++ b/src/hydrogen-dce.h
@@ -25,33 +25,32 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef V8_HYDROGEN_ESCAPE_ANALYSIS_H_
-#define V8_HYDROGEN_ESCAPE_ANALYSIS_H_
+#ifndef V8_HYDROGEN_DCE_H_
+#define V8_HYDROGEN_DCE_H_
-#include "allocation.h"
#include "hydrogen.h"
namespace v8 {
namespace internal {
-class HEscapeAnalysisPhase : public HPhase {
+class HDeadCodeEliminationPhase : public HPhase {
public:
- explicit HEscapeAnalysisPhase(HGraph* graph)
- : HPhase("H_Escape analysis", graph), captured_(0, zone()) { }
+ explicit HDeadCodeEliminationPhase(HGraph* graph)
+ : HPhase("H_Dead code elimination", graph) { }
void Run() {
- CollectCapturedValues();
+ MarkLiveInstructions();
+ RemoveDeadInstructions();
}
private:
- void CollectCapturedValues();
- void CollectIfNoEscapingUses(HInstruction* instr);
-
- ZoneList<HValue*> captured_;
+ bool MarkLive(HValue* ref, HValue* instr);
+ void MarkLiveInstructions();
+ void RemoveDeadInstructions();
};
} } // namespace v8::internal
-#endif // V8_HYDROGEN_ESCAPE_ANALYSIS_H_
+#endif // V8_HYDROGEN_DCE_H_
« no previous file with comments | « src/hydrogen.cc ('k') | src/hydrogen-dce.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698