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

Unified Diff: src/ast/ast-numbering.cc

Issue 2764113002: [type-profile] Handle returns correctly. (Closed)
Patch Set: Rebase. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/ast.cc ('k') | src/feedback-vector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast-numbering.cc
diff --git a/src/ast/ast-numbering.cc b/src/ast/ast-numbering.cc
index 25ec2dbfe1a84c0fcb10fbd85545cfbf1eb64726..e9fdc4fa0059a0010857142a13748717d323bf44 100644
--- a/src/ast/ast-numbering.cc
+++ b/src/ast/ast-numbering.cc
@@ -33,13 +33,6 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
bool Renumber(FunctionLiteral* node);
- FeedbackSlot TypeProfileSlotForReturnValue() const {
- if (collect_type_profile_) {
- DCHECK(!type_profile_for_return_value_.IsInvalid());
- }
- return type_profile_for_return_value_;
- }
-
private:
// AST node visitor interface.
#define DEFINE_VISIT(type) void Visit##type(type* node);
@@ -111,7 +104,6 @@ class AstNumberingVisitor final : public AstVisitor<AstNumberingVisitor> {
BailoutReason dont_optimize_reason_;
HandlerTable::CatchPrediction catch_prediction_;
bool collect_type_profile_;
- FeedbackSlot type_profile_for_return_value_;
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS();
DISALLOW_COPY_AND_ASSIGN(AstNumberingVisitor);
@@ -245,8 +237,6 @@ void AstNumberingVisitor::VisitReturnStatement(ReturnStatement* node) {
IncrementNodeCount();
Visit(node->expression());
- node->SetTypeProfileSlot(TypeProfileSlotForReturnValue());
-
DCHECK(!node->is_async_return() ||
properties_.flags() & AstProperties::kMustUseIgnitionTurbo);
}
@@ -435,8 +425,7 @@ void AstNumberingVisitor::VisitAssignment(Assignment* node) {
if (node->is_compound()) VisitBinaryOperation(node->binary_operation());
VisitReference(node->target());
Visit(node->value());
- node->AssignFeedbackSlots(properties_.get_spec(), language_mode_,
- &slot_cache_, collect_type_profile_);
+ ReserveFeedbackSlots(node);
}
@@ -702,8 +691,7 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) {
LanguageModeScope language_mode_scope(this, node->language_mode());
if (collect_type_profile_) {
- type_profile_for_return_value_ =
- properties_.get_spec()->AddTypeProfileSlot();
+ node->SetTypeProfileSlot(properties_.get_spec()->AddTypeProfileSlot());
}
VisitDeclarations(scope->declarations());
« no previous file with comments | « src/ast/ast.cc ('k') | src/feedback-vector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698