| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 | 407 |
| 408 // Forward declaration. | 408 // Forward declaration. |
| 409 class SingletonLogger; | 409 class SingletonLogger; |
| 410 | 410 |
| 411 class Parser : public ParserBase { | 411 class Parser : public ParserBase { |
| 412 public: | 412 public: |
| 413 explicit Parser(CompilationInfo* info); | 413 explicit Parser(CompilationInfo* info); |
| 414 ~Parser() { | 414 ~Parser() { |
| 415 delete reusable_preparser_; | 415 delete reusable_preparser_; |
| 416 reusable_preparser_ = NULL; | 416 reusable_preparser_ = NULL; |
| 417 delete scanner_; |
| 418 scanner_ = NULL; |
| 417 } | 419 } |
| 418 | 420 |
| 419 // Parses the source code represented by the compilation info and sets its | 421 // Parses the source code represented by the compilation info and sets its |
| 420 // function literal. Returns false (and deallocates any allocated AST | 422 // function literal. Returns false (and deallocates any allocated AST |
| 421 // nodes) if parsing failed. | 423 // nodes) if parsing failed. |
| 422 static bool Parse(CompilationInfo* info) { return Parser(info).Parse(); } | 424 static bool Parse(CompilationInfo* info) { return Parser(info).Parse(); } |
| 423 bool Parse(); | 425 bool Parse(); |
| 424 | 426 |
| 425 private: | 427 private: |
| 426 static const int kMaxNumFunctionLocals = 131071; // 2^17-1 | 428 static const int kMaxNumFunctionLocals = 131071; // 2^17-1 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 812 private: | 814 private: |
| 813 static const int kLiteralTypeSlot = 0; | 815 static const int kLiteralTypeSlot = 0; |
| 814 static const int kElementsSlot = 1; | 816 static const int kElementsSlot = 1; |
| 815 | 817 |
| 816 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 818 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 817 }; | 819 }; |
| 818 | 820 |
| 819 } } // namespace v8::internal | 821 } } // namespace v8::internal |
| 820 | 822 |
| 821 #endif // V8_PARSER_H_ | 823 #endif // V8_PARSER_H_ |
| OLD | NEW |