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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
398 } | 398 } |
399 | 399 |
400 void PushPropertyName(FuncNameInferrer* fni, Expression* expression); | 400 void PushPropertyName(FuncNameInferrer* fni, Expression* expression); |
401 | 401 |
402 static void InferFunctionName(FuncNameInferrer* fni, | 402 static void InferFunctionName(FuncNameInferrer* fni, |
403 FunctionLiteral* func_to_infer) { | 403 FunctionLiteral* func_to_infer) { |
404 fni->AddFunction(func_to_infer); | 404 fni->AddFunction(func_to_infer); |
405 } | 405 } |
406 | 406 |
407 static void CheckFunctionLiteralInsideTopLevelObjectLiteral( | 407 static void CheckFunctionLiteralInsideTopLevelObjectLiteral( |
408 Scope* scope, ObjectLiteralProperty* property, bool* has_function) { | 408 Scope* scope, ObjectLiteralProperty* property) { |
409 Expression* value = property->value(); | 409 Expression* value = property->value(); |
410 if (scope->DeclarationScope()->is_script_scope() && | 410 if (scope->DeclarationScope()->is_script_scope() && |
411 value->AsFunctionLiteral() != NULL) { | 411 value->AsFunctionLiteral() != NULL) { |
412 *has_function = true; | |
413 value->AsFunctionLiteral()->set_pretenure(); | 412 value->AsFunctionLiteral()->set_pretenure(); |
adamk
2016/03/08 19:56:49
Does the pretenuring still make sense? My understa
Toon Verwaest
2016/03/08 20:10:27
Probably not. MigrateSlowToFast (for objects used
| |
414 } | 413 } |
415 } | 414 } |
416 | 415 |
417 // If we assign a function literal to a property we pretenure the | 416 // If we assign a function literal to a property we pretenure the |
418 // literal so it can be added as a constant function property. | 417 // literal so it can be added as a constant function property. |
419 static void CheckAssigningFunctionLiteralToProperty(Expression* left, | 418 static void CheckAssigningFunctionLiteralToProperty(Expression* left, |
420 Expression* right); | 419 Expression* right); |
421 | 420 |
422 // Determine if the expression is a variable proxy and mark it as being used | 421 // Determine if the expression is a variable proxy and mark it as being used |
423 // in an assignment or with a increment/decrement operator. | 422 // in an assignment or with a increment/decrement operator. |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1240 | 1239 |
1241 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { | 1240 DoExpression* ParserTraits::ParseDoExpression(bool* ok) { |
1242 return parser_->ParseDoExpression(ok); | 1241 return parser_->ParseDoExpression(ok); |
1243 } | 1242 } |
1244 | 1243 |
1245 | 1244 |
1246 } // namespace internal | 1245 } // namespace internal |
1247 } // namespace v8 | 1246 } // namespace v8 |
1248 | 1247 |
1249 #endif // V8_PARSING_PARSER_H_ | 1248 #endif // V8_PARSING_PARSER_H_ |
OLD | NEW |