| Index: src/compiler/simplified-operator.cc
|
| diff --git a/src/compiler/simplified-operator.cc b/src/compiler/simplified-operator.cc
|
| index fc6ae965b085456ae8092878a60122bcad7bd5bd..f51a275381756af3200f90e05a952ddc39d9bd9d 100644
|
| --- a/src/compiler/simplified-operator.cc
|
| +++ b/src/compiler/simplified-operator.cc
|
| @@ -388,12 +388,6 @@ NumberOperationHint NumberOperationHintOf(const Operator* op) {
|
| return OpParameter<NumberOperationHint>(op);
|
| }
|
|
|
| -int ParameterCountOf(const Operator* op) {
|
| - DCHECK(op->opcode() == IrOpcode::kNewUnmappedArgumentsElements ||
|
| - op->opcode() == IrOpcode::kNewRestParameterElements);
|
| - return OpParameter<int>(op);
|
| -}
|
| -
|
| PretenureFlag PretenureFlagOf(const Operator* op) {
|
| DCHECK_EQ(IrOpcode::kAllocate, op->opcode());
|
| return OpParameter<PretenureFlag>(op);
|
| @@ -564,6 +558,21 @@ struct SimplifiedOperatorGlobalCache final {
|
| };
|
| ArrayBufferWasNeuteredOperator kArrayBufferWasNeutered;
|
|
|
| + struct ArgumentsFrameOperator final : public Operator {
|
| + ArgumentsFrameOperator()
|
| + : Operator(IrOpcode::kArgumentsFrame, Operator::kPure, "ArgumentsFrame",
|
| + 0, 0, 0, 1, 0, 0) {}
|
| + };
|
| + ArgumentsFrameOperator kArgumentsFrame;
|
| +
|
| + struct NewUnmappedArgumentsElementsOperator final : public Operator {
|
| + NewUnmappedArgumentsElementsOperator()
|
| + : Operator(IrOpcode::kNewUnmappedArgumentsElements,
|
| + Operator::kEliminatable, "NewUnmappedArgumentsElements", 2,
|
| + 1, 0, 1, 1, 0) {}
|
| + };
|
| + NewUnmappedArgumentsElementsOperator kNewUnmappedArgumentsElements;
|
| +
|
| template <CheckForMinusZeroMode kMode>
|
| struct CheckedInt32MulOperator final
|
| : public Operator1<CheckForMinusZeroMode> {
|
| @@ -708,6 +717,8 @@ SimplifiedOperatorBuilder::SimplifiedOperatorBuilder(Zone* zone)
|
| PURE_OP_LIST(GET_FROM_CACHE)
|
| CHECKED_OP_LIST(GET_FROM_CACHE)
|
| GET_FROM_CACHE(ArrayBufferWasNeutered)
|
| +GET_FROM_CACHE(ArgumentsFrame)
|
| +GET_FROM_CACHE(NewUnmappedArgumentsElements)
|
| #undef GET_FROM_CACHE
|
|
|
| const Operator* SimplifiedOperatorBuilder::CheckedInt32Mul(
|
| @@ -805,24 +816,49 @@ const Operator* SimplifiedOperatorBuilder::TransitionElementsKind(
|
| transition); // parameter
|
| }
|
|
|
| -const Operator* SimplifiedOperatorBuilder::NewUnmappedArgumentsElements(
|
| - int parameter_count) {
|
| - return new (zone()) Operator1<int>( // --
|
| - IrOpcode::kNewUnmappedArgumentsElements, // opcode
|
| - Operator::kEliminatable, // flags
|
| - "NewUnmappedArgumentsElements", // name
|
| - 0, 1, 0, 1, 1, 0, // counts
|
| - parameter_count); // parameter
|
| -}
|
| -
|
| -const Operator* SimplifiedOperatorBuilder::NewRestParameterElements(
|
| - int parameter_count) {
|
| - return new (zone()) Operator1<int>( // --
|
| - IrOpcode::kNewRestParameterElements, // opcode
|
| - Operator::kEliminatable, // flags
|
| - "NewRestParameterElements", // name
|
| - 0, 1, 0, 1, 1, 0, // counts
|
| - parameter_count); // parameter
|
| +namespace {
|
| +
|
| +struct ArgumentsLengthParameters {
|
| + int formal_parameter_count;
|
| + bool is_rest_length;
|
| +};
|
| +
|
| +bool operator==(ArgumentsLengthParameters first,
|
| + ArgumentsLengthParameters second) {
|
| + return first.formal_parameter_count == second.formal_parameter_count &&
|
| + first.is_rest_length == second.is_rest_length;
|
| +}
|
| +
|
| +size_t hash_value(ArgumentsLengthParameters param) {
|
| + return base::hash_combine(param.formal_parameter_count, param.is_rest_length);
|
| +}
|
| +
|
| +std::ostream& operator<<(std::ostream& os, ArgumentsLengthParameters param) {
|
| + return os << param.formal_parameter_count << ", "
|
| + << (param.is_rest_length ? "rest length" : "not rest length");
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| +const Operator* SimplifiedOperatorBuilder::ArgumentsLength(
|
| + int formal_parameter_count, bool is_rest_length) {
|
| + return new (zone()) Operator1<ArgumentsLengthParameters>( // --
|
| + IrOpcode::kArgumentsLength, // opcode
|
| + Operator::kPure, // flags
|
| + "ArgumentsLength", // name
|
| + 1, 0, 0, 1, 0, 0, // counts
|
| + ArgumentsLengthParameters{formal_parameter_count,
|
| + is_rest_length}); // parameter
|
| +}
|
| +
|
| +int FormalParameterCountOf(const Operator* op) {
|
| + DCHECK(op->opcode() == IrOpcode::kArgumentsLength);
|
| + return OpParameter<ArgumentsLengthParameters>(op).formal_parameter_count;
|
| +}
|
| +
|
| +bool IsRestLengthOf(const Operator* op) {
|
| + DCHECK(op->opcode() == IrOpcode::kArgumentsLength);
|
| + return OpParameter<ArgumentsLengthParameters>(op).is_rest_length;
|
| }
|
|
|
| const Operator* SimplifiedOperatorBuilder::Allocate(PretenureFlag pretenure) {
|
|
|