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

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: 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 77%
copy from src/hydrogen-escape-analysis.h
copy to src/hydrogen-dce.h
index 6ba6e823c54f25f2ef4c45a13c9aedba37cfa566..9be537a459cfc40199896f8e92d703c5beca3270 100644
--- a/src/hydrogen-escape-analysis.h
+++ b/src/hydrogen-dce.h
@@ -25,33 +25,35 @@
// (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),
+ worklist_(graph->blocks()->length(), zone()) { }
void Run() {
- CollectCapturedValues();
+ MarkLiveInstructions();
+ RemoveDeadInstructions();
}
private:
- void CollectCapturedValues();
- void CollectIfNoEscapingUses(HInstruction* instr);
+ void MarkLive(HValue* ref, HValue* instr);
+ void MarkLiveInstructions();
+ void RemoveDeadInstructions();
- ZoneList<HValue*> captured_;
+ ZoneList<HValue*> worklist_;
Dmitry Lomov (no reviews) 2013/07/05 19:06:20 It looks like the uses of worklist_ inside MarkLiv
Benedikt Meurer 2013/07/06 07:30:42 Done.
};
} } // 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