| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 bool allow_natives_syntax, | 422 bool allow_natives_syntax, |
| 423 v8::Extension* extension, | 423 v8::Extension* extension, |
| 424 ScriptDataImpl* pre_data); | 424 ScriptDataImpl* pre_data); |
| 425 virtual ~Parser() { } | 425 virtual ~Parser() { } |
| 426 | 426 |
| 427 // Returns NULL if parsing failed. | 427 // Returns NULL if parsing failed. |
| 428 FunctionLiteral* ParseProgram(Handle<String> source, | 428 FunctionLiteral* ParseProgram(Handle<String> source, |
| 429 bool in_global_context, | 429 bool in_global_context, |
| 430 StrictModeFlag strict_mode); | 430 StrictModeFlag strict_mode); |
| 431 | 431 |
| 432 FunctionLiteral* ParseLazy(Handle<SharedFunctionInfo> info); | 432 FunctionLiteral* ParseLazy(CompilationInfo* info); |
| 433 | 433 |
| 434 void ReportMessageAt(Scanner::Location loc, | 434 void ReportMessageAt(Scanner::Location loc, |
| 435 const char* message, | 435 const char* message, |
| 436 Vector<const char*> args); | 436 Vector<const char*> args); |
| 437 void ReportMessageAt(Scanner::Location loc, | 437 void ReportMessageAt(Scanner::Location loc, |
| 438 const char* message, | 438 const char* message, |
| 439 Vector<Handle<String> > args); | 439 Vector<Handle<String> > args); |
| 440 | 440 |
| 441 protected: | 441 protected: |
| 442 // Limit on number of function parameters is chosen arbitrarily. | 442 // Limit on number of function parameters is chosen arbitrarily. |
| 443 // Code::Flags uses only the low 17 bits of num-parameters to | 443 // Code::Flags uses only the low 17 bits of num-parameters to |
| 444 // construct a hashable id, so if more than 2^17 are allowed, this | 444 // construct a hashable id, so if more than 2^17 are allowed, this |
| 445 // should be checked. | 445 // should be checked. |
| 446 static const int kMaxNumFunctionParameters = 32766; | 446 static const int kMaxNumFunctionParameters = 32766; |
| 447 FunctionLiteral* ParseLazy(Handle<SharedFunctionInfo> info, | 447 FunctionLiteral* ParseLazy(CompilationInfo* info, |
| 448 UC16CharacterStream* source, | 448 UC16CharacterStream* source, |
| 449 ZoneScope* zone_scope); | 449 ZoneScope* zone_scope); |
| 450 enum Mode { | 450 enum Mode { |
| 451 PARSE_LAZILY, | 451 PARSE_LAZILY, |
| 452 PARSE_EAGERLY | 452 PARSE_EAGERLY |
| 453 }; | 453 }; |
| 454 | 454 |
| 455 Isolate* isolate() { return isolate_; } | 455 Isolate* isolate() { return isolate_; } |
| 456 | 456 |
| 457 // Called by ParseProgram after setting up the scanner. | 457 // Called by ParseProgram after setting up the scanner. |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 // Converts the currently parsed literal to a JavaScript String. | 802 // Converts the currently parsed literal to a JavaScript String. |
| 803 Handle<String> GetString(); | 803 Handle<String> GetString(); |
| 804 | 804 |
| 805 Isolate* isolate_; | 805 Isolate* isolate_; |
| 806 JsonScanner scanner_; | 806 JsonScanner scanner_; |
| 807 bool stack_overflow_; | 807 bool stack_overflow_; |
| 808 }; | 808 }; |
| 809 } } // namespace v8::internal | 809 } } // namespace v8::internal |
| 810 | 810 |
| 811 #endif // V8_PARSER_H_ | 811 #endif // V8_PARSER_H_ |
| OLD | NEW |