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

Unified Diff: src/preparser.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/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index fbc852e3fd2101dc689c077b12fb10c43fd7dac7..fc8a4a0ca8eac7486d006527e1647def1b78f557 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -110,6 +110,24 @@ class PreParser {
kPreParseSuccess
};
+
+ PreParser(i::Scanner* scanner,
+ i::ParserRecorder* log,
+ uintptr_t stack_limit,
+ bool allow_lazy,
+ bool allow_natives_syntax)
+ : scanner_(scanner),
+ log_(log),
+ scope_(NULL),
+ stack_limit_(stack_limit),
+ strict_mode_violation_location_(i::Scanner::Location::invalid()),
+ strict_mode_violation_type_(NULL),
+ stack_overflow_(false),
+ allow_lazy_(allow_lazy),
+ allow_natives_syntax_(allow_natives_syntax),
+ parenthesized_function_(false),
+ harmony_scoping_(scanner->HarmonyScoping()) { }
+
~PreParser() {}
// Pre-parse the program from the character stream; returns true on
@@ -126,6 +144,17 @@ class PreParser {
allow_lazy, allow_natives_syntax).PreParse();
}
+ // Parses a single function literal, from the opening parentheses before
+ // parameters to the closing brace after the body.
+ // Returns a FunctionEntry describing the body of the funciton in enough
+ // detail that it can be lazily compiled.
+ // The scanner is expected to have matched the "function" keyword and
+ // parameters, and have consumed the initial '{'.
+ // At return, unless an error occured, the scanner is positioned before the
+ // the final '}'.
+ PreParseResult PreParseLazyFunction(i::LanguageMode mode,
+ i::ParserRecorder* log);
+
private:
// Used to detect duplicates in object literals. Each of the values
// kGetterProperty, kSetterProperty and kValueProperty represents
@@ -450,24 +479,6 @@ class PreParser {
i::LanguageMode language_mode_;
};
- // Private constructor only used in PreParseProgram.
- PreParser(i::Scanner* scanner,
- i::ParserRecorder* log,
- uintptr_t stack_limit,
- bool allow_lazy,
- bool allow_natives_syntax)
- : scanner_(scanner),
- log_(log),
- scope_(NULL),
- stack_limit_(stack_limit),
- strict_mode_violation_location_(i::Scanner::Location::invalid()),
- strict_mode_violation_type_(NULL),
- stack_overflow_(false),
- allow_lazy_(allow_lazy),
- allow_natives_syntax_(allow_natives_syntax),
- parenthesized_function_(false),
- harmony_scoping_(scanner->HarmonyScoping()) { }
-
// Preparse the program. Only called in PreParseProgram after creating
// the instance.
PreParseResult PreParse() {
@@ -547,6 +558,7 @@ class PreParser {
Arguments ParseArguments(bool* ok);
Expression ParseFunctionLiteral(bool* ok);
+ void ParseLazyFunctionLiteralBody(bool* ok);
Identifier ParseIdentifier(bool* ok);
Identifier ParseIdentifierName(bool* ok);
« no previous file with comments | « src/parser.cc ('k') | src/preparser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698