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

Side by Side Diff: src/parser.h

Issue 345573002: Infer whether a variable is assigned (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: A few more tests Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/ast.cc ('k') | src/parser.cc » ('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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PARSER_H_ 5 #ifndef V8_PARSER_H_
6 #define V8_PARSER_H_ 6 #define V8_PARSER_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/ast.h" 9 #include "src/ast.h"
10 #include "src/compiler.h" // For CachedDataMode 10 #include "src/compiler.h" // For CachedDataMode
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 // literal so it can be added as a constant function property. 461 // literal so it can be added as a constant function property.
462 static void CheckAssigningFunctionLiteralToProperty(Expression* left, 462 static void CheckAssigningFunctionLiteralToProperty(Expression* left,
463 Expression* right); 463 Expression* right);
464 464
465 // Keep track of eval() calls since they disable all local variable 465 // Keep track of eval() calls since they disable all local variable
466 // optimizations. This checks if expression is an eval call, and if yes, 466 // optimizations. This checks if expression is an eval call, and if yes,
467 // forwards the information to scope. 467 // forwards the information to scope.
468 void CheckPossibleEvalCall(Expression* expression, Scope* scope); 468 void CheckPossibleEvalCall(Expression* expression, Scope* scope);
469 469
470 // Determine if the expression is a variable proxy and mark it as being used 470 // Determine if the expression is a variable proxy and mark it as being used
471 // in an assignment or with a increment/decrement operator. This is currently 471 // in an assignment or with a increment/decrement operator.
472 // used on for the statically checking assignments to harmony const bindings. 472 static Expression* MarkExpressionAsAssigned(Expression* expression);
473 static Expression* MarkExpressionAsLValue(Expression* expression);
474 473
475 // Returns true if we have a binary expression between two numeric 474 // Returns true if we have a binary expression between two numeric
476 // literals. In that case, *x will be changed to an expression which is the 475 // literals. In that case, *x will be changed to an expression which is the
477 // computed value. 476 // computed value.
478 bool ShortcutNumericLiteralBinaryExpression( 477 bool ShortcutNumericLiteralBinaryExpression(
479 Expression** x, Expression* y, Token::Value op, int pos, 478 Expression** x, Expression* y, Token::Value op, int pos,
480 AstNodeFactory<AstConstructionVisitor>* factory); 479 AstNodeFactory<AstConstructionVisitor>* factory);
481 480
482 // Rewrites the following types of unary expressions: 481 // Rewrites the following types of unary expressions:
483 // not <literal> -> true / false 482 // not <literal> -> true / false
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 private: 834 private:
836 static const int kLiteralTypeSlot = 0; 835 static const int kLiteralTypeSlot = 0;
837 static const int kElementsSlot = 1; 836 static const int kElementsSlot = 1;
838 837
839 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); 838 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue);
840 }; 839 };
841 840
842 } } // namespace v8::internal 841 } } // namespace v8::internal
843 842
844 #endif // V8_PARSER_H_ 843 #endif // V8_PARSER_H_
OLDNEW
« no previous file with comments | « src/ast.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698