OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_FRAME_H_ | 5 #ifndef V8_COMPILER_FRAME_H_ |
6 #define V8_COMPILER_FRAME_H_ | 6 #define V8_COMPILER_FRAME_H_ |
7 | 7 |
8 #include "src/bit-vector.h" | 8 #include "src/bit-vector.h" |
9 #include "src/frames.h" | 9 #include "src/frames.h" |
10 | 10 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 if (delta != alignment_slots) { | 104 if (delta != alignment_slots) { |
105 frame_slot_count_ += delta; | 105 frame_slot_count_ += delta; |
106 } | 106 } |
107 spill_slot_count_ += delta; | 107 spill_slot_count_ += delta; |
108 } | 108 } |
109 | 109 |
110 void AllocateSavedCalleeRegisterSlots(int count) { | 110 void AllocateSavedCalleeRegisterSlots(int count) { |
111 frame_slot_count_ += count; | 111 frame_slot_count_ += count; |
112 } | 112 } |
113 | 113 |
114 int AllocateSpillSlot(int width) { | 114 int AllocateSpillSlot(int width, int alignment = 0) { |
115 int frame_slot_count_before = frame_slot_count_; | 115 int frame_slot_count_before = frame_slot_count_; |
116 AllocateAlignedFrameSlots(width); | 116 if (alignment <= kPointerSize) { |
| 117 AllocateAlignedFrameSlots(width); |
| 118 } else { |
| 119 // We need to allocate more place for spill slot |
| 120 // in case we need an aligned spill slot to be |
| 121 // able to properly align start of spill slot |
| 122 // and still have enough place to hold all the |
| 123 // data |
| 124 AllocateAlignedFrameSlots(width + alignment - kPointerSize); |
| 125 } |
117 spill_slot_count_ += frame_slot_count_ - frame_slot_count_before; | 126 spill_slot_count_ += frame_slot_count_ - frame_slot_count_before; |
118 return frame_slot_count_ - 1; | 127 return frame_slot_count_ - 1; |
119 } | 128 } |
120 | 129 |
121 int AlignFrame(int alignment = kDoubleSize); | 130 int AlignFrame(int alignment = kDoubleSize); |
122 | 131 |
123 int ReserveSpillSlots(size_t slot_count) { | 132 int ReserveSpillSlots(size_t slot_count) { |
124 DCHECK_EQ(0, spill_slot_count_); | 133 DCHECK_EQ(0, spill_slot_count_); |
125 spill_slot_count_ += static_cast<int>(slot_count); | 134 spill_slot_count_ += static_cast<int>(slot_count); |
126 frame_slot_count_ += static_cast<int>(slot_count); | 135 frame_slot_count_ += static_cast<int>(slot_count); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 const Frame* const frame_; | 232 const Frame* const frame_; |
224 bool access_frame_with_fp_; | 233 bool access_frame_with_fp_; |
225 int sp_delta_; | 234 int sp_delta_; |
226 bool has_frame_; | 235 bool has_frame_; |
227 }; | 236 }; |
228 } // namespace compiler | 237 } // namespace compiler |
229 } // namespace internal | 238 } // namespace internal |
230 } // namespace v8 | 239 } // namespace v8 |
231 | 240 |
232 #endif // V8_COMPILER_FRAME_H_ | 241 #endif // V8_COMPILER_FRAME_H_ |
OLD | NEW |