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

Side by Side Diff: src/ast/scopes.h

Issue 2270743002: Scopes: simplfy scope creation for with scopes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 4 years, 3 months 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
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')
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_AST_SCOPES_H_ 5 #ifndef V8_AST_SCOPES_H_
6 #define V8_AST_SCOPES_H_ 6 #define V8_AST_SCOPES_H_
7 7
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/base/hashmap.h" 9 #include "src/base/hashmap.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 436
437 // Check that all Scopes in the scope tree use the same Zone. 437 // Check that all Scopes in the scope tree use the same Zone.
438 void CheckZones(); 438 void CheckZones();
439 #endif 439 #endif
440 440
441 // Retrieve `IsSimpleParameterList` of current or outer function. 441 // Retrieve `IsSimpleParameterList` of current or outer function.
442 bool HasSimpleParameters(); 442 bool HasSimpleParameters();
443 void set_is_debug_evaluate_scope() { is_debug_evaluate_scope_ = true; } 443 void set_is_debug_evaluate_scope() { is_debug_evaluate_scope_ = true; }
444 444
445 protected: 445 protected:
446 // Creates a script scope. 446 explicit Scope(Zone* zone, ScopeType scope_type = SCRIPT_SCOPE);
447 explicit Scope(Zone* zone);
448 447
449 void set_language_mode(LanguageMode language_mode) { 448 void set_language_mode(LanguageMode language_mode) {
450 is_strict_ = is_strict(language_mode); 449 is_strict_ = is_strict(language_mode);
451 } 450 }
452 451
453 private: 452 private:
454 Variable* Declare(Zone* zone, Scope* scope, const AstRawString* name, 453 Variable* Declare(Zone* zone, Scope* scope, const AstRawString* name,
455 VariableMode mode, Variable::Kind kind, 454 VariableMode mode, Variable::Kind kind,
456 InitializationFlag initialization_flag, 455 InitializationFlag initialization_flag,
457 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned) { 456 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned) {
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
924 void AllocateModuleVariables(); 923 void AllocateModuleVariables();
925 924
926 private: 925 private:
927 ModuleDescriptor* module_descriptor_; 926 ModuleDescriptor* module_descriptor_;
928 }; 927 };
929 928
930 } // namespace internal 929 } // namespace internal
931 } // namespace v8 930 } // namespace v8
932 931
933 #endif // V8_AST_SCOPES_H_ 932 #endif // V8_AST_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/ast/scopes.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698