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

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

Issue 2233473002: Redirect most NewUnresolved calls over Parser (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 4 years, 4 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/parsing/parser.h » ('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/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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 Variable* DeclareLocal(const AstRawString* name, VariableMode mode, 153 Variable* DeclareLocal(const AstRawString* name, VariableMode mode,
154 InitializationFlag init_flag, Variable::Kind kind, 154 InitializationFlag init_flag, Variable::Kind kind,
155 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned); 155 MaybeAssignedFlag maybe_assigned_flag = kNotAssigned);
156 156
157 // Declarations list. 157 // Declarations list.
158 ZoneList<Declaration*>* declarations() { return &decls_; } 158 ZoneList<Declaration*>* declarations() { return &decls_; }
159 159
160 // Create a new unresolved variable. 160 // Create a new unresolved variable.
161 VariableProxy* NewUnresolved(AstNodeFactory* factory, 161 VariableProxy* NewUnresolved(AstNodeFactory* factory,
162 const AstRawString* name, 162 const AstRawString* name,
163 Variable::Kind kind = Variable::NORMAL,
164 int start_position = kNoSourcePosition, 163 int start_position = kNoSourcePosition,
165 int end_position = kNoSourcePosition) { 164 int end_position = kNoSourcePosition,
165 Variable::Kind kind = Variable::NORMAL) {
166 // Note that we must not share the unresolved variables with 166 // Note that we must not share the unresolved variables with
167 // the same name because they may be removed selectively via 167 // the same name because they may be removed selectively via
168 // RemoveUnresolved(). 168 // RemoveUnresolved().
169 DCHECK(!already_resolved()); 169 DCHECK(!already_resolved());
170 DCHECK_EQ(factory->zone(), zone()); 170 DCHECK_EQ(factory->zone(), zone());
171 VariableProxy* proxy = 171 VariableProxy* proxy =
172 factory->NewVariableProxy(name, kind, start_position, end_position); 172 factory->NewVariableProxy(name, kind, start_position, end_position);
173 proxy->set_next_unresolved(unresolved_); 173 proxy->set_next_unresolved(unresolved_);
174 unresolved_ = proxy; 174 unresolved_ = proxy;
175 return proxy; 175 return proxy;
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 // Convenience variable; Subclass constructor only 890 // Convenience variable; Subclass constructor only
891 Variable* this_function_; 891 Variable* this_function_;
892 // Module descriptor; module scopes only. 892 // Module descriptor; module scopes only.
893 ModuleDescriptor* module_descriptor_; 893 ModuleDescriptor* module_descriptor_;
894 }; 894 };
895 895
896 } // namespace internal 896 } // namespace internal
897 } // namespace v8 897 } // namespace v8
898 898
899 #endif // V8_AST_SCOPES_H_ 899 #endif // V8_AST_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698