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

Unified Diff: src/ast/ast.h

Issue 2169823002: FunctionState doesn't need to know AstNodeFactory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 4 years, 5 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 | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.h
diff --git a/src/ast/ast.h b/src/ast/ast.h
index 3dc09b1ae3cfcc5346214bf8b496e73fbbc431af..35bfbcbfd73919bac0f5ed246062aa08d90bc55e 100644
--- a/src/ast/ast.h
+++ b/src/ast/ast.h
@@ -3069,11 +3069,21 @@ class AstTraversalVisitor : public AstVisitor<AstTraversalVisitor> {
class AstNodeFactory final BASE_EMBEDDED {
public:
explicit AstNodeFactory(AstValueFactory* ast_value_factory)
- : local_zone_(ast_value_factory->zone()),
- parser_zone_(ast_value_factory->zone()),
- ast_value_factory_(ast_value_factory) {}
+ : local_zone_(nullptr),
+ parser_zone_(nullptr),
+ ast_value_factory_(ast_value_factory) {
+ if (ast_value_factory != nullptr) {
+ local_zone_ = ast_value_factory->zone();
+ parser_zone_ = ast_value_factory->zone();
+ }
+ }
AstValueFactory* ast_value_factory() const { return ast_value_factory_; }
+ void set_ast_value_factory(AstValueFactory* ast_value_factory) {
+ ast_value_factory_ = ast_value_factory;
+ local_zone_ = ast_value_factory->zone();
+ parser_zone_ = ast_value_factory->zone();
+ }
VariableDeclaration* NewVariableDeclaration(VariableProxy* proxy,
VariableMode mode, Scope* scope,
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698