OLD | NEW |
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 Loading... |
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 Loading... |
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_ |
OLD | NEW |