46#define REP_MIN_VALUE_CLAUSE(name, ___, ____, type) \
48 return static_cast<int64_t>(std::numeric_limits<type>::min());
57#undef REP_MIN_VALUE_CLAUSE
59#define REP_MAX_VALUE_CLAUSE(name, ___, ____, type) \
61 return static_cast<int64_t>(std::numeric_limits<type>::max());
70#undef REP_MAX_VALUE_CLAUSE
87#define ARRAY_CASE(Name) case k##Name##Cid:
91 case kTypeArgumentsCid:
93 case kTypedDataInt8ArrayCid:
95 case kOneByteStringCid:
96 case kTypedDataUint8ArrayCid:
97 case kTypedDataUint8ClampedArrayCid:
98 case kExternalTypedDataUint8ArrayCid:
99 case kExternalTypedDataUint8ClampedArrayCid:
100 return kUnboxedUint8;
101 case kTypedDataInt16ArrayCid:
102 return kUnboxedInt16;
103 case kTwoByteStringCid:
104 case kTypedDataUint16ArrayCid:
105 return kUnboxedUint16;
106 case kTypedDataInt32ArrayCid:
107 return kUnboxedInt32;
108 case kTypedDataUint32ArrayCid:
109 return kUnboxedUint32;
110 case kTypedDataInt64ArrayCid:
111 case kTypedDataUint64ArrayCid:
112 return kUnboxedInt64;
113 case kTypedDataFloat32ArrayCid:
114 return kUnboxedFloat;
115 case kTypedDataFloat64ArrayCid:
116 return kUnboxedDouble;
117 case kTypedDataInt32x4ArrayCid:
118 return kUnboxedInt32x4;
119 case kTypedDataFloat32x4ArrayCid:
120 return kUnboxedFloat32x4;
121 case kTypedDataFloat64x2ArrayCid:
122 return kUnboxedFloat64x2;
124 FATAL(
"Unexpected array cid %u",
cid);
131#define REPR_CASE(Name, PrintName, __, ___) \
145 while (registers != 0) {
148 registers &= (
static_cast<uintptr_t
>(registers) - 1);
158 IsTagged(r) ?
"tagged" :
"untagged");
171 intptr_t input_count,
174 : num_inputs_(input_count),
175 num_temps_(temp_count),
177 stack_bitmap_(nullptr),
178 contains_call_(contains_call),
181 writable_inputs_ = 0;
189 intptr_t input_count,
207 ASSERT(index < num_inputs_);
223 if (index == 0 &&
out(0).IsUnallocated() &&
229 input_locations_[index] = loc;
237 output_location_ = loc;
243 return Pair(pair->At(0).ToSpRelative(fp_to_sp_delta),
244 pair->At(1).ToSpRelative(fp_to_sp_delta));
259 const auto fp_to_entry_sp_delta =
260 (compiler::target::frame_layout.param_end_from_fp + 1) -
261 compiler::target::frame_layout.last_param_from_entry_sp;
266 const auto fp_to_caller_sp_delta =
267 (compiler::target::frame_layout.param_end_from_fp + 1);
273 ASSERT((
reinterpret_cast<intptr_t
>(pair_location) & kLocationTagMask) == 0);
274 pair_location->
SetAt(0, first);
275 pair_location->
SetAt(1, second);
282 return reinterpret_cast<PairLocation*
>(value_ & ~kLocationTagMask);
291 return ((constant !=
nullptr) &&
299 intptr_t max_value) {
301 if (constant ==
nullptr) {
307 const intptr_t smi_value =
value->BoundSmiConstant();
308 if (smi_value < min_value || smi_value > max_value) {
316 return ((constant !=
nullptr) &&
324 intptr_t max_value) {
326 if (constant ==
nullptr) {
332 const intptr_t smi_value =
value->BoundSmiConstant();
333 if (smi_value < min_value || smi_value > max_value) {
342 return ((constant !=
nullptr) &&
351 return ((constant !=
nullptr) &&
359 return ((constant !=
nullptr) &&
370 return stack_index() * compiler::target::kWordSize;
426 const char* suffix =
"";
441 f->Printf(
"%s",
Name());
455 const char* suffix =
"";
494 intptr_t* cpu_reg_slots,
495 intptr_t* fpu_reg_slots) {
497 intptr_t index = cpu_reg_slots[loc.
reg()];
500 compiler::target::frame_layout.FrameSlotForVariableIndex(-index),
503 intptr_t index = fpu_reg_slots[loc.
fpu_reg()];
509 compiler::target::frame_layout.FrameSlotForVariableIndex(-index),
512 case kUnboxedFloat32x4:
513 case kUnboxedInt32x4:
514 case kUnboxedFloat64x2:
516 compiler::target::frame_layout.FrameSlotForVariableIndex(-index),
529 index_lo = compiler::target::frame_layout.FrameSlotForVariableIndex(
530 -cpu_reg_slots[value_pair->
At(0).
reg()]);
537 index_hi = compiler::target::frame_layout.FrameSlotForVariableIndex(
538 -cpu_reg_slots[value_pair->
At(1).
reg()]);
546 }
else if (loc.
IsInvalid() && def->IsMaterializeObject()) {
547 def->AsMaterializeObject()->RemapRegisters(cpu_reg_slots, fpu_reg_slots);
561 if (i != 0) f->AddString(
", ");
570 if (i != 0) f->AddString(
", ");
576 if (!
out(0).IsInvalid()) {
577 f->AddString(
" => ");
585void LocationSummary::DiscoverWritableInputs() {
593 writable_inputs_ |= 1 << i;
598void LocationSummary::CheckWritableInputs() {
601 if ((writable_inputs_ & (1 << i)) != 0) {
#define ASSERT_EQUAL(expected, actual)
#define CLASS_LIST_ARRAYS(V)
static constexpr uword encode(Register value)
const Object & value() const
virtual Representation representation() const
Location temp(intptr_t index) const
Location out(intptr_t index) const
LocationSummary(Zone *zone, intptr_t input_count, intptr_t temp_count, LocationSummary::ContainsCall contains_call)
static LocationSummary * Make(Zone *zone, intptr_t input_count, Location out, ContainsCall contains_call)
intptr_t input_count() const
intptr_t temp_count() const
RegisterSet * live_registers()
void set_out(intptr_t index, Location loc)
bool always_calls() const
Location in(intptr_t index) const
void set_in(intptr_t index, Location loc)
void PrintTo(BaseTextBuffer *f) const
static Location StackSlot(intptr_t stack_index, Register base)
Location ToCallerSpRelative() const
static Location QuadStackSlot(intptr_t stack_index, Register base)
const char * Name() const
bool IsFpuRegister() const
ConstantInstr * constant_instruction() const
static Location Pair(Location first, Location second)
intptr_t ToStackSlotOffset() const
Location ToEntrySpRelative() const
const char * ToCString() const
static Location DoubleStackSlot(intptr_t stack_index, Register base)
static uword EncodeStackIndex(intptr_t stack_index)
intptr_t stack_index() const
Location Component(intptr_t i) const
static Location WritableRegister()
Register base_reg() const
static Location RegisterLocation(Register reg)
PairLocation * AsPairLocation() const
static Location RequiresRegister()
bool IsPairLocation() const
void PrintTo(BaseTextBuffer *f) const
bool IsUnallocated() const
bool IsMachineRegister() const
FpuRegister fpu_reg() const
const Object & constant() const
Location ToSpRelative(intptr_t fp_to_sp_delta) const
bool HasStackIndex() const
static Location Constant(const ConstantInstr *obj, int pair_index=0)
void SetAt(intptr_t i, Location loc)
Location At(intptr_t i) const
static const char * FpuRegisterName(FpuRegister reg)
static const char * RegisterName(Register reg)
bool ContainsFpuRegister(FpuRegister fpu_reg) const
static intptr_t RegisterCount(intptr_t registers)
bool ContainsRegister(Register reg) const
bool IsTagged(Register reg) const
static Thread * Current()
static bool IsInt(intptr_t N, T value)
static bool IsUint(intptr_t N, T value)
char * MakeCopyOfString(const char *str)
ElementType * Alloc(intptr_t length)
static bool IsSafeSmi(const Object &object)
static bool IsSafe(const Object &object)
#define THR_Print(format,...)
static const uint8_t buffer[]
constexpr bool FLAG_support_il_printer
#define REP_MIN_VALUE_CLAUSE(name, ___, ____, type)
#define REPR_CASE(Name, PrintName, __, ___)
#define REP_MAX_VALUE_CLAUSE(name, ___, ____, type)
#define FOR_EACH_REPRESENTATION_KIND(M)
#define FOR_EACH_INTEGER_REPRESENTATION_KIND(M)
bool Contains(const Container &container, const Value &value)
constexpr OperandSize kWordBytes
constexpr int64_t kMaxInt64
const int kNumTypedDataCidRemainders
constexpr int64_t kMinInt64
Location LocationAnyOrConstant(Value *value)
Location LocationRegisterOrConstant(Value *value)
bool IsTypedDataBaseClassId(intptr_t index)
const Register kExceptionObjectReg
const int kTypedDataCidRemainderInternal
Location LocationExceptionLocation()
constexpr intptr_t kBitsPerByte
const Register ARGS_DESC_REG
Location LocationFixedRegisterOrConstant(Value *value, Register reg)
const int kNumberOfFpuRegisters
Location LocationWritableRegisterOrSmiConstant(Value *value, intptr_t min_value, intptr_t max_value)
Location LocationArgumentsDescriptorLocation()
Location LocationRemapForSlowPath(Location loc, Definition *def, intptr_t *cpu_reg_slots, intptr_t *fpu_reg_slots)
static const ClassId kFirstTypedDataCid
constexpr RegList kDartAvailableCpuRegs
compiler::Address LocationToStackSlotAddress(Location loc)
Location LocationStackTraceLocation()
Location LocationWritableRegisterOrConstant(Value *value)
const Register kStackTraceObjectReg
Location LocationFixedRegisterOrSmiConstant(Value *value, Register reg)
Location LocationRegisterOrSmiConstant(Value *value, intptr_t min_value, intptr_t max_value)
static bool ValidOutputForAlwaysCalls(const Location &loc)
static constexpr size_t ValueSize(Representation rep)
static constexpr bool IsUnboxedInteger(Representation rep)
static bool IsRepresentable(Representation rep, int64_t value)
static int64_t MaxValue(Representation rep)
static compiler::OperandSize OperandSize(Representation rep)
static int64_t MinValue(Representation rep)
static const char * ToCString(Representation rep)
static bool IsUnsignedInteger(Representation rep)
static Representation RepresentationOfArrayElement(classid_t cid)