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

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

Issue 2648503002: [Compiler] Have renumber recurse into eagerly compiled function literals. (Closed)
Patch Set: Add comment Created 3 years, 11 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 | « no previous file | src/compiler.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/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 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/objects-inl.h" 10 #include "src/objects-inl.h"
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments) { 591 void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments) {
592 for (int i = 0; i < arguments->length(); i++) { 592 for (int i = 0; i < arguments->length(); i++) {
593 Visit(arguments->at(i)); 593 Visit(arguments->at(i));
594 } 594 }
595 } 595 }
596 596
597 597
598 void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { 598 void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) {
599 IncrementNodeCount(); 599 IncrementNodeCount();
600 node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids())); 600 node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids()));
601 if (eager_literals_ && node->ShouldEagerCompile()) { 601 if (node->ShouldEagerCompile()) {
602 eager_literals_->Add(new (zone()) 602 // If the function literal is being eagerly compiled, recurse into the
603 ThreadedListZoneEntry<FunctionLiteral*>(node)); 603 // declarations and body of the function literal.
604 if (!AstNumbering::Renumber(stack_limit_, zone_, node, eager_literals_)) {
605 SetStackOverflow();
606 return;
607 }
608 if (eager_literals_) {
609 eager_literals_->Add(new (zone())
610 ThreadedListZoneEntry<FunctionLiteral*>(node));
611 }
604 } 612 }
605 // We don't recurse into the declarations or body of the function literal:
606 // you have to separately Renumber() each FunctionLiteral that you compile.
607 ReserveFeedbackSlots(node); 613 ReserveFeedbackSlots(node);
608 } 614 }
609 615
610 616
611 void AstNumberingVisitor::VisitRewritableExpression( 617 void AstNumberingVisitor::VisitRewritableExpression(
612 RewritableExpression* node) { 618 RewritableExpression* node) {
613 IncrementNodeCount(); 619 IncrementNodeCount();
614 node->set_base_id(ReserveIdRange(RewritableExpression::num_ids())); 620 node->set_base_id(ReserveIdRange(RewritableExpression::num_ids()));
615 Visit(node->expression()); 621 Visit(node->expression());
616 } 622 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 Compiler::EagerInnerFunctionLiterals* eager_literals) { 669 Compiler::EagerInnerFunctionLiterals* eager_literals) {
664 DisallowHeapAllocation no_allocation; 670 DisallowHeapAllocation no_allocation;
665 DisallowHandleAllocation no_handles; 671 DisallowHandleAllocation no_handles;
666 DisallowHandleDereference no_deref; 672 DisallowHandleDereference no_deref;
667 673
668 AstNumberingVisitor visitor(stack_limit, zone, eager_literals); 674 AstNumberingVisitor visitor(stack_limit, zone, eager_literals);
669 return visitor.Renumber(function); 675 return visitor.Renumber(function);
670 } 676 }
671 } // namespace internal 677 } // namespace internal
672 } // namespace v8 678 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698