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

Unified Diff: src/ast.cc

Issue 6813107: Enable inlining of functions containing loops. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast.cc
===================================================================
--- src/ast.cc (revision 7585)
+++ src/ast.cc (working copy)
@@ -367,36 +367,11 @@
}
-bool ForStatement::IsInlineable() const {
- return false;
-}
-
-
-bool WhileStatement::IsInlineable() const {
- return false;
-}
-
-
-bool DoWhileStatement::IsInlineable() const {
- return false;
-}
-
-
bool ForInStatement::IsInlineable() const {
return false;
}
-bool ContinueStatement::IsInlineable() const {
- return false;
-}
-
-
-bool BreakStatement::IsInlineable() const {
- return false;
-}
-
-
bool WithEnterStatement::IsInlineable() const {
return false;
}
@@ -471,6 +446,36 @@
}
+bool ForStatement::IsInlineable() const {
+ return (init() == NULL || init()->IsInlineable())
+ && (cond() == NULL || cond()->IsInlineable())
+ && (next() == NULL || next()->IsInlineable())
+ && body()->IsInlineable();
+}
+
+
+bool WhileStatement::IsInlineable() const {
+ return cond()->IsInlineable()
+ && body()->IsInlineable();
+}
+
+
+bool DoWhileStatement::IsInlineable() const {
+ return cond()->IsInlineable()
+ && body()->IsInlineable();
+}
+
+
+bool ContinueStatement::IsInlineable() const {
+ return true;
+}
+
+
+bool BreakStatement::IsInlineable() const {
+ return true;
+}
+
+
bool EmptyStatement::IsInlineable() const {
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698