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

Side by Side Diff: src/ast/ast-numbering.cc

Issue 2277253003: [modules] Partial scope info support of modules (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@modules-refactor
Patch Set: Created 4 years, 3 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
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/ast-numbering.h" 5 #include "src/ast/ast-numbering.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 if (scope->new_target_var()) DisableCrankshaft(kSuperReference); 572 if (scope->new_target_var()) DisableCrankshaft(kSuperReference);
573 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval); 573 if (scope->calls_eval()) DisableOptimization(kFunctionCallsEval);
574 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) { 574 if (scope->arguments() != NULL && !scope->arguments()->IsStackAllocated()) {
575 DisableCrankshaft(kContextAllocatedArguments); 575 DisableCrankshaft(kContextAllocatedArguments);
576 } 576 }
577 577
578 if (scope->rest_parameter() != nullptr) { 578 if (scope->rest_parameter() != nullptr) {
579 DisableCrankshaft(kRestParameter); 579 DisableCrankshaft(kRestParameter);
580 } 580 }
581 581
582 if (FLAG_ignition && scope->NeedsContext() && scope->is_script_scope()) { 582 if (FLAG_ignition && scope->NeedsContext() &&
583 (scope->is_script_scope() || scope->is_module_scope())) {
583 // Create ScopeInfo while on the main thread to avoid allocation during 584 // Create ScopeInfo while on the main thread to avoid allocation during
584 // potentially concurrent bytecode generation. 585 // potentially concurrent bytecode generation.
585 node->scope()->GetScopeInfo(isolate_); 586 node->scope()->GetScopeInfo(isolate_);
586 } 587 }
587 588
588 if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) { 589 if (IsGeneratorFunction(node->kind()) || IsAsyncFunction(node->kind())) {
589 // TODO(neis): We may want to allow Turbofan optimization here if 590 // TODO(neis): We may want to allow Turbofan optimization here if
590 // --turbo-from-bytecode is set and we know that Ignition is used. 591 // --turbo-from-bytecode is set and we know that Ignition is used.
591 // Unfortunately we can't express that here. 592 // Unfortunately we can't express that here.
592 DisableOptimization(kGenerator); 593 DisableOptimization(kGenerator);
593 } 594 }
594 595
595 VisitDeclarations(scope->declarations()); 596 VisitDeclarations(scope->declarations());
596 VisitStatements(node->body()); 597 VisitStatements(node->body());
597 598
598 node->set_ast_properties(&properties_); 599 node->set_ast_properties(&properties_);
599 node->set_dont_optimize_reason(dont_optimize_reason()); 600 node->set_dont_optimize_reason(dont_optimize_reason());
600 node->set_yield_count(yield_count_); 601 node->set_yield_count(yield_count_);
601 return !HasStackOverflow(); 602 return !HasStackOverflow();
602 } 603 }
603 604
604 605
605 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, 606 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone,
606 FunctionLiteral* function) { 607 FunctionLiteral* function) {
607 AstNumberingVisitor visitor(isolate, zone); 608 AstNumberingVisitor visitor(isolate, zone);
608 return visitor.Renumber(function); 609 return visitor.Renumber(function);
609 } 610 }
610 } // namespace internal 611 } // namespace internal
611 } // namespace v8 612 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698