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

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

Issue 1567603005: Set up rewriting triggers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Merge RewriteExpression and ValidateExpression Created 4 years, 11 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 | « no previous file | src/parsing/parser.cc » ('j') | src/parsing/parser-base.h » ('J')
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 #ifndef V8_PARSING_PARSER_H_ 5 #ifndef V8_PARSING_PARSER_H_
6 #define V8_PARSING_PARSER_H_ 6 #define V8_PARSING_PARSER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/ast/ast.h" 9 #include "src/ast/ast.h"
10 #include "src/ast/scopes.h" 10 #include "src/ast/scopes.h"
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 644
645 // Rewrite all DestructuringAssignments in the current FunctionState. 645 // Rewrite all DestructuringAssignments in the current FunctionState.
646 V8_INLINE void RewriteDestructuringAssignments(); 646 V8_INLINE void RewriteDestructuringAssignments();
647 647
648 V8_INLINE void QueueDestructuringAssignmentForRewriting( 648 V8_INLINE void QueueDestructuringAssignmentForRewriting(
649 Expression* assignment); 649 Expression* assignment);
650 650
651 void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property, 651 void SetFunctionNameFromPropertyName(ObjectLiteralProperty* property,
652 const AstRawString* name); 652 const AstRawString* name);
653 653
654 // Rewrite expressions 654 // Rewrite expressions
rossberg 2016/01/12 13:47:52 Nit: can you clarify in the comment that this is u
nickie 2016/01/12 14:12:32 We agreed to rename this as RewriteNonPattern whic
655 V8_INLINE Expression* RewriteExpression(Expression* expr); 655 V8_INLINE Expression* RewriteExpression(
656 Expression* expr, const ExpressionClassifier* classifier, bool* ok);
656 V8_INLINE ObjectLiteralProperty* RewriteObjectLiteralProperty( 657 V8_INLINE ObjectLiteralProperty* RewriteObjectLiteralProperty(
657 ObjectLiteralProperty* property); 658 ObjectLiteralProperty* property, const ExpressionClassifier* classifier,
659 bool* ok);
658 660
659 private: 661 private:
660 Parser* parser_; 662 Parser* parser_;
661 }; 663 };
662 664
663 665
664 class Parser : public ParserBase<ParserTraits> { 666 class Parser : public ParserBase<ParserTraits> {
665 public: 667 public:
666 explicit Parser(ParseInfo* info); 668 explicit Parser(ParseInfo* info);
667 ~Parser() { 669 ~Parser() {
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 Expression* SpreadCall(Expression* function, 1003 Expression* SpreadCall(Expression* function,
1002 ZoneList<v8::internal::Expression*>* args, int pos); 1004 ZoneList<v8::internal::Expression*>* args, int pos);
1003 Expression* SpreadCallNew(Expression* function, 1005 Expression* SpreadCallNew(Expression* function,
1004 ZoneList<v8::internal::Expression*>* args, int pos); 1006 ZoneList<v8::internal::Expression*>* args, int pos);
1005 1007
1006 void SetLanguageMode(Scope* scope, LanguageMode mode); 1008 void SetLanguageMode(Scope* scope, LanguageMode mode);
1007 void RaiseLanguageMode(LanguageMode mode); 1009 void RaiseLanguageMode(LanguageMode mode);
1008 1010
1009 V8_INLINE void RewriteDestructuringAssignments(); 1011 V8_INLINE void RewriteDestructuringAssignments();
1010 1012
1011 V8_INLINE Expression* RewriteExpression(Expression* expr); 1013 V8_INLINE Expression* RewriteExpression(
1014 Expression* expr, const ExpressionClassifier* classifier, bool* ok);
1012 V8_INLINE ObjectLiteralProperty* RewriteObjectLiteralProperty( 1015 V8_INLINE ObjectLiteralProperty* RewriteObjectLiteralProperty(
1013 ObjectLiteralProperty* property); 1016 ObjectLiteralProperty* property, const ExpressionClassifier* classifier,
1017 bool* ok);
1014 1018
1015 friend class InitializerRewriter; 1019 friend class InitializerRewriter;
1016 void RewriteParameterInitializer(Expression* expr, Scope* scope); 1020 void RewriteParameterInitializer(Expression* expr, Scope* scope);
1017 1021
1018 Scanner scanner_; 1022 Scanner scanner_;
1019 PreParser* reusable_preparser_; 1023 PreParser* reusable_preparser_;
1020 Scope* original_scope_; // for ES5 function declarations in sloppy eval 1024 Scope* original_scope_; // for ES5 function declarations in sloppy eval
1021 Target* target_stack_; // for break, continue statements 1025 Target* target_stack_; // for break, continue statements
1022 ScriptCompiler::CompileOptions compile_options_; 1026 ScriptCompiler::CompileOptions compile_options_;
1023 ParseData* cached_parse_data_; 1027 ParseData* cached_parse_data_;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1201 1205
1202 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { 1206 DoExpression* ParserTraits::ParseDoExpression(bool* ok) {
1203 return parser_->ParseDoExpression(ok); 1207 return parser_->ParseDoExpression(ok);
1204 } 1208 }
1205 1209
1206 1210
1207 } // namespace internal 1211 } // namespace internal
1208 } // namespace v8 1212 } // namespace v8
1209 1213
1210 #endif // V8_PARSING_PARSER_H_ 1214 #endif // V8_PARSING_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.cc » ('j') | src/parsing/parser-base.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698