The return value is expected to be the number of padding slots added to the frame. However, the original logic would return -1 if padding was required, so insufficient stack space would be reserved.
This function now returns either 0 or 1, as the existing calling code expects.
BUG=
Review URL: https://codereview.chromium.org/
1369303002
Cr-Commit-Position: refs/heads/master@{#30994}
int AlignSavedCalleeRegisterSlots() {
DCHECK_EQ(0, spilled_callee_register_slot_count_);
- int frame_slot_count_before = frame_slot_count_;
- frame_slot_count_ = RoundUp(frame_slot_count_, 2);
- return frame_slot_count_before - frame_slot_count_;
+ int delta = frame_slot_count_ & 1;
+ frame_slot_count_ += delta;
+ return delta;
}
void AllocateSavedCalleeRegisterSlots(int count) {