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

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

Issue 2693313002: [ast] Mark temporaries as maybe-assigned by default. (Closed)
Patch Set: Created 3 years, 10 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/parsing/parser.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/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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // addition introduced a new unresolved variable which may end up being 203 // addition introduced a new unresolved variable which may end up being
204 // allocated globally as a "ghost" variable. RemoveUnresolved removes 204 // allocated globally as a "ghost" variable. RemoveUnresolved removes
205 // such a variable again if it was added; otherwise this is a no-op. 205 // such a variable again if it was added; otherwise this is a no-op.
206 bool RemoveUnresolved(VariableProxy* var); 206 bool RemoveUnresolved(VariableProxy* var);
207 207
208 // Creates a new temporary variable in this scope's TemporaryScope. The 208 // Creates a new temporary variable in this scope's TemporaryScope. The
209 // name is only used for printing and cannot be used to find the variable. 209 // name is only used for printing and cannot be used to find the variable.
210 // In particular, the only way to get hold of the temporary is by keeping the 210 // In particular, the only way to get hold of the temporary is by keeping the
211 // Variable* around. The name should not clash with a legitimate variable 211 // Variable* around. The name should not clash with a legitimate variable
212 // names. 212 // names.
213 // Only pass kNotAssigned if you know what you are doing.
adamk 2017/02/15 19:03:59 Not sure this comment is helpful. If this is dange
213 // TODO(verwaest): Move to DeclarationScope? 214 // TODO(verwaest): Move to DeclarationScope?
214 Variable* NewTemporary(const AstRawString* name); 215 Variable* NewTemporary(const AstRawString* name,
216 MaybeAssignedFlag maybe_assigned = kMaybeAssigned);
215 217
216 // --------------------------------------------------------------------------- 218 // ---------------------------------------------------------------------------
217 // Illegal redeclaration support. 219 // Illegal redeclaration support.
218 220
219 // Check if the scope has conflicting var 221 // Check if the scope has conflicting var
220 // declarations, i.e. a var declaration that has been hoisted from a nested 222 // declarations, i.e. a var declaration that has been hoisted from a nested
221 // scope over a let binding of the same name. 223 // scope over a let binding of the same name.
222 Declaration* CheckConflictingVarDeclarations(); 224 Declaration* CheckConflictingVarDeclarations();
223 225
224 // Check if the scope has a conflicting lexical declaration that has a name in 226 // Check if the scope has a conflicting lexical declaration that has a name in
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 void AllocateModuleVariables(); 963 void AllocateModuleVariables();
962 964
963 private: 965 private:
964 ModuleDescriptor* module_descriptor_; 966 ModuleDescriptor* module_descriptor_;
965 }; 967 };
966 968
967 } // namespace internal 969 } // namespace internal
968 } // namespace v8 970 } // namespace v8
969 971
970 #endif // V8_AST_SCOPES_H_ 972 #endif // V8_AST_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | src/parsing/parser.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698