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; |
} |