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

Unified Diff: src/parser.h

Issue 206433003: Move ParseLeftHandSideExpression to ParserBase. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: code review Created 6 years, 9 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 | « no previous file | 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 333aaf55c16c244f3fe8c51de80bfa8232c363db..4febdc87696f1b667e4f240991703d3ee42b9cf9 100644
--- a/src/parser.h
+++ b/src/parser.h
@@ -490,6 +490,11 @@ class ParserTraits {
static void CheckAssigningFunctionLiteralToProperty(Expression* left,
Expression* right);
+ // Keep track of eval() calls since they disable all local variable
+ // optimizations. This checks if expression is an eval call, and if yes,
+ // forwards the information to scope.
+ void CheckPossibleEvalCall(Expression* expression, Scope* scope);
+
// Determine if the expression is a variable proxy and mark it as being used
// in an assignment or with a increment/decrement operator. This is currently
// used on for the statically checking assignments to harmony const bindings.
@@ -497,7 +502,7 @@ class ParserTraits {
// Checks LHS expression for assignment and prefix/postfix increment/decrement
// in strict mode.
- void CheckStrictModeLValue(Expression*expression, bool* ok);
+ void CheckStrictModeLValue(Expression* expression, bool* ok);
// Returns true if we have a binary expression between two numeric
// literals. In that case, *x will be changed to an expression which is the
@@ -584,7 +589,7 @@ class ParserTraits {
int function_token_position,
FunctionLiteral::FunctionType type,
bool* ok);
- Expression* ParseLeftHandSideExpression(bool* ok);
+ Expression* ParseMemberWithNewPrefixesExpression(bool* ok);
private:
Parser* parser_;
@@ -622,11 +627,6 @@ class Parser : public ParserBase<ParserTraits> {
// https://codereview.chromium.org/7003030/ ).
static const int kMaxNumFunctionLocals = 4194303; // 2^22-1
- enum Mode {
- PARSE_LAZILY,
- PARSE_EAGERLY
- };
-
enum VariableDeclarationContext {
kModuleElement,
kBlockElement,
@@ -640,22 +640,6 @@ class Parser : public ParserBase<ParserTraits> {
kHasNoInitializers
};
- class ParsingModeScope BASE_EMBEDDED {
- public:
- ParsingModeScope(Parser* parser, Mode mode)
- : parser_(parser),
- old_mode_(parser->mode()) {
- parser_->mode_ = mode;
- }
- ~ParsingModeScope() {
- parser_->mode_ = old_mode_;
- }
-
- private:
- Parser* parser_;
- Mode old_mode_;
- };
-
// Returns NULL if parsing failed.
FunctionLiteral* ParseProgram();
@@ -685,7 +669,6 @@ class Parser : public ParserBase<ParserTraits> {
}
bool inside_with() const { return scope_->inside_with(); }
- Mode mode() const { return mode_; }
ScriptDataImpl** cached_data() const { return cached_data_; }
CachedDataMode cached_data_mode() const { return cached_data_mode_; }
Scope* DeclarationScope(VariableMode mode) {
@@ -742,14 +725,10 @@ class Parser : public ParserBase<ParserTraits> {
// Support for hamony block scoped bindings.
Block* ParseScopedBlock(ZoneStringList* labels, bool* ok);
- Expression* ParseUnaryExpression(bool* ok);
- Expression* ParseLeftHandSideExpression(bool* ok);
Expression* ParseMemberWithNewPrefixesExpression(bool* ok);
Expression* ParseMemberExpression(bool* ok);
Expression* ParseMemberExpressionContinuation(Expression* expression,
bool* ok);
- Expression* ParseObjectLiteral(bool* ok);
-
// Initialize the components of a for-in / for-of statement.
void InitializeForEachStatement(ForEachStatement* stmt,
Expression* each,
@@ -835,8 +814,6 @@ class Parser : public ParserBase<ParserTraits> {
ScriptDataImpl** cached_data_;
CachedDataMode cached_data_mode_;
- Mode mode_;
-
CompilationInfo* info_;
};
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698