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, int alignment = 0) { | 114 int AllocateSpillSlot(int width) { |
115 int frame_slot_count_before = frame_slot_count_; | 115 int frame_slot_count_before = frame_slot_count_; |
116 if (alignment <= kPointerSize) { | 116 AllocateAlignedFrameSlots(width); |
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 } | |
126 spill_slot_count_ += frame_slot_count_ - frame_slot_count_before; | 117 spill_slot_count_ += frame_slot_count_ - frame_slot_count_before; |
127 return frame_slot_count_ - 1; | 118 return frame_slot_count_ - 1; |
128 } | 119 } |
129 | 120 |
130 int AlignFrame(int alignment = kDoubleSize); | 121 int AlignFrame(int alignment = kDoubleSize); |
131 | 122 |
132 int ReserveSpillSlots(size_t slot_count) { | 123 int ReserveSpillSlots(size_t slot_count) { |
133 DCHECK_EQ(0, spill_slot_count_); | 124 DCHECK_EQ(0, spill_slot_count_); |
134 spill_slot_count_ += static_cast<int>(slot_count); | 125 spill_slot_count_ += static_cast<int>(slot_count); |
135 frame_slot_count_ += static_cast<int>(slot_count); | 126 frame_slot_count_ += static_cast<int>(slot_count); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 const Frame* const frame_; | 223 const Frame* const frame_; |
233 bool access_frame_with_fp_; | 224 bool access_frame_with_fp_; |
234 int sp_delta_; | 225 int sp_delta_; |
235 bool has_frame_; | 226 bool has_frame_; |
236 }; | 227 }; |
237 } // namespace compiler | 228 } // namespace compiler |
238 } // namespace internal | 229 } // namespace internal |
239 } // namespace v8 | 230 } // namespace v8 |
240 | 231 |
241 #endif // V8_COMPILER_FRAME_H_ | 232 #endif // V8_COMPILER_FRAME_H_ |
OLD | NEW |