diff --git a/src/compiler/backend/arm64/code-generator-arm64.cc b/src/compiler/backend/arm64/code-generator-arm64.cc index bf1e6bb769..d8652df8e1 100644 --- a/src/compiler/backend/arm64/code-generator-arm64.cc +++ b/src/compiler/backend/arm64/code-generator-arm64.cc @@ -3051,6 +3051,7 @@ void CodeGenerator::AssembleArchTableSwitch(Instruction* instr) { } void CodeGenerator::FinishFrame(Frame* frame) { + frame->AlignFrame(16); auto call_descriptor = linkage()->GetIncomingDescriptor(); // Save FP registers. @@ -3059,6 +3060,7 @@ void CodeGenerator::FinishFrame(Frame* frame) { int saved_count = saves_fp.Count(); if (saved_count != 0) { DCHECK(saves_fp.list() == CPURegList::GetCalleeSavedV().list()); + DCHECK_EQ(saved_count % 2, 0); frame->AllocateSavedCalleeRegisterSlots(saved_count * (kDoubleSize / kSystemPointerSize)); } @@ -3067,9 +3069,9 @@ void CodeGenerator::FinishFrame(Frame* frame) { call_descriptor->CalleeSavedRegisters()); saved_count = saves.Count(); if (saved_count != 0) { + DCHECK_EQ(saved_count % 2, 0); frame->AllocateSavedCalleeRegisterSlots(saved_count); } - frame->AlignFrame(16); } void CodeGenerator::AssembleConstructFrame() { diff --git a/src/compiler/frame.cc b/src/compiler/frame.cc index 83583d7976..b33e9e1354 100644 --- a/src/compiler/frame.cc +++ b/src/compiler/frame.cc @@ -20,7 +20,6 @@ Frame::Frame(int fixed_frame_size_in_slots) void Frame::AlignFrame(int alignment) { #if DEBUG spill_slots_finished_ = true; - frame_aligned_ = true; #endif // In the calculations below we assume that alignment is a power of 2. DCHECK(base::bits::IsPowerOfTwo(alignment)); diff --git a/src/compiler/frame.h b/src/compiler/frame.h index 2320ee5dcb..21f0f59171 100644 --- a/src/compiler/frame.h +++ b/src/compiler/frame.h @@ -116,7 +116,6 @@ class V8_EXPORT_PRIVATE Frame : public ZoneObject { } void AlignSavedCalleeRegisterSlots(int alignment = kDoubleSize) { - DCHECK(!frame_aligned_); #if DEBUG spill_slots_finished_ = true; #endif @@ -128,7 +127,6 @@ class V8_EXPORT_PRIVATE Frame : public ZoneObject { } void AllocateSavedCalleeRegisterSlots(int count) { - DCHECK(!frame_aligned_); #if DEBUG spill_slots_finished_ = true; #endif @@ -140,7 +138,6 @@ class V8_EXPORT_PRIVATE Frame : public ZoneObject { fixed_slot_count_ + spill_slot_count_ + return_slot_count_); // Never allocate spill slots after the callee-saved slots are defined. DCHECK(!spill_slots_finished_); - DCHECK(!frame_aligned_); int actual_width = std::max({width, AlignedSlotAllocator::kSlotSize}); int actual_alignment = std::max({alignment, AlignedSlotAllocator::kSlotSize}); @@ -167,7 +164,6 @@ class V8_EXPORT_PRIVATE Frame : public ZoneObject { } void EnsureReturnSlots(int count) { - DCHECK(!frame_aligned_); return_slot_count_ = std::max(return_slot_count_, count); } @@ -175,7 +171,6 @@ class V8_EXPORT_PRIVATE Frame : public ZoneObject { int ReserveSpillSlots(size_t slot_count) { DCHECK_EQ(0, spill_slot_count_); - DCHECK(!frame_aligned_); spill_slot_count_ += static_cast<int>(slot_count); slot_allocator_.AllocateUnaligned(static_cast<int>(slot_count)); return slot_allocator_.Size() - 1; @@ -192,7 +187,6 @@ class V8_EXPORT_PRIVATE Frame : public ZoneObject { BitVector* allocated_double_registers_; #if DEBUG bool spill_slots_finished_ = false; - bool frame_aligned_ = false; #endif };