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

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

Issue 2608333003: PreParsing inner funcs: Do fewer variable name lookups. (Closed)
Patch Set: code review (jochen@) Created 3 years, 11 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') | 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_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/base/compiler-specific.h" 8 #include "src/base/compiler-specific.h"
9 #include "src/base/hashmap.h" 9 #include "src/base/hashmap.h"
10 #include "src/globals.h" 10 #include "src/globals.h"
(...skipping 16 matching lines...) Expand all
27 class VariableMap: public ZoneHashMap { 27 class VariableMap: public ZoneHashMap {
28 public: 28 public:
29 explicit VariableMap(Zone* zone); 29 explicit VariableMap(Zone* zone);
30 30
31 Variable* Declare(Zone* zone, Scope* scope, const AstRawString* name, 31 Variable* Declare(Zone* zone, Scope* scope, const AstRawString* name,
32 VariableMode mode, VariableKind kind, 32 VariableMode mode, VariableKind kind,
33 InitializationFlag initialization_flag, 33 InitializationFlag initialization_flag,
34 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned, 34 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned,
35 bool* added = nullptr); 35 bool* added = nullptr);
36 36
37 // Records that "name" exists but doesn't create a Variable. Useful for 37 // Records that "name" exists (if not recorded yet) but doesn't create a
38 // preparsing. 38 // Variable. Useful for preparsing.
39 void DeclareName(Zone* zone, const AstRawString* name); 39 void DeclareName(Zone* zone, const AstRawString* name);
40 40
41 Variable* Lookup(const AstRawString* name); 41 Variable* Lookup(const AstRawString* name);
42 void Remove(Variable* var); 42 void Remove(Variable* var);
43 void Add(Zone* zone, Variable* var); 43 void Add(Zone* zone, Variable* var);
44 }; 44 };
45 45
46 46
47 // Sloppy block-scoped function declarations to var-bind 47 // Sloppy block-scoped function declarations to var-bind
48 class SloppyBlockFunctionMap : public ZoneHashMap { 48 class SloppyBlockFunctionMap : public ZoneHashMap {
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
873 void AllocateModuleVariables(); 873 void AllocateModuleVariables();
874 874
875 private: 875 private:
876 ModuleDescriptor* module_descriptor_; 876 ModuleDescriptor* module_descriptor_;
877 }; 877 };
878 878
879 } // namespace internal 879 } // namespace internal
880 } // namespace v8 880 } // namespace v8
881 881
882 #endif // V8_AST_SCOPES_H_ 882 #endif // V8_AST_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698