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

Side by Side Diff: src/scopes.cc

Issue 6691054: [Arguments] Merge (7442,7496] from bleeding_edge. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/arguments
Patch Set: Created 9 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « src/scopes.h ('k') | src/stub-cache.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 } 314 }
315 315
316 316
317 void Scope::AddParameter(Variable* var) { 317 void Scope::AddParameter(Variable* var) {
318 ASSERT(is_function_scope()); 318 ASSERT(is_function_scope());
319 ASSERT(LocalLookup(var->name()) == var); 319 ASSERT(LocalLookup(var->name()) == var);
320 params_.Add(var); 320 params_.Add(var);
321 } 321 }
322 322
323 323
324 VariableProxy* Scope::NewUnresolved(Handle<String> name, bool inside_with) { 324 VariableProxy* Scope::NewUnresolved(Handle<String> name,
325 bool inside_with,
326 int position) {
325 // Note that we must not share the unresolved variables with 327 // Note that we must not share the unresolved variables with
326 // the same name because they may be removed selectively via 328 // the same name because they may be removed selectively via
327 // RemoveUnresolved(). 329 // RemoveUnresolved().
328 ASSERT(!resolved()); 330 ASSERT(!resolved());
329 VariableProxy* proxy = new VariableProxy(name, false, inside_with); 331 VariableProxy* proxy = new VariableProxy(name, false, inside_with, position);
330 unresolved_.Add(proxy); 332 unresolved_.Add(proxy);
331 return proxy; 333 return proxy;
332 } 334 }
333 335
334 336
335 void Scope::RemoveUnresolved(VariableProxy* var) { 337 void Scope::RemoveUnresolved(VariableProxy* var) {
336 // Most likely (always?) any variable we want to remove 338 // Most likely (always?) any variable we want to remove
337 // was just added before, so we search backwards. 339 // was just added before, so we search backwards.
338 for (int i = unresolved_.length(); i-- > 0;) { 340 for (int i = unresolved_.length(); i-- > 0;) {
339 if (unresolved_[i] == var) { 341 if (unresolved_[i] == var) {
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
980 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && 982 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS &&
981 !must_have_local_context) { 983 !must_have_local_context) {
982 num_heap_slots_ = 0; 984 num_heap_slots_ = 0;
983 } 985 }
984 986
985 // Allocation done. 987 // Allocation done.
986 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); 988 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS);
987 } 989 }
988 990
989 } } // namespace v8::internal 991 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/scopes.h ('k') | src/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698