5#ifndef V8_COMPILER_FRAME_H_
6#define V8_COMPILER_FRAME_H_
93 explicit Frame(
int fixed_frame_size_in_slots,
Zone* zone);
98 return slot_allocator_.Size() + return_slot_count_;
111 allocated_double_registers_ = regs;
115 return !allocated_double_registers_->IsEmpty();
121 spill_slots_finished_ =
true;
123 DCHECK(base::bits::IsPowerOfTwo(alignment));
125 int alignment_in_slots = AlignedSlotAllocator::NumSlotsForWidth(alignment);
126 int padding = slot_allocator_.Align(alignment_in_slots);
127 spill_slot_count_ += padding;
133 spill_slots_finished_ =
true;
135 slot_allocator_.AllocateUnaligned(
count);
140 fixed_slot_count_ + spill_slot_count_ + return_slot_count_);
144 DCHECK(!spill_slots_finished_);
146 int actual_width = std::max({width, AlignedSlotAllocator::kSlotSize});
147 int actual_alignment =
148 std::max({alignment, AlignedSlotAllocator::kSlotSize});
149 int slots = AlignedSlotAllocator::NumSlotsForWidth(actual_width);
150 int old_end = slot_allocator_.Size();
152 if (actual_width == actual_alignment) {
154 slot = slot_allocator_.Allocate(slots);
157 if (actual_alignment > AlignedSlotAllocator::kSlotSize) {
159 int alignment_in_slots =
160 AlignedSlotAllocator::NumSlotsForWidth(actual_alignment);
161 slot_allocator_.Align(alignment_in_slots);
163 slot = slot_allocator_.AllocateUnaligned(slots);
165 int end = slot_allocator_.Size();
167 spill_slot_count_ +=
end - old_end;
168 int result_slot = slot + slots - 1;
169 if (is_tagged) tagged_slots_bits_.Add(result_slot,
zone_);
175 return_slot_count_ = std::max(return_slot_count_,
count);
178 void AlignFrame(
int alignment = kDoubleSize);
183 spill_slot_count_ +=
static_cast<int>(slot_count);
184 slot_allocator_.AllocateUnaligned(
static_cast<int>(slot_count));
185 return slot_allocator_.Size() - 1;
192 int spill_slot_count_ = 0;
195 int return_slot_count_ = 0;
202 bool spill_slots_finished_ =
false;
203 bool frame_aligned_ =
false;
264 int frame_slot_count =
267 return frame_slot_count +
sp_delta();
std::vector< Register * > allocated_registers_
static constexpr int kFixedSlotCountAboveFp
void SetFrameAccessToDefault()
void SetFrameAccessToSP()
V8_EXPORT_PRIVATE void MarkHasFrame(bool state)
bool access_frame_with_fp() const
void SetFrameAccessToFP()
void SetFPRelativeOnly(bool state)
FrameOffset GetFrameOffset(int spill_slot) const
const Frame * frame() const
int GetSPToFPOffset() const
FrameAccessState(const Frame *const frame)
void IncreaseSPDelta(int amount)
const Frame *const frame_
bool access_frame_with_fp_
int GetSPToFPSlotCount() const
static FrameOffset FromFramePointer(int offset)
static FrameOffset FromStackPointer(int offset)
bool from_frame_pointer()
bool from_stack_pointer()
void SetAllocatedRegisters(BitVector *regs)
Frame(const Frame &)=delete
GrowableBitVector tagged_slots_bits_
int GetTotalFrameSlotCount() const
int ReserveSpillSlots(size_t slot_count)
int GetSpillSlotCount() const
void EnsureReturnSlots(int count)
int GetReturnSlotCount() const
void AllocateSavedCalleeRegisterSlots(int count)
const GrowableBitVector & tagged_slots() const
Frame & operator=(const Frame &)=delete
int AllocateSpillSlot(int width, int alignment=0, bool is_tagged=false)
void SetAllocatedDoubleRegisters(BitVector *regs)
BitVector * allocated_registers_
BitVector * allocated_double_registers_
int GetFixedSlotCount() const
AlignedSlotAllocator slot_allocator_
void AlignSavedCalleeRegisterSlots(int alignment=kDoubleSize)
bool DidAllocateDoubleRegisters() const
constexpr int kSimd128Size
constexpr int kSystemPointerSize
constexpr int kElidedFrameSlots
#define DCHECK_LE(v1, v2)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK(condition)
#define DCHECK_EQ(v1, v2)
#define V8_EXPORT_PRIVATE