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

Side by Side Diff: src/parsing/parser.cc

Issue 2400613003: PreParsing inner functions: Fix declaration-only variables, part 2. (Closed)
Patch Set: rebased Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/ast/scopes.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "src/parsing/parser.h" 5 #include "src/parsing/parser.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/ast/ast-expression-rewriter.h" 10 #include "src/ast/ast-expression-rewriter.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 : ast_node_factory_scope_(parser->factory(), temp_zone, use_temp_zone), 117 : ast_node_factory_scope_(parser->factory(), temp_zone, use_temp_zone),
118 fni_(parser->ast_value_factory_, temp_zone), 118 fni_(parser->ast_value_factory_, temp_zone),
119 parser_(parser), 119 parser_(parser),
120 prev_fni_(parser->fni_), 120 prev_fni_(parser->fni_),
121 prev_zone_(parser->zone_) { 121 prev_zone_(parser->zone_) {
122 if (use_temp_zone) { 122 if (use_temp_zone) {
123 parser_->fni_ = &fni_; 123 parser_->fni_ = &fni_;
124 parser_->zone_ = temp_zone; 124 parser_->zone_ = temp_zone;
125 if (parser_->reusable_preparser_ != nullptr) { 125 if (parser_->reusable_preparser_ != nullptr) {
126 parser_->reusable_preparser_->zone_ = temp_zone; 126 parser_->reusable_preparser_->zone_ = temp_zone;
127 parser_->reusable_preparser_->factory()->set_zone(temp_zone);
127 } 128 }
128 } 129 }
129 } 130 }
130 void Reset() { 131 void Reset() {
131 parser_->fni_ = prev_fni_; 132 parser_->fni_ = prev_fni_;
132 parser_->zone_ = prev_zone_; 133 parser_->zone_ = prev_zone_;
133 if (parser_->reusable_preparser_ != nullptr) { 134 if (parser_->reusable_preparser_ != nullptr) {
134 parser_->reusable_preparser_->zone_ = prev_zone_; 135 parser_->reusable_preparser_->zone_ = prev_zone_;
136 parser_->reusable_preparser_->factory()->set_zone(prev_zone_);
135 } 137 }
136 ast_node_factory_scope_.Reset(); 138 ast_node_factory_scope_.Reset();
137 } 139 }
138 ~DiscardableZoneScope() { Reset(); } 140 ~DiscardableZoneScope() { Reset(); }
139 141
140 private: 142 private:
141 AstNodeFactory::BodyScope ast_node_factory_scope_; 143 AstNodeFactory::BodyScope ast_node_factory_scope_;
142 FuncNameInferrer fni_; 144 FuncNameInferrer fni_;
143 Parser* parser_; 145 Parser* parser_;
144 FuncNameInferrer* prev_fni_; 146 FuncNameInferrer* prev_fni_;
(...skipping 5317 matching lines...) Expand 10 before | Expand all | Expand 10 after
5462 5464
5463 return final_loop; 5465 return final_loop;
5464 } 5466 }
5465 5467
5466 #undef CHECK_OK 5468 #undef CHECK_OK
5467 #undef CHECK_OK_VOID 5469 #undef CHECK_OK_VOID
5468 #undef CHECK_FAILED 5470 #undef CHECK_FAILED
5469 5471
5470 } // namespace internal 5472 } // namespace internal
5471 } // namespace v8 5473 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698