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

Unified Diff: src/parsing/parser.h

Issue 2156013002: Put FunctionLiterals into temp_zone too. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix comment -- for try jobs pls see previous patch 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 | « src/ast/ast.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parser.h
diff --git a/src/parsing/parser.h b/src/parsing/parser.h
index 76611dfae55bdc4fe6e92aa2fc2c06b574d5f983..1e2022d1ecc83d062a7306d5f3ee8d047c255320 100644
--- a/src/parsing/parser.h
+++ b/src/parsing/parser.h
@@ -931,6 +931,28 @@ class Parser : public ParserBase<ParserTraits> {
DEFINE_AST_VISITOR_MEMBERS_WITHOUT_STACKOVERFLOW()
};
+ // Helper for putting parts of the parse results into a temporary zone when
+ // parsing inner function bodies.
+ class DiscardableZoneScope {
titzer 2016/07/19 07:55:30 AFAICT the main difference between DiscardableZone
+ public:
+ DiscardableZoneScope(Parser* parser, Zone* temp_zone, bool use_temp_zone)
+ : ast_node_factory_scope_(parser->factory(), temp_zone, use_temp_zone),
+ fni_(parser->ast_value_factory_, temp_zone),
+ parser_(parser),
+ prev_fni_(parser->fni_) {
+ if (use_temp_zone) {
+ parser_->fni_ = &fni_;
+ }
+ }
+ ~DiscardableZoneScope() { parser_->fni_ = prev_fni_; }
+
+ private:
+ AstNodeFactory::BodyScope ast_node_factory_scope_;
+ FuncNameInferrer fni_;
+ Parser* parser_;
+ FuncNameInferrer* prev_fni_;
+ };
+
Block* ParseVariableDeclarations(VariableDeclarationContext var_context,
DeclarationParsingResult* parsing_result,
ZoneList<const AstRawString*>* names,
« no previous file with comments | « src/ast/ast.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698