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_PARSING_PARSER_H_ | 5 #ifndef V8_PARSING_PARSER_H_ |
6 #define V8_PARSING_PARSER_H_ | 6 #define V8_PARSING_PARSER_H_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/ast/ast.h" | 9 #include "src/ast/ast.h" |
10 #include "src/ast/scopes.h" | 10 #include "src/ast/scopes.h" |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 *has_function = true; | 409 *has_function = true; |
410 value->AsFunctionLiteral()->set_pretenure(); | 410 value->AsFunctionLiteral()->set_pretenure(); |
411 } | 411 } |
412 } | 412 } |
413 | 413 |
414 // If we assign a function literal to a property we pretenure the | 414 // If we assign a function literal to a property we pretenure the |
415 // literal so it can be added as a constant function property. | 415 // literal so it can be added as a constant function property. |
416 static void CheckAssigningFunctionLiteralToProperty(Expression* left, | 416 static void CheckAssigningFunctionLiteralToProperty(Expression* left, |
417 Expression* right); | 417 Expression* right); |
418 | 418 |
419 // Keep track of eval() calls since they disable all local variable | |
420 // optimizations. This checks if expression is an eval call, and if yes, | |
421 // forwards the information to scope. | |
422 void CheckPossibleEvalCall(Expression* expression, Scope* scope); | |
423 | |
424 // Determine if the expression is a variable proxy and mark it as being used | 419 // Determine if the expression is a variable proxy and mark it as being used |
425 // in an assignment or with a increment/decrement operator. | 420 // in an assignment or with a increment/decrement operator. |
426 static Expression* MarkExpressionAsAssigned(Expression* expression); | 421 static Expression* MarkExpressionAsAssigned(Expression* expression); |
427 | 422 |
428 // Returns true if we have a binary expression between two numeric | 423 // Returns true if we have a binary expression between two numeric |
429 // literals. In that case, *x will be changed to an expression which is the | 424 // literals. In that case, *x will be changed to an expression which is the |
430 // computed value. | 425 // computed value. |
431 bool ShortcutNumericLiteralBinaryExpression(Expression** x, Expression* y, | 426 bool ShortcutNumericLiteralBinaryExpression(Expression** x, Expression* y, |
432 Token::Value op, int pos, | 427 Token::Value op, int pos, |
433 AstNodeFactory* factory); | 428 AstNodeFactory* factory); |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 | 1187 |
1193 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1188 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1194 return parser_->ParseDoExpression(ok); | 1189 return parser_->ParseDoExpression(ok); |
1195 } | 1190 } |
1196 | 1191 |
1197 | 1192 |
1198 } // namespace internal | 1193 } // namespace internal |
1199 } // namespace v8 | 1194 } // namespace v8 |
1200 | 1195 |
1201 #endif // V8_PARSING_PARSER_H_ | 1196 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |