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

Unified Diff: src/parser.h

Issue 8662037: Don't preparse large files to find boundaries of lazy functions. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated to match tip of bleeding edge Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/liveedit.cc ('k') | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.h
diff --git a/src/parser.h b/src/parser.h
index e13b120fa69baea2f9fbc5b663268b9ea0d74b07..dc5882b32e46e13ec744f608e5de156de4f04647 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -76,8 +76,10 @@ class FunctionEntry BASE_EMBEDDED {
kSize
};
- explicit FunctionEntry(Vector<unsigned> backing) : backing_(backing) { }
- FunctionEntry() { }
+ explicit FunctionEntry(Vector<unsigned> backing)
+ : backing_(backing) { }
+
+ FunctionEntry() : backing_() { }
int start_pos() { return backing_[kStartPositionIndex]; }
int end_pos() { return backing_[kEndPositionIndex]; }
@@ -94,6 +96,7 @@ class FunctionEntry BASE_EMBEDDED {
private:
Vector<unsigned> backing_;
+ bool owns_data_;
};
@@ -166,7 +169,7 @@ class ParserApi {
// Parses the source code represented by the compilation info and sets its
// function literal. Returns false (and deallocates any allocated AST
// nodes) if parsing failed.
- static bool Parse(CompilationInfo* info);
+ static bool Parse(CompilationInfo* info, int flags);
// Generic preparser generating full preparse data.
static ScriptDataImpl* PreParse(UC16CharacterStream* source,
@@ -422,13 +425,20 @@ class RegExpParser {
// ----------------------------------------------------------------------------
// JAVASCRIPT PARSING
+// Forward declaration.
+class SingletonLogger;
+
class Parser {
public:
Parser(Handle<Script> script,
- bool allow_natives_syntax,
+ int parsing_flags, // Combination of ParsingFlags
v8::Extension* extension,
ScriptDataImpl* pre_data);
- virtual ~Parser() { }
+ virtual ~Parser() {
+ if (reusable_preparser_ != NULL) {
+ delete reusable_preparser_;
+ }
+ }
// Returns NULL if parsing failed.
FunctionLiteral* ParseProgram(CompilationInfo* info);
@@ -728,12 +738,15 @@ class Parser {
Handle<String> type,
Vector< Handle<Object> > arguments);
+ preparser::PreParser::PreParseResult LazyParseFunctionLiteral(
+ SingletonLogger* logger);
+
Isolate* isolate_;
ZoneList<Handle<String> > symbol_cache_;
Handle<Script> script_;
Scanner scanner_;
-
+ preparser::PreParser* reusable_preparser_;
Scope* top_scope_;
FunctionState* current_function_state_;
Target* target_stack_; // for break, continue statements
@@ -743,6 +756,7 @@ class Parser {
Mode mode_;
bool allow_natives_syntax_;
+ bool allow_lazy_;
bool stack_overflow_;
// If true, the next (and immediately following) function literal is
// preceded by a parenthesis.
« no previous file with comments | « src/liveedit.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698