#include "src/compiler/simplified-operator.h"
#include "src/compiler/opcodes.h"
#include "src/compiler/operator-properties.h"
#include "src/compiler/operator.h"
#include "src/compiler/types.h"
#include "test/unittests/test-utils.h"
namespace v8 {
namespace internal {
namespace compiler {
namespace simplified_operator_unittest {
struct PureOperator { … };
std::ostream& operator<<(std::ostream& os, const PureOperator& pop) { … }
const PureOperator kPureOperators[] = …;
class SimplifiedPureOperatorTest
: public TestWithZone,
public ::testing::WithParamInterface<PureOperator> { … };
TEST_P(SimplifiedPureOperatorTest, InstancesAreGloballyShared) { … }
TEST_P(SimplifiedPureOperatorTest, NumberOfInputsAndOutputs) { … }
TEST_P(SimplifiedPureOperatorTest, OpcodeIsCorrect) { … }
TEST_P(SimplifiedPureOperatorTest, Properties) { … }
INSTANTIATE_TEST_SUITE_P(…);
const ElementAccess kElementAccesses[] = {
{kTaggedBase, FixedArray::kHeaderSize, Type::Any(),
MachineType::AnyTagged(), kFullWriteBarrier},
{kUntaggedBase, 0, Type::Any(), MachineType::Int8(), kNoWriteBarrier},
{kUntaggedBase, 0, Type::Any(), MachineType::Int16(), kNoWriteBarrier},
{kUntaggedBase, 0, Type::Any(), MachineType::Int32(), kNoWriteBarrier},
{kUntaggedBase, 0, Type::Any(), MachineType::Uint8(), kNoWriteBarrier},
{kUntaggedBase, 0, Type::Any(), MachineType::Uint16(), kNoWriteBarrier},
{kUntaggedBase, 0, Type::Any(), MachineType::Uint32(), kNoWriteBarrier},
{kUntaggedBase, 0, Type::Signed32(), MachineType::Int8(), kNoWriteBarrier},
{kUntaggedBase, 0, Type::Unsigned32(), MachineType::Uint8(),
kNoWriteBarrier},
{kUntaggedBase, 0, Type::Signed32(), MachineType::Int16(), kNoWriteBarrier},
{kUntaggedBase, 0, Type::Unsigned32(), MachineType::Uint16(),
kNoWriteBarrier},
{kUntaggedBase, 0, Type::Signed32(), MachineType::Int32(), kNoWriteBarrier},
{kUntaggedBase, 0, Type::Unsigned32(), MachineType::Uint32(),
kNoWriteBarrier},
{kUntaggedBase, 0, Type::Number(),
MachineType(MachineRepresentation::kFloat32, MachineSemantic::kNone),
kNoWriteBarrier},
{kUntaggedBase, 0, Type::Number(),
MachineType(MachineRepresentation::kFloat64, MachineSemantic::kNone),
kNoWriteBarrier},
{kTaggedBase, ByteArray::kHeaderSize, Type::Signed32(), MachineType::Int8(),
kNoWriteBarrier},
{kTaggedBase, ByteArray::kHeaderSize, Type::Unsigned32(),
MachineType::Uint8(), kNoWriteBarrier},
{kTaggedBase, ByteArray::kHeaderSize, Type::Signed32(),
MachineType::Int16(), kNoWriteBarrier},
{kTaggedBase, ByteArray::kHeaderSize, Type::Unsigned32(),
MachineType::Uint16(), kNoWriteBarrier},
{kTaggedBase, ByteArray::kHeaderSize, Type::Signed32(),
MachineType::Int32(), kNoWriteBarrier},
{kTaggedBase, ByteArray::kHeaderSize, Type::Unsigned32(),
MachineType::Uint32(), kNoWriteBarrier},
{kTaggedBase, ByteArray::kHeaderSize, Type::Number(),
MachineType(MachineRepresentation::kFloat32, MachineSemantic::kNone),
kNoWriteBarrier},
{kTaggedBase, ByteArray::kHeaderSize, Type::Number(),
MachineType(MachineRepresentation::kFloat32, MachineSemantic::kNone),
kNoWriteBarrier}};
class SimplifiedElementAccessOperatorTest
: public TestWithZone,
public ::testing::WithParamInterface<ElementAccess> { … };
TEST_P(SimplifiedElementAccessOperatorTest, LoadElement) { … }
TEST_P(SimplifiedElementAccessOperatorTest, StoreElement) { … }
INSTANTIATE_TEST_SUITE_P(…);
}
}
}
}