62 bool intrinsic_mode =
false);
84 void CollectRepresentations();
106 void NumberInstructions();
109 bool IsBlockEntry(intptr_t
pos)
const;
115 void BuildLiveRanges();
121 const intptr_t block_start_pos,
122 const intptr_t use_pos,
135 bool output_same_as_first_input,
144 static constexpr intptr_t kNormalEntryPos = 2;
147 void ProcessInitialDefinition(
Definition* defn,
150 intptr_t initial_definition_index,
151 bool second_location_for_definition =
false);
153 void BlockLocation(
Location loc, intptr_t from, intptr_t to);
154 void BlockRegisterLocation(
Location loc,
157 bool* blocked_registers,
160 void BlockCpuRegisters(intptr_t registers, intptr_t from, intptr_t to);
162 void BlockFpuRegisters(intptr_t fpu_registers, intptr_t from, intptr_t to);
164 intptr_t NumberOfRegisters()
const {
return number_of_registers_; }
167 bool IsLiveAfterCatchEntry(CatchBlockEntryInstr* catch_entry,
168 ParameterInstr* param);
171 void AssignSafepoints(Definition* defn, LiveRange* range);
174 intptr_t number_of_registers,
175 const GrowableArray<LiveRange*>& unallocated,
176 LiveRange** blocking_ranges,
177 bool* blocked_registers);
181 void AllocateUnallocatedRanges();
182 void AdvanceActiveIntervals(
const intptr_t
start);
184 void RemoveFrameIfNotNeeded();
187 void ResolveControlFlow();
189 void ScheduleParallelMoves();
192 bool TargetLocationIsSpillSlot(LiveRange* range,
Location target);
196 void ConvertUseTo(UsePosition* use,
Location loc);
197 void ConvertAllUses(LiveRange* range);
201 void AddToUnallocated(LiveRange* range);
204 bool UnallocatedIsSorted();
208 bool AllocateFreeRegister(LiveRange* unallocated);
214 void AllocateAnyRegister(LiveRange* unallocated);
218 bool RangeHasOnlyUnconstrainedUsesInLoop(LiveRange* range, intptr_t loop_id);
226 bool HasCheapEvictionCandidate(LiveRange* phi_range);
227 bool IsCheapToEvictRegisterInLoop(LoopInfo* loop_info, intptr_t reg);
233 void AssignNonFreeRegister(LiveRange* unallocated, intptr_t reg);
234 bool EvictIntersection(LiveRange* allocated, LiveRange* unallocated);
235 void RemoveEvicted(intptr_t reg, intptr_t first_evicted);
239 intptr_t FirstIntersectionWithAllocated(intptr_t reg, LiveRange* unallocated);
241 bool UpdateFreeUntil(intptr_t reg,
242 LiveRange* unallocated,
243 intptr_t* cur_free_until,
244 intptr_t* cur_blocked_at);
247 LiveRange* SplitBetween(LiveRange* range, intptr_t from, intptr_t to);
250 void AllocateSpillSlotFor(LiveRange* range);
253 void AllocateSpillSlotForSuspendState();
257 void UpdateStackmapsForSuspendState();
261 bool IsSuspendStateParameter(Definition* defn);
265 void AllocateSpillSlotForInitialDefinition(intptr_t slot_index,
269 void Spill(LiveRange* range);
272 void SpillAfter(LiveRange* range, intptr_t from);
276 void SpillBetween(LiveRange* range, intptr_t from, intptr_t to);
280 void MarkAsObjectAtSafepoints(LiveRange* range);
284 Location MakeRegisterLocation(intptr_t reg) {
288 void SplitInitialDefinitionAt(LiveRange* range,
292 void PrintLiveRanges();
297 void AllocateOutgoingArguments();
299 const FlowGraph& flow_graph_;
301 ReachingDefs reaching_defs_;
304 GrowableArray<Representation> value_representations_;
306 const GrowableArray<BlockEntryInstr*>& block_order_;
307 const GrowableArray<BlockEntryInstr*>& postorder_;
310 GrowableArray<Instruction*> instructions_;
313 GrowableArray<BlockEntryInstr*> block_entries_;
316 GrowableArray<ExtraLoopInfo*> extra_loop_info_;
318 SSALivenessAnalysis liveness_;
322 const intptr_t vreg_count_;
325 GrowableArray<LiveRange*> live_ranges_;
327 GrowableArray<LiveRange*> unallocated_cpu_;
328 GrowableArray<LiveRange*> unallocated_fpu_;
337 GrowableArray<LiveRange*> temporaries_;
341 GrowableArray<LiveRange*> spilled_;
344 GrowableArray<Instruction*> safepoints_;
348 intptr_t number_of_registers_;
355 GrowableArray<ZoneGrowableArray<LiveRange*>*> registers_;
357 GrowableArray<bool> blocked_registers_;
361 GrowableArray<LiveRange*> unallocated_;
365 GrowableArray<intptr_t> spill_slots_;
370 GrowableArray<bool> quad_spill_slots_;
375 GrowableArray<bool> untagged_spill_slots_;
377 intptr_t cpu_spill_slot_count_;
379 const bool intrinsic_mode_;