Index: src/ast-numbering.cc |
diff --git a/src/ast-numbering.cc b/src/ast-numbering.cc |
index 8dfdccb966524f352afc7d3ff1a69754918435bd..e87842405e689a0aee131ac299b6111a1f285872 100644 |
--- a/src/ast-numbering.cc |
+++ b/src/ast-numbering.cc |
@@ -39,10 +39,7 @@ class AstNumberingVisitor FINAL : public AstVisitor { |
return tmp; |
} |
- void IncrementNodeCount() { properties_.add_node_count(1); } |
- |
int next_id_; |
- AstProperties properties_; |
DEFINE_AST_VISITOR_SUBCLASS_MEMBERS(); |
DISALLOW_COPY_AND_ASSIGN(AstNumberingVisitor); |
@@ -50,127 +47,102 @@ class AstNumberingVisitor FINAL : public AstVisitor { |
void AstNumberingVisitor::VisitVariableDeclaration(VariableDeclaration* node) { |
- IncrementNodeCount(); |
VisitVariableProxy(node->proxy()); |
} |
void AstNumberingVisitor::VisitExportDeclaration(ExportDeclaration* node) { |
- IncrementNodeCount(); |
VisitVariableProxy(node->proxy()); |
} |
-void AstNumberingVisitor::VisitModuleUrl(ModuleUrl* node) { |
- IncrementNodeCount(); |
-} |
+void AstNumberingVisitor::VisitModuleUrl(ModuleUrl* node) {} |
-void AstNumberingVisitor::VisitEmptyStatement(EmptyStatement* node) { |
- IncrementNodeCount(); |
-} |
+void AstNumberingVisitor::VisitEmptyStatement(EmptyStatement* node) {} |
-void AstNumberingVisitor::VisitContinueStatement(ContinueStatement* node) { |
- IncrementNodeCount(); |
-} |
+void AstNumberingVisitor::VisitContinueStatement(ContinueStatement* node) {} |
-void AstNumberingVisitor::VisitBreakStatement(BreakStatement* node) { |
- IncrementNodeCount(); |
-} |
+void AstNumberingVisitor::VisitBreakStatement(BreakStatement* node) {} |
void AstNumberingVisitor::VisitDebuggerStatement(DebuggerStatement* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(DebuggerStatement::num_ids())); |
} |
void AstNumberingVisitor::VisitNativeFunctionLiteral( |
NativeFunctionLiteral* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(NativeFunctionLiteral::num_ids())); |
} |
void AstNumberingVisitor::VisitLiteral(Literal* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(Literal::num_ids())); |
} |
void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(RegExpLiteral::num_ids())); |
} |
void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(VariableProxy::num_ids())); |
} |
void AstNumberingVisitor::VisitThisFunction(ThisFunction* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(ThisFunction::num_ids())); |
} |
void AstNumberingVisitor::VisitSuperReference(SuperReference* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(SuperReference::num_ids())); |
Visit(node->this_var()); |
} |
void AstNumberingVisitor::VisitModuleDeclaration(ModuleDeclaration* node) { |
- IncrementNodeCount(); |
VisitVariableProxy(node->proxy()); |
Visit(node->module()); |
} |
void AstNumberingVisitor::VisitImportDeclaration(ImportDeclaration* node) { |
- IncrementNodeCount(); |
VisitVariableProxy(node->proxy()); |
Visit(node->module()); |
} |
void AstNumberingVisitor::VisitModuleVariable(ModuleVariable* node) { |
- IncrementNodeCount(); |
Visit(node->proxy()); |
} |
void AstNumberingVisitor::VisitModulePath(ModulePath* node) { |
- IncrementNodeCount(); |
Visit(node->module()); |
} |
void AstNumberingVisitor::VisitModuleStatement(ModuleStatement* node) { |
- IncrementNodeCount(); |
Visit(node->body()); |
} |
void AstNumberingVisitor::VisitExpressionStatement(ExpressionStatement* node) { |
- IncrementNodeCount(); |
Visit(node->expression()); |
} |
void AstNumberingVisitor::VisitReturnStatement(ReturnStatement* node) { |
- IncrementNodeCount(); |
Visit(node->expression()); |
} |
void AstNumberingVisitor::VisitYield(Yield* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(Yield::num_ids())); |
Visit(node->generator_object()); |
Visit(node->expression()); |
@@ -178,28 +150,24 @@ void AstNumberingVisitor::VisitYield(Yield* node) { |
void AstNumberingVisitor::VisitThrow(Throw* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(Throw::num_ids())); |
Visit(node->exception()); |
} |
void AstNumberingVisitor::VisitUnaryOperation(UnaryOperation* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(UnaryOperation::num_ids())); |
Visit(node->expression()); |
} |
void AstNumberingVisitor::VisitCountOperation(CountOperation* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(CountOperation::num_ids())); |
Visit(node->expression()); |
} |
void AstNumberingVisitor::VisitBlock(Block* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(Block::num_ids())); |
if (node->scope() != NULL) VisitDeclarations(node->scope()->declarations()); |
VisitStatements(node->statements()); |
@@ -207,34 +175,29 @@ void AstNumberingVisitor::VisitBlock(Block* node) { |
void AstNumberingVisitor::VisitFunctionDeclaration(FunctionDeclaration* node) { |
- IncrementNodeCount(); |
VisitVariableProxy(node->proxy()); |
VisitFunctionLiteral(node->fun()); |
} |
void AstNumberingVisitor::VisitModuleLiteral(ModuleLiteral* node) { |
- IncrementNodeCount(); |
VisitBlock(node->body()); |
} |
void AstNumberingVisitor::VisitCallRuntime(CallRuntime* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(CallRuntime::num_ids())); |
VisitArguments(node->arguments()); |
} |
void AstNumberingVisitor::VisitWithStatement(WithStatement* node) { |
- IncrementNodeCount(); |
Visit(node->expression()); |
Visit(node->statement()); |
} |
void AstNumberingVisitor::VisitDoWhileStatement(DoWhileStatement* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(DoWhileStatement::num_ids())); |
Visit(node->body()); |
Visit(node->cond()); |
@@ -242,7 +205,6 @@ void AstNumberingVisitor::VisitDoWhileStatement(DoWhileStatement* node) { |
void AstNumberingVisitor::VisitWhileStatement(WhileStatement* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(WhileStatement::num_ids())); |
Visit(node->cond()); |
Visit(node->body()); |
@@ -250,21 +212,18 @@ void AstNumberingVisitor::VisitWhileStatement(WhileStatement* node) { |
void AstNumberingVisitor::VisitTryCatchStatement(TryCatchStatement* node) { |
- IncrementNodeCount(); |
Visit(node->try_block()); |
Visit(node->catch_block()); |
} |
void AstNumberingVisitor::VisitTryFinallyStatement(TryFinallyStatement* node) { |
- IncrementNodeCount(); |
Visit(node->try_block()); |
Visit(node->finally_block()); |
} |
void AstNumberingVisitor::VisitProperty(Property* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(Property::num_ids())); |
Visit(node->key()); |
Visit(node->obj()); |
@@ -272,7 +231,6 @@ void AstNumberingVisitor::VisitProperty(Property* 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()); |
@@ -281,7 +239,6 @@ void AstNumberingVisitor::VisitAssignment(Assignment* node) { |
void AstNumberingVisitor::VisitBinaryOperation(BinaryOperation* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(BinaryOperation::num_ids())); |
Visit(node->left()); |
Visit(node->right()); |
@@ -289,7 +246,6 @@ void AstNumberingVisitor::VisitBinaryOperation(BinaryOperation* node) { |
void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(CompareOperation::num_ids())); |
Visit(node->left()); |
Visit(node->right()); |
@@ -297,7 +253,6 @@ void AstNumberingVisitor::VisitCompareOperation(CompareOperation* node) { |
void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(ForInStatement::num_ids())); |
Visit(node->each()); |
Visit(node->enumerable()); |
@@ -306,7 +261,6 @@ void AstNumberingVisitor::VisitForInStatement(ForInStatement* node) { |
void AstNumberingVisitor::VisitForOfStatement(ForOfStatement* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(ForOfStatement::num_ids())); |
Visit(node->assign_iterator()); |
Visit(node->next_result()); |
@@ -317,7 +271,6 @@ void AstNumberingVisitor::VisitForOfStatement(ForOfStatement* node) { |
void AstNumberingVisitor::VisitConditional(Conditional* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(Conditional::num_ids())); |
Visit(node->condition()); |
Visit(node->then_expression()); |
@@ -326,7 +279,6 @@ void AstNumberingVisitor::VisitConditional(Conditional* node) { |
void AstNumberingVisitor::VisitIfStatement(IfStatement* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(IfStatement::num_ids())); |
Visit(node->condition()); |
Visit(node->then_statement()); |
@@ -337,7 +289,6 @@ void AstNumberingVisitor::VisitIfStatement(IfStatement* node) { |
void AstNumberingVisitor::VisitSwitchStatement(SwitchStatement* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(SwitchStatement::num_ids())); |
Visit(node->tag()); |
ZoneList<CaseClause*>* cases = node->cases(); |
@@ -348,7 +299,6 @@ void AstNumberingVisitor::VisitSwitchStatement(SwitchStatement* node) { |
void AstNumberingVisitor::VisitCaseClause(CaseClause* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(CaseClause::num_ids())); |
if (!node->is_default()) Visit(node->label()); |
VisitStatements(node->statements()); |
@@ -356,7 +306,6 @@ void AstNumberingVisitor::VisitCaseClause(CaseClause* node) { |
void AstNumberingVisitor::VisitForStatement(ForStatement* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(ForStatement::num_ids())); |
if (node->init() != NULL) Visit(node->init()); |
if (node->cond() != NULL) Visit(node->cond()); |
@@ -366,7 +315,6 @@ void AstNumberingVisitor::VisitForStatement(ForStatement* node) { |
void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(ClassLiteral::num_ids())); |
if (node->extends()) Visit(node->extends()); |
if (node->constructor()) Visit(node->constructor()); |
@@ -377,7 +325,6 @@ void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) { |
void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(ObjectLiteral::num_ids())); |
for (int i = 0; i < node->properties()->length(); i++) { |
VisitObjectLiteralProperty(node->properties()->at(i)); |
@@ -393,7 +340,6 @@ void AstNumberingVisitor::VisitObjectLiteralProperty( |
void AstNumberingVisitor::VisitArrayLiteral(ArrayLiteral* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(node->num_ids())); |
for (int i = 0; i < node->values()->length(); i++) { |
Visit(node->values()->at(i)); |
@@ -402,7 +348,6 @@ void AstNumberingVisitor::VisitArrayLiteral(ArrayLiteral* node) { |
void AstNumberingVisitor::VisitCall(Call* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(Call::num_ids())); |
Visit(node->expression()); |
VisitArguments(node->arguments()); |
@@ -410,7 +355,6 @@ void AstNumberingVisitor::VisitCall(Call* node) { |
void AstNumberingVisitor::VisitCallNew(CallNew* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(CallNew::num_ids())); |
Visit(node->expression()); |
VisitArguments(node->arguments()); |
@@ -441,7 +385,6 @@ void AstNumberingVisitor::VisitArguments(ZoneList<Expression*>* arguments) { |
void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { |
- IncrementNodeCount(); |
node->set_base_id(ReserveIdRange(FunctionLiteral::num_ids())); |
// We don't recurse into the declarations or body of the function literal: |
// you have to separately Renumber() each FunctionLiteral that you compile. |
@@ -449,10 +392,6 @@ void AstNumberingVisitor::VisitFunctionLiteral(FunctionLiteral* node) { |
void AstNumberingVisitor::Renumber(FunctionLiteral* node) { |
- properties_.flags()->Add(*node->flags()); |
- properties_.increase_feedback_slots(node->slot_count()); |
- properties_.increase_ic_feedback_slots(node->ic_slot_count()); |
- |
if (node->scope()->HasIllegalRedeclaration()) { |
node->scope()->VisitIllegalRedeclaration(this); |
return; |
@@ -465,8 +404,6 @@ void AstNumberingVisitor::Renumber(FunctionLiteral* node) { |
Visit(scope->function()); |
} |
VisitStatements(node->body()); |
- |
- node->set_ast_properties(&properties_); |
} |