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

[Turbofan] Change AlignSavedCalleeRegisterSlots to AlignFrame.

Clean up call sites.

LOG=N
BUG=v8:4124

Review-Url: https://codereview.chromium.org/2124983004
Cr-Commit-Position: refs/heads/master@{#37650}
parent f797c4b8
......@@ -1559,10 +1559,7 @@ void CodeGenerator::FinishFrame(Frame* frame) {
const RegList saves_fp = descriptor->CalleeSavedFPRegisters();
if (saves_fp != 0) {
frame->AlignSavedCalleeRegisterSlots();
}
if (saves_fp != 0) {
frame->AlignFrame();
// Save callee-saved FP registers.
STATIC_ASSERT(DwVfpRegister::kMaxNumRegisters == 32);
uint32_t last = base::bits::CountLeadingZeros32(saves_fp) - 1;
......
......@@ -98,15 +98,6 @@ 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,10 +1822,7 @@ void CodeGenerator::FinishFrame(Frame* frame) {
const RegList saves_fpu = descriptor->CalleeSavedFPRegisters();
if (saves_fpu != 0) {
frame->AlignSavedCalleeRegisterSlots();
}
if (saves_fpu != 0) {
frame->AlignFrame();
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->AlignSavedCalleeRegisterSlots();
frame->AlignFrame();
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->AlignSavedCalleeRegisterSlots();
frame->AlignFrame();
DCHECK(kNumCalleeSavedDoubles ==
base::bits::CountPopulation32(double_saves));
frame->AllocateSavedCalleeRegisterSlots(kNumCalleeSavedDoubles *
......
......@@ -2124,22 +2124,15 @@ 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.
const uint32_t saves_fp_count = base::bits::CountPopulation32(saves_fp);
frame->AllocateSavedCalleeRegisterSlots(saves_fp_count *
(kQuadWordSize / kPointerSize));
}
if (saves_fp != 0) { // Save callee-saved XMM registers.
frame->AlignFrame();
uint32_t count = base::bits::CountPopulation32(saves_fp);
frame->AllocateSavedCalleeRegisterSlots(count *
(kQuadWordSize / kPointerSize));
}
const RegList saves = descriptor->CalleeSavedRegisters();
if (saves != 0) { // Save callee-saved registers.
int count = 0;
for (int i = Register::kNumRegisters - 1; i >= 0; i--) {
if (((1 << i) & saves)) {
++count;
}
}
uint32_t count = base::bits::CountPopulation32(saves);
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