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

Side by Side Diff: src/parser.h

Issue 716833002: Various clean-ups after top-level lexical declarations are done. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Patch for landing Created 6 years, 1 month 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/objects-inl.h ('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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698