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_PARSER_H_ | 5 #ifndef V8_PARSER_H_ |
6 #define V8_PARSER_H_ | 6 #define V8_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/compiler.h" // For CachedDataMode | 10 #include "src/compiler.h" // For CachedDataMode |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 // is that offsets computed by FullCodeGenerator::StackOperand and similar | 689 // is that offsets computed by FullCodeGenerator::StackOperand and similar |
690 // functions are ints, and they should not overflow. In addition, accessing | 690 // functions are ints, and they should not overflow. In addition, accessing |
691 // local variables creates user-controlled constants in the generated code, | 691 // local variables creates user-controlled constants in the generated code, |
692 // and we don't want too much user-controlled memory inside the code (this was | 692 // and we don't want too much user-controlled memory inside the code (this was |
693 // the reason why this limit was introduced in the first place; see | 693 // the reason why this limit was introduced in the first place; see |
694 // https://codereview.chromium.org/7003030/ ). | 694 // https://codereview.chromium.org/7003030/ ). |
695 static const int kMaxNumFunctionLocals = 4194303; // 2^22-1 | 695 static const int kMaxNumFunctionLocals = 4194303; // 2^22-1 |
696 | 696 |
697 enum VariableDeclarationContext { | 697 enum VariableDeclarationContext { |
698 kModuleElement, | 698 kModuleElement, |
699 kBlockElement, | |
700 kStatement, | 699 kStatement, |
701 kForStatement | 700 kForStatement |
702 }; | 701 }; |
703 | 702 |
704 // If a list of variable declarations includes any initializers. | 703 // If a list of variable declarations includes any initializers. |
705 enum VariableDeclarationProperties { | 704 enum VariableDeclarationProperties { |
706 kHasInitializers, | 705 kHasInitializers, |
707 kHasNoInitializers | 706 kHasNoInitializers |
708 }; | 707 }; |
709 | 708 |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 } | 997 } |
999 | 998 |
1000 | 999 |
1001 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, | 1000 Expression* ParserTraits::CloseTemplateLiteral(TemplateLiteralState* state, |
1002 int start, Expression* tag) { | 1001 int start, Expression* tag) { |
1003 return parser_->CloseTemplateLiteral(state, start, tag); | 1002 return parser_->CloseTemplateLiteral(state, start, tag); |
1004 } | 1003 } |
1005 } } // namespace v8::internal | 1004 } } // namespace v8::internal |
1006 | 1005 |
1007 #endif // V8_PARSER_H_ | 1006 #endif // V8_PARSER_H_ |
OLD | NEW |