| 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 } | 420 } |
| 421 void PushPropertyName(FuncNameInferrer* fni, Expression* expression); | 421 void PushPropertyName(FuncNameInferrer* fni, Expression* expression); |
| 422 static void InferFunctionName(FuncNameInferrer* fni, | 422 static void InferFunctionName(FuncNameInferrer* fni, |
| 423 FunctionLiteral* func_to_infer) { | 423 FunctionLiteral* func_to_infer) { |
| 424 fni->AddFunction(func_to_infer); | 424 fni->AddFunction(func_to_infer); |
| 425 } | 425 } |
| 426 | 426 |
| 427 static void CheckFunctionLiteralInsideTopLevelObjectLiteral( | 427 static void CheckFunctionLiteralInsideTopLevelObjectLiteral( |
| 428 Scope* scope, ObjectLiteralProperty* property, bool* has_function) { | 428 Scope* scope, ObjectLiteralProperty* property, bool* has_function) { |
| 429 Expression* value = property->value(); | 429 Expression* value = property->value(); |
| 430 if (scope->DeclarationScope()->is_global_scope() && | 430 if (scope->DeclarationScope()->is_script_scope() && |
| 431 value->AsFunctionLiteral() != NULL) { | 431 value->AsFunctionLiteral() != NULL) { |
| 432 *has_function = true; | 432 *has_function = true; |
| 433 value->AsFunctionLiteral()->set_pretenure(); | 433 value->AsFunctionLiteral()->set_pretenure(); |
| 434 } | 434 } |
| 435 } | 435 } |
| 436 | 436 |
| 437 // If we assign a function literal to a property we pretenure the | 437 // If we assign a function literal to a property we pretenure the |
| 438 // literal so it can be added as a constant function property. | 438 // literal so it can be added as a constant function property. |
| 439 static void CheckAssigningFunctionLiteralToProperty(Expression* left, | 439 static void CheckAssigningFunctionLiteralToProperty(Expression* left, |
| 440 Expression* right); | 440 Expression* right); |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 private: | 922 private: |
| 923 static const int kLiteralTypeSlot = 0; | 923 static const int kLiteralTypeSlot = 0; |
| 924 static const int kElementsSlot = 1; | 924 static const int kElementsSlot = 1; |
| 925 | 925 |
| 926 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); | 926 DISALLOW_IMPLICIT_CONSTRUCTORS(CompileTimeValue); |
| 927 }; | 927 }; |
| 928 | 928 |
| 929 } } // namespace v8::internal | 929 } } // namespace v8::internal |
| 930 | 930 |
| 931 #endif // V8_PARSER_H_ | 931 #endif // V8_PARSER_H_ |
| OLD | NEW |