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

Side by Side Diff: src/parser.h

Issue 110203002: Refactor the compiling pipeline. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « src/optimizing-compiler-thread.cc ('k') | src/runtime.h » ('j') | no next file with comments »
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 // 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 public: 411 public:
412 explicit Parser(CompilationInfo* info); 412 explicit Parser(CompilationInfo* info);
413 ~Parser() { 413 ~Parser() {
414 delete reusable_preparser_; 414 delete reusable_preparser_;
415 reusable_preparser_ = NULL; 415 reusable_preparser_ = NULL;
416 } 416 }
417 417
418 // Parses the source code represented by the compilation info and sets its 418 // Parses the source code represented by the compilation info and sets its
419 // function literal. Returns false (and deallocates any allocated AST 419 // function literal. Returns false (and deallocates any allocated AST
420 // nodes) if parsing failed. 420 // nodes) if parsing failed.
421 static bool Parse(CompilationInfo* info) { return Parser(info).Parse(); } 421 static bool Parse(CompilationInfo* info,
422 bool allow_lazy = false) {
423 Parser parser(info);
424 parser.set_allow_lazy(allow_lazy);
425 return parser.Parse();
426 }
422 bool Parse(); 427 bool Parse();
423 428
424 private: 429 private:
425 static const int kMaxNumFunctionLocals = 131071; // 2^17-1 430 static const int kMaxNumFunctionLocals = 131071; // 2^17-1
426 431
427 enum Mode { 432 enum Mode {
428 PARSE_LAZILY, 433 PARSE_LAZILY,
429 PARSE_EAGERLY 434 PARSE_EAGERLY
430 }; 435 };
431 436
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 private: 815 private:
811 static const int kLiteralTypeSlot = 0; 816 static const int kLiteralTypeSlot = 0;
812 static const int kElementsSlot = 1; 817 static const int kElementsSlot = 1;
813 818
814 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); 819 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue);
815 }; 820 };
816 821
817 } } // namespace v8::internal 822 } } // namespace v8::internal
818 823
819 #endif // V8_PARSER_H_ 824 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « src/optimizing-compiler-thread.cc ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698