Commit a6ffe8ef authored by bbudge's avatar bbudge Committed by Commit bot

Revert of [Turbofan] Change AlignSavedCalleeRegisterSlots to AlignFrame....

Revert of [Turbofan] Change AlignSavedCalleeRegisterSlots to AlignFrame. (patchset #2 id:20001 of https://codereview.chromium.org/2124983004/ )

Reason for revert:
Speculative revert to fix perf regression:
https://bugs.chromium.org/p/chromium/issues/detail?id=627803

Original issue's description:
> [Turbofan] Change AlignSavedCalleeRegisterSlots to AlignFrame.
> Clean up call sites.
>
> LOG=N
> BUG=v8:4124
>
> Committed: https://crrev.com/d8d75782fb90da21b92ca3dda59cfa3088ad3912
> Cr-Commit-Position: refs/heads/master@{#37650}

TBR=bmeurer@chromium.org,mtrofin@chromium.org,danno@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2151563003
Cr-Commit-Position: refs/heads/master@{#37732}
parent 08fed37e
......@@ -1559,7 +1559,10 @@ void CodeGenerator::FinishFrame(Frame* frame) {
const RegList saves_fp = descriptor->CalleeSavedFPRegisters();
if (saves_fp != 0) {
frame->AlignFrame();
frame->AlignSavedCalleeRegisterSlots();
}
if (saves_fp != 0) {
// Save callee-saved FP registers.
STATIC_ASSERT(DwVfpRegister::kMaxNumRegisters == 32);
uint32_t last = base::bits::CountLeadingZeros32(saves_fp) - 1;
......
......@@ -98,6 +98,15 @@ class Frame : public ZoneObject {
return !allocated_double_registers_->IsEmpty();
}
void AlignSavedCalleeRegisterSlots(int alignment = kDoubleSize) {
int alignment_slots = alignment / kPointerSize;
int delta = alignment_slots - (frame_slot_count_ & (alignment_slots - 1));
if (delta != alignment_slots) {
frame_slot_count_ += delta;
}
spill_slot_count_ += delta;
}
void AllocateSavedCalleeRegisterSlots(int count) {
frame_slot_count_ += count;
}
......
......@@ -1822,7 +1822,10 @@ void CodeGenerator::FinishFrame(Frame* frame) {
const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
if (saves_fpu != 0) {
frame->AlignFrame();
frame->AlignSavedCalleeRegisterSlots();
}
if (saves_fpu != 0) {
int count = base::bits::CountPopulation32(saves_fpu);
DCHECK(kNumCalleeSavedFPU == count);
frame->AllocateSavedCalleeRegisterSlots(count *
......
......@@ -1993,7 +1993,7 @@ void CodeGenerator::FinishFrame(Frame* frame) {
// Save callee-saved Double registers.
if (double_saves != 0) {
frame->AlignFrame();
frame->AlignSavedCalleeRegisterSlots();
DCHECK(kNumCalleeSavedDoubles ==
base::bits::CountPopulation32(double_saves));
frame->AllocateSavedCalleeRegisterSlots(kNumCalleeSavedDoubles *
......
......@@ -2015,7 +2015,7 @@ void CodeGenerator::FinishFrame(Frame* frame) {
// Save callee-saved Double registers.
if (double_saves != 0) {
frame->AlignFrame();
frame->AlignSavedCalleeRegisterSlots();
DCHECK(kNumCalleeSavedDoubles ==
base::bits::CountPopulation32(double_saves));
frame->AllocateSavedCalleeRegisterSlots(kNumCalleeSavedDoubles *
......
......@@ -2124,15 +2124,22 @@ void CodeGenerator::FinishFrame(Frame* frame) {
CallDescriptor* descriptor = linkage()->GetIncomingDescriptor();
const RegList saves_fp = descriptor->CalleeSavedFPRegisters();
if (saves_fp != 0) {
frame->AlignSavedCalleeRegisterSlots();
if (saves_fp != 0) { // Save callee-saved XMM registers.
frame->AlignFrame();
uint32_t count = base::bits::CountPopulation32(saves_fp);
frame->AllocateSavedCalleeRegisterSlots(count *
const uint32_t saves_fp_count = base::bits::CountPopulation32(saves_fp);
frame->AllocateSavedCalleeRegisterSlots(saves_fp_count *
(kQuadWordSize / kPointerSize));
}
}
const RegList saves = descriptor->CalleeSavedRegisters();
if (saves != 0) { // Save callee-saved registers.
uint32_t count = base::bits::CountPopulation32(saves);
int count = 0;
for (int i = Register::kNumRegisters - 1; i >= 0; i--) {
if (((1 << i) & saves)) {
++count;
}
}
frame->AllocateSavedCalleeRegisterSlots(count);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment