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

Unified Diff: src/preparser.h

Issue 150943008: Move parenthesized_function_ to ParserBase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 months 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') | no next file » | 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 b3f67c9a698a17920f67fd0c0d216ef28ac0bc22..7c6904055929d173964d7d794412d111341f6a7d 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -42,6 +42,7 @@ class ParserBase : public Traits {
ParserBase(Scanner* scanner, uintptr_t stack_limit,
typename Traits::ParserType this_object)
: Traits(this_object),
+ parenthesized_function_(false),
scanner_(scanner),
stack_limit_(stack_limit),
stack_overflow_(false),
@@ -281,6 +282,12 @@ class ParserBase : public Traits {
LanguageMode language_mode_;
};
+ // If true, the next (and immediately following) function literal is
+ // preceded by a parenthesis.
+ // Heuristically that means that the function will be called immediately,
+ // so never lazily compile it.
+ bool parenthesized_function_;
+
private:
Scanner* scanner_;
uintptr_t stack_limit_;
@@ -505,8 +512,7 @@ class PreParser : public ParserBase<PreParserTraits> {
uintptr_t stack_limit)
: ParserBase<PreParserTraits>(scanner, stack_limit, this),
log_(log),
- scope_(NULL),
- parenthesized_function_(false) { }
+ scope_(NULL) { }
~PreParser() {}
@@ -748,7 +754,6 @@ class PreParser : public ParserBase<PreParserTraits> {
ParserRecorder* log_;
Scope* scope_;
- bool parenthesized_function_;
};
« no previous file with comments | « src/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698