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

Unified Diff: src/usage-analyzer.cc

Issue 269049: Split the AST LoopStatement type into separate types for do/while,... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 2 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
Index: src/usage-analyzer.cc
===================================================================
--- src/usage-analyzer.cc (revision 3045)
+++ src/usage-analyzer.cc (working copy)
@@ -159,14 +159,25 @@
}
-void UsageComputer::VisitLoopStatement(LoopStatement* node) {
- if (node->init() != NULL)
- Visit(node->init());
+void UsageComputer::VisitDoWhileStatement(DoWhileStatement* node) {
+ WeightScaler ws(this, 10.0);
+ Read(node->cond());
+ Visit(node->body());
+}
+
+
+void UsageComputer::VisitWhileStatement(WhileStatement* node) {
+ WeightScaler ws(this, 10.0);
+ Read(node->cond());
+ Visit(node->body());
+}
+
+
+void UsageComputer::VisitForStatement(ForStatement* node) {
+ if (node->init() != NULL) Visit(node->init());
{ WeightScaler ws(this, 10.0); // executed in each iteration
- if (node->cond() != NULL)
- Read(node->cond());
- if (node->next() != NULL)
- Visit(node->next());
+ if (node->cond() != NULL) Read(node->cond());
+ if (node->next() != NULL) Visit(node->next());
Visit(node->body());
}
}
@@ -180,7 +191,7 @@
}
-void UsageComputer::VisitTryCatch(TryCatch* node) {
+void UsageComputer::VisitTryCatchStatement(TryCatchStatement* node) {
Visit(node->try_block());
{ WeightScaler ws(this, 0.25);
Write(node->catch_var());
@@ -189,7 +200,7 @@
}
-void UsageComputer::VisitTryFinally(TryFinally* node) {
+void UsageComputer::VisitTryFinallyStatement(TryFinallyStatement* node) {
Visit(node->try_block());
Visit(node->finally_block());
}
« src/prettyprinter.cc ('K') | « src/rewriter.cc ('k') | src/x64/codegen-x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698