#include "test/unittests/compiler/backend/instruction-sequence-unittest.h"
#include "src/base/utils/random-number-generator.h"
#include "src/compiler/pipeline.h"
#include "test/unittests/test-utils.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace v8 {
namespace internal {
namespace compiler {
namespace {
constexpr int kMaxNumAllocatable = …;
static std::array<int, kMaxNumAllocatable> kAllocatableCodes =
base::make_array<kMaxNumAllocatable>(
[](size_t i) { return static_cast<int>(i); });
}
InstructionSequenceTest::InstructionSequenceTest()
: … { … }
void InstructionSequenceTest::SetNumRegs(int num_general_registers,
int num_double_registers) { … }
int InstructionSequenceTest::GetNumRegs(MachineRepresentation rep) { … }
int InstructionSequenceTest::GetAllocatableCode(int index,
MachineRepresentation rep) { … }
const RegisterConfiguration* InstructionSequenceTest::config() { … }
InstructionSequence* InstructionSequenceTest::sequence() { … }
void InstructionSequenceTest::StartLoop(int loop_blocks) { … }
void InstructionSequenceTest::EndLoop() { … }
void InstructionSequenceTest::StartBlock(bool deferred) { … }
Instruction* InstructionSequenceTest::EndBlock(BlockCompletion completion) { … }
InstructionSequenceTest::TestOperand InstructionSequenceTest::Imm(int32_t imm) { … }
InstructionSequenceTest::VReg InstructionSequenceTest::Define(
TestOperand output_op) { … }
Instruction* InstructionSequenceTest::Return(TestOperand input_op_0) { … }
PhiInstruction* InstructionSequenceTest::Phi(VReg incoming_vreg_0,
VReg incoming_vreg_1,
VReg incoming_vreg_2,
VReg incoming_vreg_3) { … }
PhiInstruction* InstructionSequenceTest::Phi(VReg incoming_vreg_0,
size_t input_count) { … }
void InstructionSequenceTest::SetInput(PhiInstruction* phi, size_t input,
VReg vreg) { … }
InstructionSequenceTest::VReg InstructionSequenceTest::DefineConstant(
int32_t imm) { … }
Instruction* InstructionSequenceTest::EmitNop() { … }
static size_t CountInputs(size_t size,
InstructionSequenceTest::TestOperand* inputs) { … }
Instruction* InstructionSequenceTest::EmitI(size_t input_size,
TestOperand* inputs) { … }
Instruction* InstructionSequenceTest::EmitI(TestOperand input_op_0,
TestOperand input_op_1,
TestOperand input_op_2,
TestOperand input_op_3) { … }
InstructionSequenceTest::VReg InstructionSequenceTest::EmitOI(
TestOperand output_op, size_t input_size, TestOperand* inputs) { … }
InstructionSequenceTest::VReg InstructionSequenceTest::EmitOI(
TestOperand output_op, TestOperand input_op_0, TestOperand input_op_1,
TestOperand input_op_2, TestOperand input_op_3) { … }
InstructionSequenceTest::VRegPair InstructionSequenceTest::EmitOOI(
TestOperand output_op_0, TestOperand output_op_1, size_t input_size,
TestOperand* inputs) { … }
InstructionSequenceTest::VRegPair InstructionSequenceTest::EmitOOI(
TestOperand output_op_0, TestOperand output_op_1, TestOperand input_op_0,
TestOperand input_op_1, TestOperand input_op_2, TestOperand input_op_3) { … }
InstructionSequenceTest::VReg InstructionSequenceTest::EmitCall(
TestOperand output_op, size_t input_size, TestOperand* inputs) { … }
InstructionSequenceTest::VReg InstructionSequenceTest::EmitCall(
TestOperand output_op, TestOperand input_op_0, TestOperand input_op_1,
TestOperand input_op_2, TestOperand input_op_3) { … }
Instruction* InstructionSequenceTest::EmitBranch(TestOperand input_op) { … }
Instruction* InstructionSequenceTest::EmitFallThrough() { … }
Instruction* InstructionSequenceTest::EmitJump(TestOperand input_op) { … }
Instruction* InstructionSequenceTest::NewInstruction(
InstructionCode code, size_t outputs_size, InstructionOperand* outputs,
size_t inputs_size, InstructionOperand* inputs, size_t temps_size,
InstructionOperand* temps) { … }
InstructionOperand InstructionSequenceTest::Unallocated(
TestOperand op, UnallocatedOperand::ExtendedPolicy policy) { … }
InstructionOperand InstructionSequenceTest::Unallocated(
TestOperand op, UnallocatedOperand::ExtendedPolicy policy,
UnallocatedOperand::Lifetime lifetime) { … }
InstructionOperand InstructionSequenceTest::Unallocated(
TestOperand op, UnallocatedOperand::ExtendedPolicy policy, int index) { … }
InstructionOperand InstructionSequenceTest::Unallocated(
TestOperand op, UnallocatedOperand::BasicPolicy policy, int index) { … }
InstructionOperand* InstructionSequenceTest::ConvertInputs(
size_t input_size, TestOperand* inputs) { … }
InstructionOperand InstructionSequenceTest::ConvertInputOp(TestOperand op) { … }
InstructionOperand InstructionSequenceTest::ConvertOutputOp(VReg vreg,
TestOperand op) { … }
InstructionBlock* InstructionSequenceTest::NewBlock(bool deferred) { … }
void InstructionSequenceTest::WireBlocks() { … }
void InstructionSequenceTest::WireBlock(size_t block_offset, int jump_offset) { … }
void InstructionSequenceTest::CalculateDominators() { … }
Instruction* InstructionSequenceTest::Emit(
InstructionCode code, size_t outputs_size, InstructionOperand* outputs,
size_t inputs_size, InstructionOperand* inputs, size_t temps_size,
InstructionOperand* temps, bool is_call) { … }
Instruction* InstructionSequenceTest::AddInstruction(Instruction* instruction) { … }
}
}
}