// Compute the address of the method for X86 Constant area support. class HX86ComputeBaseMethodAddress final : public HExpression<0> { public: // Treat the value as an int32_t, but it is really a 32 bit native pointer.
HX86ComputeBaseMethodAddress()
: HExpression(kX86ComputeBaseMethodAddress,
DataType::Type::kInt32,
SideEffects::None(),
kNoDexPc) {
}
// Load a constant value from the constant table. class HX86LoadFromConstantTable final : public HExpression<2> { public:
HX86LoadFromConstantTable(HX86ComputeBaseMethodAddress* method_base,
HConstant* constant)
: HExpression(kX86LoadFromConstantTable,
constant->GetType(),
SideEffects::None(),
kNoDexPc) {
SetRawInputAt(0, method_base);
SetRawInputAt(1, constant);
}
// Version of HNeg with access to the constant table for FP types. class HX86FPNeg final : public HExpression<2> { public:
HX86FPNeg(DataType::Type result_type,
HInstruction* input,
HX86ComputeBaseMethodAddress* method_base,
uint32_t dex_pc)
: HExpression(kX86FPNeg, result_type, SideEffects::None(), dex_pc) {
DCHECK(DataType::IsFloatingPointType(result_type));
SetRawInputAt(0, input);
SetRawInputAt(1, method_base);
}
// X86 version of HPackedSwitch that holds a pointer to the base method address. class HX86PackedSwitch final : public HExpression<2> { public:
HX86PackedSwitch(int32_t start_value,
int32_t num_entries,
HInstruction* input,
HX86ComputeBaseMethodAddress* method_base,
uint32_t dex_pc)
: HExpression(kX86PackedSwitch, SideEffects::None(), dex_pc),
start_value_(start_value),
num_entries_(num_entries) {
SetRawInputAt(0, input);
SetRawInputAt(1, method_base);
}
#ifdefined(ART_ENABLE_CODEGEN_x86_64) // TODO: Separate x86_64 only instructions to a separate file class HX86Clear final : public HExpression<0> { public: explicit HX86Clear(uint32_t dex_pc = kNoDexPc)
: HExpression(kX86Clear, SideEffects::None(), dex_pc) {}
class HX86LoadEffectiveAddress : public HInstruction { public:
HX86LoadEffectiveAddress(DataType::Type result_type,
HInstruction* index,
HInstruction* base, // May be null.
uint32_t shift,
int32_t displacement,
uint32_t dex_pc = kNoDexPc)
: HInstruction(kX86LoadEffectiveAddress, result_type, SideEffects::None(), dex_pc),
shift_(shift),
displacement_(displacement) {
SetRawInputAt(0, index); // Store the `base` directly. `SetRawInputAt()` cannot be used here because // `GetInputRecords()` does not include `inputs_[1]` while it contains null.
inputs_[1] = HUserRecord<HInstruction*>(base);
DCHECK_LT(shift, 4u);
}