| Index: src/compiler/frame.h
|
| diff --git a/src/compiler/frame.h b/src/compiler/frame.h
|
| index 2850a8c1a152e74f287bbf60129bf71e2109a9b5..32a3ea1f14885db50098a2b483d3e6cfac889961 100644
|
| --- a/src/compiler/frame.h
|
| +++ b/src/compiler/frame.h
|
| @@ -17,14 +17,26 @@ namespace compiler {
|
| // and epilogue to compiled code.
|
| class Frame : public ZoneObject {
|
| public:
|
| - Frame()
|
| - : register_save_area_size_(0),
|
| + explicit Frame(bool needs_frame)
|
| + : needs_frame_(needs_frame),
|
| + register_save_area_size_(0),
|
| spill_slot_count_(0),
|
| + max_tail_call_stack_delta_(0),
|
| osr_stack_slot_count_(0),
|
| allocated_registers_(NULL),
|
| allocated_double_registers_(NULL) {}
|
|
|
| - inline int GetSpillSlotCount() { return spill_slot_count_; }
|
| + inline int GetSpillSlotCount() const { return spill_slot_count_; }
|
| +
|
| + inline int GetFrameSlotCount() const {
|
| + if (needs_frame_ || spill_slot_count_ > 0) {
|
| + return std::max(spill_slot_count_, max_tail_call_stack_delta_);
|
| + }
|
| + return 0;
|
| + }
|
| +
|
| + inline void MarkNeedsFrame() { needs_frame_ = true; }
|
| + inline bool NeedsFrame() const { return needs_frame_; }
|
|
|
| void SetAllocatedRegisters(BitVector* regs) {
|
| DCHECK(allocated_registers_ == NULL);
|
| @@ -57,6 +69,7 @@ class Frame : public ZoneObject {
|
|
|
| int AllocateSpillSlot(int width) {
|
| DCHECK(width == 4 || width == 8);
|
| + needs_frame_ = true;
|
| // Skip one slot if necessary.
|
| if (width > kPointerSize) {
|
| DCHECK(width == kPointerSize * 2);
|
| @@ -68,12 +81,22 @@ class Frame : public ZoneObject {
|
|
|
| void ReserveSpillSlots(size_t slot_count) {
|
| DCHECK_EQ(0, spill_slot_count_); // can only reserve before allocation.
|
| + needs_frame_ = true;
|
| spill_slot_count_ = static_cast<int>(slot_count);
|
| }
|
|
|
| + void UpdateMaxTailCallStackDelta(int stack_delta) {
|
| + if (stack_delta > max_tail_call_stack_delta_) {
|
| + max_tail_call_stack_delta_ = stack_delta;
|
| + }
|
| + }
|
| + int max_tail_call_stack_delta() { return max_tail_call_stack_delta_; }
|
| +
|
| private:
|
| + bool needs_frame_;
|
| int register_save_area_size_;
|
| int spill_slot_count_;
|
| + int max_tail_call_stack_delta_;
|
| int osr_stack_slot_count_;
|
| BitVector* allocated_registers_;
|
| BitVector* allocated_double_registers_;
|
|
|