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_H_ | 5 #ifndef V8_AST_H_ |
6 #define V8_AST_H_ | 6 #define V8_AST_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/ast-value-factory.h" | 9 #include "src/ast-value-factory.h" |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 3172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3183 bool CheckStackOverflow() { \ | 3183 bool CheckStackOverflow() { \ |
3184 if (stack_overflow_) return true; \ | 3184 if (stack_overflow_) return true; \ |
3185 if (GetCurrentStackPosition() < stack_limit_) { \ | 3185 if (GetCurrentStackPosition() < stack_limit_) { \ |
3186 stack_overflow_ = true; \ | 3186 stack_overflow_ = true; \ |
3187 return true; \ | 3187 return true; \ |
3188 } \ | 3188 } \ |
3189 return false; \ | 3189 return false; \ |
3190 } \ | 3190 } \ |
3191 \ | 3191 \ |
3192 private: \ | 3192 private: \ |
3193 void InitializeAstVisitor(Isolate* isolate, Zone* zone) { \ | 3193 void InitializeAstVisitor(Isolate* isolate) { \ |
3194 zone_ = zone; \ | |
3195 stack_limit_ = isolate->stack_guard()->real_climit(); \ | 3194 stack_limit_ = isolate->stack_guard()->real_climit(); \ |
3196 stack_overflow_ = false; \ | 3195 stack_overflow_ = false; \ |
3197 } \ | 3196 } \ |
3198 Zone* zone() { return zone_; } \ | |
3199 \ | 3197 \ |
3200 Zone* zone_; \ | |
3201 uintptr_t stack_limit_; \ | 3198 uintptr_t stack_limit_; \ |
3202 bool stack_overflow_ | 3199 bool stack_overflow_ |
3203 | 3200 |
3204 | 3201 |
3205 // ---------------------------------------------------------------------------- | 3202 // ---------------------------------------------------------------------------- |
3206 // AstNode factory | 3203 // AstNode factory |
3207 | 3204 |
3208 class AstNodeFactory final BASE_EMBEDDED { | 3205 class AstNodeFactory final BASE_EMBEDDED { |
3209 public: | 3206 public: |
3210 explicit AstNodeFactory(AstValueFactory* ast_value_factory) | 3207 explicit AstNodeFactory(AstValueFactory* ast_value_factory) |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3636 // the parser-level zone. | 3633 // the parser-level zone. |
3637 Zone* parser_zone_; | 3634 Zone* parser_zone_; |
3638 AstValueFactory* ast_value_factory_; | 3635 AstValueFactory* ast_value_factory_; |
3639 }; | 3636 }; |
3640 | 3637 |
3641 | 3638 |
3642 } // namespace internal | 3639 } // namespace internal |
3643 } // namespace v8 | 3640 } // namespace v8 |
3644 | 3641 |
3645 #endif // V8_AST_H_ | 3642 #endif // V8_AST_H_ |
OLD | NEW |