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

Side by Side Diff: src/scopes.cc

Issue 923683002: Fix lazy parsing for functions that use super. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Increment the PreparserData version Created 5 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 | « src/preparser.cc ('k') | test/cctest/test-parsing.cc » ('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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/scopes.h" 7 #include "src/scopes.h"
8 8
9 #include "src/accessors.h" 9 #include "src/accessors.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 365 }
366 366
367 // Move unresolved variables 367 // Move unresolved variables
368 for (int i = 0; i < unresolved_.length(); i++) { 368 for (int i = 0; i < unresolved_.length(); i++) {
369 outer_scope()->unresolved_.Add(unresolved_[i], zone()); 369 outer_scope()->unresolved_.Add(unresolved_[i], zone());
370 } 370 }
371 371
372 // Propagate usage flags to outer scope. 372 // Propagate usage flags to outer scope.
373 if (uses_arguments()) outer_scope_->RecordArgumentsUsage(); 373 if (uses_arguments()) outer_scope_->RecordArgumentsUsage();
374 if (uses_super_property()) outer_scope_->RecordSuperPropertyUsage(); 374 if (uses_super_property()) outer_scope_->RecordSuperPropertyUsage();
375 if (uses_super_constructor_call()) 375 if (uses_super_constructor_call()) {
376 outer_scope_->RecordSuperConstructorCallUsage(); 376 outer_scope_->RecordSuperConstructorCallUsage();
377 }
377 if (uses_this()) outer_scope_->RecordThisUsage(); 378 if (uses_this()) outer_scope_->RecordThisUsage();
378 379
379 return NULL; 380 return NULL;
380 } 381 }
381 382
382 383
383 Variable* Scope::LookupLocal(const AstRawString* name) { 384 Variable* Scope::LookupLocal(const AstRawString* name) {
384 Variable* result = variables_.Lookup(name); 385 Variable* result = variables_.Lookup(name);
385 if (result != NULL || scope_info_.is_null()) { 386 if (result != NULL || scope_info_.is_null()) {
386 return result; 387 return result;
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 } 1438 }
1438 1439
1439 1440
1440 int Scope::ContextLocalCount() const { 1441 int Scope::ContextLocalCount() const {
1441 if (num_heap_slots() == 0) return 0; 1442 if (num_heap_slots() == 0) return 0;
1442 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - 1443 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS -
1443 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0); 1444 (function_ != NULL && function_->proxy()->var()->IsContextSlot() ? 1 : 0);
1444 } 1445 }
1445 1446
1446 } } // namespace v8::internal 1447 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/preparser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698