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

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

Issue 2955793002: Revert of Make some functions that are hit during renderer startup available for inlining (Closed)
Patch Set: Created 3 years, 6 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 | « src/ast/scopes.h ('k') | src/ast/variables.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 #include "src/ast/scopes.h" 5 #include "src/ast/scopes.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/ast/ast.h" 10 #include "src/ast/ast.h"
(...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1227 DCHECK_EQ(var->mode(), VAR); 1227 DCHECK_EQ(var->mode(), VAR);
1228 var->set_maybe_assigned(); 1228 var->set_maybe_assigned();
1229 } 1229 }
1230 var->set_is_used(); 1230 var->set_is_used();
1231 return var; 1231 return var;
1232 } else { 1232 } else {
1233 return variables_.DeclareName(zone(), name, mode); 1233 return variables_.DeclareName(zone(), name, mode);
1234 } 1234 }
1235 } 1235 }
1236 1236
1237 VariableProxy* Scope::NewUnresolved(AstNodeFactory* factory,
1238 const AstRawString* name,
1239 int start_position, VariableKind kind) {
1240 // Note that we must not share the unresolved variables with
1241 // the same name because they may be removed selectively via
1242 // RemoveUnresolved().
1243 DCHECK(!already_resolved_);
1244 DCHECK_EQ(factory->zone(), zone());
1245 VariableProxy* proxy = factory->NewVariableProxy(name, kind, start_position);
1246 proxy->set_next_unresolved(unresolved_);
1247 unresolved_ = proxy;
1248 return proxy;
1249 }
1250
1237 void Scope::AddUnresolved(VariableProxy* proxy) { 1251 void Scope::AddUnresolved(VariableProxy* proxy) {
1238 DCHECK(!already_resolved_); 1252 DCHECK(!already_resolved_);
1239 DCHECK(!proxy->is_resolved()); 1253 DCHECK(!proxy->is_resolved());
1240 proxy->set_next_unresolved(unresolved_); 1254 proxy->set_next_unresolved(unresolved_);
1241 unresolved_ = proxy; 1255 unresolved_ = proxy;
1242 } 1256 }
1243 1257
1244 Variable* DeclarationScope::DeclareDynamicGlobal(const AstRawString* name, 1258 Variable* DeclarationScope::DeclareDynamicGlobal(const AstRawString* name,
1245 VariableKind kind) { 1259 VariableKind kind) {
1246 DCHECK(is_script_scope()); 1260 DCHECK(is_script_scope());
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
2354 Variable* function = 2368 Variable* function =
2355 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; 2369 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr;
2356 bool is_function_var_in_context = 2370 bool is_function_var_in_context =
2357 function != nullptr && function->IsContextSlot(); 2371 function != nullptr && function->IsContextSlot();
2358 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - 2372 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS -
2359 (is_function_var_in_context ? 1 : 0); 2373 (is_function_var_in_context ? 1 : 0);
2360 } 2374 }
2361 2375
2362 } // namespace internal 2376 } // namespace internal
2363 } // namespace v8 2377 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/scopes.h ('k') | src/ast/variables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698