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

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

Issue 2950993002: Make some functions that are hit during renderer startup available for inlining (Closed)
Patch Set: rebase Created 3 years, 5 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
1251 void Scope::AddUnresolved(VariableProxy* proxy) { 1237 void Scope::AddUnresolved(VariableProxy* proxy) {
1252 DCHECK(!already_resolved_); 1238 DCHECK(!already_resolved_);
1253 DCHECK(!proxy->is_resolved()); 1239 DCHECK(!proxy->is_resolved());
1254 proxy->set_next_unresolved(unresolved_); 1240 proxy->set_next_unresolved(unresolved_);
1255 unresolved_ = proxy; 1241 unresolved_ = proxy;
1256 } 1242 }
1257 1243
1258 Variable* DeclarationScope::DeclareDynamicGlobal(const AstRawString* name, 1244 Variable* DeclarationScope::DeclareDynamicGlobal(const AstRawString* name,
1259 VariableKind kind) { 1245 VariableKind kind) {
1260 DCHECK(is_script_scope()); 1246 DCHECK(is_script_scope());
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
2368 Variable* function = 2354 Variable* function =
2369 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr; 2355 is_function_scope() ? AsDeclarationScope()->function_var() : nullptr;
2370 bool is_function_var_in_context = 2356 bool is_function_var_in_context =
2371 function != nullptr && function->IsContextSlot(); 2357 function != nullptr && function->IsContextSlot();
2372 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - 2358 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS -
2373 (is_function_var_in_context ? 1 : 0); 2359 (is_function_var_in_context ? 1 : 0);
2374 } 2360 }
2375 2361
2376 } // namespace internal 2362 } // namespace internal
2377 } // namespace v8 2363 } // 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