| 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" // TODO(titzer): remove this include dependency | 10 #include "src/compiler.h" // TODO(titzer): remove this include dependency |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 bool Parse(ParseInfo* info); | 862 bool Parse(ParseInfo* info); |
| 863 void ParseOnBackground(ParseInfo* info); | 863 void ParseOnBackground(ParseInfo* info); |
| 864 | 864 |
| 865 // Handle errors detected during parsing, move statistics to Isolate, | 865 // Handle errors detected during parsing, move statistics to Isolate, |
| 866 // internalize strings (move them to the heap). | 866 // internalize strings (move them to the heap). |
| 867 void Internalize(Isolate* isolate, Handle<Script> script, bool error); | 867 void Internalize(Isolate* isolate, Handle<Script> script, bool error); |
| 868 void HandleSourceURLComments(Isolate* isolate, Handle<Script> script); | 868 void HandleSourceURLComments(Isolate* isolate, Handle<Script> script); |
| 869 | 869 |
| 870 private: | 870 private: |
| 871 friend class ParserTraits; | 871 friend class ParserTraits; |
| 872 class PatternRewriter; |
| 872 | 873 |
| 873 // Limit the allowed number of local variables in a function. The hard limit | 874 // Limit the allowed number of local variables in a function. The hard limit |
| 874 // is that offsets computed by FullCodeGenerator::StackOperand and similar | 875 // is that offsets computed by FullCodeGenerator::StackOperand and similar |
| 875 // functions are ints, and they should not overflow. In addition, accessing | 876 // functions are ints, and they should not overflow. In addition, accessing |
| 876 // local variables creates user-controlled constants in the generated code, | 877 // local variables creates user-controlled constants in the generated code, |
| 877 // and we don't want too much user-controlled memory inside the code (this was | 878 // and we don't want too much user-controlled memory inside the code (this was |
| 878 // the reason why this limit was introduced in the first place; see | 879 // the reason why this limit was introduced in the first place; see |
| 879 // https://codereview.chromium.org/7003030/ ). | 880 // https://codereview.chromium.org/7003030/ ). |
| 880 static const int kMaxNumFunctionLocals = 4194303; // 2^22-1 | 881 static const int kMaxNumFunctionLocals = 4194303; // 2^22-1 |
| 881 | 882 |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 } | 1179 } |
| 1179 | 1180 |
| 1180 | 1181 |
| 1181 Expression* ParserTraits::SpreadCallNew( | 1182 Expression* ParserTraits::SpreadCallNew( |
| 1182 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { | 1183 Expression* function, ZoneList<v8::internal::Expression*>* args, int pos) { |
| 1183 return parser_->SpreadCallNew(function, args, pos); | 1184 return parser_->SpreadCallNew(function, args, pos); |
| 1184 } | 1185 } |
| 1185 } } // namespace v8::internal | 1186 } } // namespace v8::internal |
| 1186 | 1187 |
| 1187 #endif // V8_PARSER_H_ | 1188 #endif // V8_PARSER_H_ |
| OLD | NEW |