OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 | 1725 |
1726 class AstVisitor BASE_EMBEDDED { | 1726 class AstVisitor BASE_EMBEDDED { |
1727 public: | 1727 public: |
1728 AstVisitor() : stack_overflow_(false) { } | 1728 AstVisitor() : stack_overflow_(false) { } |
1729 virtual ~AstVisitor() { } | 1729 virtual ~AstVisitor() { } |
1730 | 1730 |
1731 // Dispatch | 1731 // Dispatch |
1732 void Visit(AstNode* node) { node->Accept(this); } | 1732 void Visit(AstNode* node) { node->Accept(this); } |
1733 | 1733 |
1734 // Iteration | 1734 // Iteration |
| 1735 virtual void VisitDeclarations(ZoneList<Declaration*>* declarations); |
1735 virtual void VisitStatements(ZoneList<Statement*>* statements); | 1736 virtual void VisitStatements(ZoneList<Statement*>* statements); |
1736 virtual void VisitExpressions(ZoneList<Expression*>* expressions); | 1737 virtual void VisitExpressions(ZoneList<Expression*>* expressions); |
1737 | 1738 |
1738 // Stack overflow tracking support. | 1739 // Stack overflow tracking support. |
1739 bool HasStackOverflow() const { return stack_overflow_; } | 1740 bool HasStackOverflow() const { return stack_overflow_; } |
1740 bool CheckStackOverflow() { | 1741 bool CheckStackOverflow() { |
1741 if (stack_overflow_) return true; | 1742 if (stack_overflow_) return true; |
1742 StackLimitCheck check; | 1743 StackLimitCheck check; |
1743 if (!check.HasOverflowed()) return false; | 1744 if (!check.HasOverflowed()) return false; |
1744 return (stack_overflow_ = true); | 1745 return (stack_overflow_ = true); |
(...skipping 12 matching lines...) Expand all Loading... |
1757 #undef DEF_VISIT | 1758 #undef DEF_VISIT |
1758 | 1759 |
1759 private: | 1760 private: |
1760 bool stack_overflow_; | 1761 bool stack_overflow_; |
1761 }; | 1762 }; |
1762 | 1763 |
1763 | 1764 |
1764 } } // namespace v8::internal | 1765 } } // namespace v8::internal |
1765 | 1766 |
1766 #endif // V8_AST_H_ | 1767 #endif // V8_AST_H_ |
OLD | NEW |