Index: src/ast-numbering.cc |
diff --git a/src/ast-numbering.cc b/src/ast-numbering.cc |
index e14b84dfe8fc26dbc27ca768e59099a7f9f432a8..8676eeb995e064ffd5bb77c7097903459286de83 100644 |
--- a/src/ast-numbering.cc |
+++ b/src/ast-numbering.cc |
@@ -11,7 +11,7 @@ namespace internal { |
class AstNumberingVisitor final : public AstVisitor { |
public: |
- explicit AstNumberingVisitor(Isolate* isolate, Zone* zone) |
+ AstNumberingVisitor(Isolate* isolate, Zone* zone) |
: AstVisitor(), |
next_id_(BailoutId::FirstUsable().ToInt()), |
properties_(zone), |
@@ -30,6 +30,10 @@ class AstNumberingVisitor final : public AstVisitor { |
bool Finish(FunctionLiteral* node); |
+ void VisitVariableProxyReference(VariableProxy* node); |
+ void VisitPropertyReference(Property* node); |
+ void VisitReference(Expression* expr); |
+ |
void VisitStatements(ZoneList<Statement*>* statements) override; |
void VisitDeclarations(ZoneList<Declaration*>* declarations) override; |
void VisitArguments(ZoneList<Expression*>* arguments); |
@@ -145,16 +149,21 @@ void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) { |
} |
-void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) { |
+void AstNumberingVisitor::VisitVariableProxyReference(VariableProxy* node) { |
IncrementNodeCount(); |
if (node->var()->IsLookupSlot()) { |
DisableCrankshaft(kReferenceToAVariableWhichRequiresDynamicLookup); |
} |
- ReserveFeedbackSlots(node); |
node->set_base_id(ReserveIdRange(VariableProxy::num_ids())); |
} |
+void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) { |
+ VisitVariableProxyReference(node); |
+ ReserveFeedbackSlots(node); |
+} |
+ |
+ |
void AstNumberingVisitor::VisitThisFunction(ThisFunction* node) { |
IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(ThisFunction::num_ids())); |
@@ -304,20 +313,35 @@ void AstNumberingVisitor::VisitTryFinallyStatement(TryFinallyStatement* node) { |
} |
-void AstNumberingVisitor::VisitProperty(Property* node) { |
+void AstNumberingVisitor::VisitPropertyReference(Property* node) { |
IncrementNodeCount(); |
- ReserveFeedbackSlots(node); |
node->set_base_id(ReserveIdRange(Property::num_ids())); |
Visit(node->key()); |
Visit(node->obj()); |
} |
+void AstNumberingVisitor::VisitReference(Expression* expr) { |
+ DCHECK(expr->IsProperty() || expr->IsVariableProxy()); |
+ if (expr->IsProperty()) { |
+ VisitPropertyReference(expr->AsProperty()); |
+ } else { |
+ VisitVariableProxyReference(expr->AsVariableProxy()); |
+ } |
+} |
+ |
+ |
+void AstNumberingVisitor::VisitProperty(Property* node) { |
+ VisitPropertyReference(node); |
+ ReserveFeedbackSlots(node); |
+} |
+ |
+ |
void AstNumberingVisitor::VisitAssignment(Assignment* node) { |
IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(Assignment::num_ids())); |
if (node->is_compound()) VisitBinaryOperation(node->binary_operation()); |
- Visit(node->target()); |
+ VisitReference(node->target()); |
Visit(node->value()); |
ReserveFeedbackSlots(node); |
} |