From: jacob.bramley Date: Tue, 29 Sep 2015 07:48:43 +0000 (-0700) Subject: Fix Frame::AlignSavedCalleeRegisterSlots X-Git-Tag: upstream/4.7.83~46 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a844bc0dc688097e0d895f21f0f70cb249290a7;p=platform%2Fupstream%2Fv8.git Fix Frame::AlignSavedCalleeRegisterSlots 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} --- diff --git a/src/compiler/frame.h b/src/compiler/frame.h index aa823b6..0b06678 100644 --- a/src/compiler/frame.h +++ b/src/compiler/frame.h @@ -110,9 +110,9 @@ class Frame : public ZoneObject { 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) {