| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_AST_AST_H_ | 5 #ifndef V8_AST_AST_H_ |
| 6 #define V8_AST_AST_H_ | 6 #define V8_AST_AST_H_ |
| 7 | 7 |
| 8 #include "src/ast/ast-value-factory.h" | 8 #include "src/ast/ast-value-factory.h" |
| 9 #include "src/ast/modules.h" | 9 #include "src/ast/modules.h" |
| 10 #include "src/ast/variables.h" | 10 #include "src/ast/variables.h" |
| (...skipping 2849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2860 case AstNode::k##NodeType: \ | 2860 case AstNode::k##NodeType: \ |
| 2861 return this->impl()->Visit##NodeType(static_cast<NodeType*>(node)); | 2861 return this->impl()->Visit##NodeType(static_cast<NodeType*>(node)); |
| 2862 | 2862 |
| 2863 #define GENERATE_AST_VISITOR_SWITCH() \ | 2863 #define GENERATE_AST_VISITOR_SWITCH() \ |
| 2864 switch (node->node_type()) { \ | 2864 switch (node->node_type()) { \ |
| 2865 AST_NODE_LIST(GENERATE_VISIT_CASE) \ | 2865 AST_NODE_LIST(GENERATE_VISIT_CASE) \ |
| 2866 } | 2866 } |
| 2867 | 2867 |
| 2868 #define DEFINE_AST_VISITOR_SUBCLASS_MEMBERS() \ | 2868 #define DEFINE_AST_VISITOR_SUBCLASS_MEMBERS() \ |
| 2869 public: \ | 2869 public: \ |
| 2870 void Visit(AstNode* node) { \ | 2870 void VisitNoStackOverflowCheck(AstNode* node) { \ |
| 2871 if (CheckStackOverflow()) return; \ | |
| 2872 GENERATE_AST_VISITOR_SWITCH() \ | 2871 GENERATE_AST_VISITOR_SWITCH() \ |
| 2873 } \ | 2872 } \ |
| 2874 \ | 2873 \ |
| 2874 void Visit(AstNode* node) { \ |
| 2875 if (CheckStackOverflow()) return; \ |
| 2876 VisitNoStackOverflowCheck(node); \ |
| 2877 } \ |
| 2878 \ |
| 2875 void SetStackOverflow() { stack_overflow_ = true; } \ | 2879 void SetStackOverflow() { stack_overflow_ = true; } \ |
| 2876 void ClearStackOverflow() { stack_overflow_ = false; } \ | 2880 void ClearStackOverflow() { stack_overflow_ = false; } \ |
| 2877 bool HasStackOverflow() const { return stack_overflow_; } \ | 2881 bool HasStackOverflow() const { return stack_overflow_; } \ |
| 2878 \ | 2882 \ |
| 2879 bool CheckStackOverflow() { \ | 2883 bool CheckStackOverflow() { \ |
| 2880 if (stack_overflow_) return true; \ | 2884 if (stack_overflow_) return true; \ |
| 2881 if (GetCurrentStackPosition() < stack_limit_) { \ | 2885 if (GetCurrentStackPosition() < stack_limit_) { \ |
| 2882 stack_overflow_ = true; \ | 2886 stack_overflow_ = true; \ |
| 2883 return true; \ | 2887 return true; \ |
| 2884 } \ | 2888 } \ |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3446 : NULL; \ | 3450 : NULL; \ |
| 3447 } | 3451 } |
| 3448 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) | 3452 AST_NODE_LIST(DECLARE_NODE_FUNCTIONS) |
| 3449 #undef DECLARE_NODE_FUNCTIONS | 3453 #undef DECLARE_NODE_FUNCTIONS |
| 3450 | 3454 |
| 3451 | 3455 |
| 3452 } // namespace internal | 3456 } // namespace internal |
| 3453 } // namespace v8 | 3457 } // namespace v8 |
| 3454 | 3458 |
| 3455 #endif // V8_AST_AST_H_ | 3459 #endif // V8_AST_AST_H_ |
| OLD | NEW |