Commit 5bc05aa5 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[ast] Remove unused StoreInArrayLiteral

Change-Id: I1499b15c18fde43193a5e6312b71b29892dad70b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2049849
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Auto-Submit: Toon Verwaest <verwaest@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#66369}
parent 9c6b1099
......@@ -511,15 +511,6 @@ void AstTraversalVisitor<Subclass>::VisitSpread(Spread* expr) {
RECURSE_EXPRESSION(Visit(expr->expression()));
}
template <class Subclass>
void AstTraversalVisitor<Subclass>::VisitStoreInArrayLiteral(
StoreInArrayLiteral* expr) {
PROCESS_EXPRESSION(expr);
RECURSE_EXPRESSION(Visit(expr->array()));
RECURSE_EXPRESSION(Visit(expr->index()));
RECURSE_EXPRESSION(Visit(expr->value()));
}
template <class Subclass>
void AstTraversalVisitor<Subclass>::VisitEmptyParentheses(
EmptyParentheses* expr) {
......
......@@ -99,7 +99,6 @@ namespace internal {
V(OptionalChain) \
V(Property) \
V(Spread) \
V(StoreInArrayLiteral) \
V(SuperCallReference) \
V(SuperPropertyReference) \
V(TemplateLiteral) \
......@@ -1929,30 +1928,6 @@ class Spread final : public Expression {
Expression* expression_;
};
// The StoreInArrayLiteral node corresponds to the StaInArrayLiteral bytecode.
// It is used in the rewriting of destructuring assignments that contain an
// array rest pattern.
class StoreInArrayLiteral final : public Expression {
public:
Expression* array() const { return array_; }
Expression* index() const { return index_; }
Expression* value() const { return value_; }
private:
friend class AstNodeFactory;
StoreInArrayLiteral(Expression* array, Expression* index, Expression* value,
int position)
: Expression(position, kStoreInArrayLiteral),
array_(array),
index_(index),
value_(value) {}
Expression* array_;
Expression* index_;
Expression* value_;
};
class Conditional final : public Expression {
public:
Expression* condition() const { return condition_; }
......@@ -3061,12 +3036,6 @@ class AstNodeFactory final {
return new (zone_) Spread(expression, pos, expr_pos);
}
StoreInArrayLiteral* NewStoreInArrayLiteral(Expression* array,
Expression* index,
Expression* value, int pos) {
return new (zone_) StoreInArrayLiteral(array, index, value, pos);
}
Conditional* NewConditional(Expression* condition,
Expression* then_expression,
Expression* else_expression,
......
......@@ -536,12 +536,6 @@ void CallPrinter::VisitSpread(Spread* node) {
Print(")");
}
void CallPrinter::VisitStoreInArrayLiteral(StoreInArrayLiteral* node) {
Find(node->array());
Find(node->index());
Find(node->value());
}
void CallPrinter::VisitEmptyParentheses(EmptyParentheses* node) {
UNREACHABLE();
}
......@@ -1410,13 +1404,6 @@ void AstPrinter::VisitSpread(Spread* node) {
Visit(node->expression());
}
void AstPrinter::VisitStoreInArrayLiteral(StoreInArrayLiteral* node) {
IndentedScope indent(this, "STORE IN ARRAY LITERAL", node->position());
PrintIndentedVisit("ARRAY", node->array());
PrintIndentedVisit("INDEX", node->index());
PrintIndentedVisit("VALUE", node->value());
}
void AstPrinter::VisitEmptyParentheses(EmptyParentheses* node) {
IndentedScope indent(this, "()", node->position());
}
......
......@@ -2995,19 +2995,6 @@ void BytecodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
BuildCreateArrayLiteral(expr->values(), expr);
}
void BytecodeGenerator::VisitStoreInArrayLiteral(StoreInArrayLiteral* expr) {
builder()->SetExpressionAsStatementPosition(expr);
RegisterAllocationScope register_scope(this);
Register array = register_allocator()->NewRegister();
Register index = register_allocator()->NewRegister();
VisitForRegisterValue(expr->array(), array);
VisitForRegisterValue(expr->index(), index);
VisitForAccumulatorValue(expr->value());
builder()->StoreInArrayLiteral(
array, index,
feedback_index(feedback_spec()->AddStoreInArrayLiteralICSlot()));
}
void BytecodeGenerator::VisitVariableProxy(VariableProxy* proxy) {
builder()->SetExpressionPosition(proxy);
BuildVariableLoad(proxy->var(), proxy->hole_check_mode());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment