#ifndef V8_COMPILER_BACKEND_INSTRUCTION_H_
#define V8_COMPILER_BACKEND_INSTRUCTION_H_
#include <iosfwd>
#include <map>
#include <optional>
#include "src/base/compiler-specific.h"
#include "src/base/numbers/double.h"
#include "src/codegen/external-reference.h"
#include "src/codegen/register.h"
#include "src/codegen/source-position.h"
#include "src/common/globals.h"
#include "src/compiler/backend/instruction-codes.h"
#include "src/compiler/common-operator.h"
#include "src/compiler/feedback-source.h"
#include "src/compiler/frame.h"
#include "src/compiler/opcodes.h"
#include "src/zone/zone-allocator.h"
namespace v8 {
namespace internal {
class RegisterConfiguration;
namespace compiler {
class Schedule;
class SourcePositionTable;
namespace turboshaft {
class Graph;
}
#if defined(V8_CC_MSVC) && defined(V8_TARGET_ARCH_IA32)
#define INSTRUCTION_OPERAND_ALIGN
#else
#define INSTRUCTION_OPERAND_ALIGN …
#endif
class V8_EXPORT_PRIVATE INSTRUCTION_OPERAND_ALIGN InstructionOperand { … } … };
InstructionOperandVector;
std::ostream& operator<<(std::ostream&, const InstructionOperand&);
#define INSTRUCTION_OPERAND_CASTS …
class UnallocatedOperand final : public InstructionOperand { … };
class ConstantOperand : public InstructionOperand { … };
class ImmediateOperand : public InstructionOperand { … };
class PendingOperand : public InstructionOperand { … };
class LocationOperand : public InstructionOperand { … };
class AllocatedOperand : public LocationOperand { … };
#undef INSTRUCTION_OPERAND_CASTS
bool InstructionOperand::IsAnyLocationOperand() const { … }
bool InstructionOperand::IsLocationOperand() const { … }
bool InstructionOperand::IsFPLocationOperand() const { … }
bool InstructionOperand::IsAnyRegister() const { … }
bool InstructionOperand::IsRegister() const { … }
bool InstructionOperand::IsFPRegister() const { … }
bool InstructionOperand::IsFloatRegister() const { … }
bool InstructionOperand::IsDoubleRegister() const { … }
bool InstructionOperand::IsSimd128Register() const { … }
bool InstructionOperand::IsSimd256Register() const { … }
bool InstructionOperand::IsAnyStackSlot() const { … }
bool InstructionOperand::IsStackSlot() const { … }
bool InstructionOperand::IsFPStackSlot() const { … }
bool InstructionOperand::IsFloatStackSlot() const { … }
bool InstructionOperand::IsDoubleStackSlot() const { … }
bool InstructionOperand::IsSimd128StackSlot() const { … }
bool InstructionOperand::IsSimd256StackSlot() const { … }
uint64_t InstructionOperand::GetCanonicalizedValue() const { … }
struct CompareOperandModuloType { … };
class V8_EXPORT_PRIVATE MoveOperands final
: public NON_EXPORTED_BASE(ZoneObject) { … };
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, const MoveOperands&);
class V8_EXPORT_PRIVATE ParallelMove final
: public NON_EXPORTED_BASE(ZoneVector<MoveOperands*>),
public NON_EXPORTED_BASE(ZoneObject) { … };
std::ostream& operator<<(std::ostream&, const ParallelMove&);
class ReferenceMap final : public ZoneObject { … };
std::ostream& operator<<(std::ostream&, const ReferenceMap&);
class InstructionBlock;
class V8_EXPORT_PRIVATE Instruction final { … };
std::ostream& operator<<(std::ostream&, const Instruction&);
class RpoNumber final { … };
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&, const RpoNumber&);
class V8_EXPORT_PRIVATE Constant final { … };
std::ostream& operator<<(std::ostream&, const Constant&);
class FrameStateDescriptor;
enum class StateValueKind : uint8_t { … };
std::ostream& operator<<(std::ostream& os, StateValueKind kind);
class StateValueDescriptor { … };
class StateValueList { … };
class FrameStateDescriptor : public ZoneObject { … };
#if V8_ENABLE_WEBASSEMBLY
class JSToWasmFrameStateDescriptor : public FrameStateDescriptor { … };
#endif
class DeoptimizationEntry final { … };
DeoptimizationVector;
class V8_EXPORT_PRIVATE PhiInstruction final
: public NON_EXPORTED_BASE(ZoneObject) { … };
class V8_EXPORT_PRIVATE InstructionBlock final
: public NON_EXPORTED_BASE(ZoneObject) { … };
class InstructionSequence;
struct PrintableInstructionBlock { … };
std::ostream& operator<<(std::ostream&, const PrintableInstructionBlock&);
using ConstantMap = ZoneUnorderedMap< int, Constant>;
Instructions;
ReferenceMaps;
InstructionBlocks;
class V8_EXPORT_PRIVATE InstructionSequence final
: public NON_EXPORTED_BASE(ZoneObject) { … };
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream&,
const InstructionSequence&);
#undef INSTRUCTION_OPERAND_ALIGN
constexpr size_t kNumCcmpOperands = …;
constexpr size_t kCcmpOffsetOfOpcode = …;
constexpr size_t kCcmpOffsetOfLhs = …;
constexpr size_t kCcmpOffsetOfRhs = …;
constexpr size_t kCcmpOffsetOfDefaultFlags = …;
constexpr size_t kCcmpOffsetOfCompareCondition = …;
constexpr size_t kConditionalSetEndOffsetOfNumCcmps = …;
constexpr size_t kConditionalSetEndOffsetOfCondition = …;
constexpr size_t kBranchEndOffsetOfFalseBlock = …;
constexpr size_t kBranchEndOffsetOfTrueBlock = …;
constexpr size_t kConditionalBranchEndOffsetOfNumCcmps = …;
constexpr size_t kConditionalBranchEndOffsetOfCondition = …;
}
}
}
#endif