Index: src/ast/ast.cc |
diff --git a/src/ast/ast.cc b/src/ast/ast.cc |
index a10055a98f561554d7fb53d3ce7d4ba6e07e35dc..d0b51526a2814c5a7f93dac25122c5b84b11ecad 100644 |
--- a/src/ast/ast.cc |
+++ b/src/ast/ast.cc |
@@ -146,8 +146,8 @@ bool Expression::IsValidReferenceExpressionOrThis() const { |
bool Expression::IsAnonymousFunctionDefinition() const { |
return (IsFunctionLiteral() && |
AsFunctionLiteral()->IsAnonymousFunctionDefinition()) || |
- (IsClassLiteral() && |
- AsClassLiteral()->IsAnonymousFunctionDefinition()); |
+ (IsDoExpression() && |
+ AsDoExpression()->IsAnonymousFunctionDefinition()); |
} |
void Expression::MarkTail() { |
@@ -280,6 +280,10 @@ void CountOperation::AssignFeedbackVectorSlots(Isolate* isolate, |
AssignVectorSlots(expression(), spec, &slot_); |
} |
+bool DoExpression::IsAnonymousFunctionDefinition() const { |
+ return represented_function_ != nullptr && |
+ represented_function_->raw_name()->length() == 0; |
marja
2016/07/19 09:54:33
This second part looks hacky; why is it needed? Wh
|
+} |
Token::Value Assignment::binary_op() const { |
switch (op()) { |
@@ -372,26 +376,6 @@ bool ObjectLiteralProperty::NeedsSetFunctionName() const { |
IsConciseMethod(value_->AsFunctionLiteral()->kind()))); |
} |
-void ClassLiteral::AssignFeedbackVectorSlots(Isolate* isolate, |
- FeedbackVectorSpec* spec, |
- FeedbackVectorSlotCache* cache) { |
- // This logic that computes the number of slots needed for vector store |
- // ICs must mirror FullCodeGenerator::VisitClassLiteral. |
- prototype_slot_ = spec->AddLoadICSlot(); |
- if (NeedsProxySlot()) { |
- proxy_slot_ = spec->AddStoreICSlot(); |
- } |
- |
- for (int i = 0; i < properties()->length(); i++) { |
- ObjectLiteral::Property* property = properties()->at(i); |
- Expression* value = property->value(); |
- if (FunctionLiteral::NeedsHomeObject(value)) { |
- property->SetSlot(spec->AddStoreICSlot()); |
- } |
- } |
-} |
- |
- |
bool ObjectLiteral::Property::IsCompileTimeValue() { |
return kind_ == CONSTANT || |
(kind_ == MATERIALIZED_LITERAL && |
@@ -1220,21 +1204,6 @@ void AstTraversalVisitor::VisitCompareOperation(CompareOperation* expr) { |
void AstTraversalVisitor::VisitThisFunction(ThisFunction* expr) {} |
-void AstTraversalVisitor::VisitClassLiteral(ClassLiteral* expr) { |
- if (expr->extends() != nullptr) { |
- RECURSE_EXPRESSION(Visit(expr->extends())); |
- } |
- RECURSE_EXPRESSION(Visit(expr->constructor())); |
- ZoneList<ObjectLiteralProperty*>* props = expr->properties(); |
- for (int i = 0; i < props->length(); ++i) { |
- ObjectLiteralProperty* prop = props->at(i); |
- if (!prop->key()->IsLiteral()) { |
- RECURSE_EXPRESSION(Visit(prop->key())); |
- } |
- RECURSE_EXPRESSION(Visit(prop->value())); |
- } |
-} |
- |
void AstTraversalVisitor::VisitSpread(Spread* expr) { |
RECURSE_EXPRESSION(Visit(expr->expression())); |
} |