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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 129 } |
130 | 130 |
131 int ReserveSpillSlots(size_t slot_count) { | 131 int ReserveSpillSlots(size_t slot_count) { |
132 DCHECK_EQ(0, spilled_callee_register_slot_count_); | 132 DCHECK_EQ(0, spilled_callee_register_slot_count_); |
133 DCHECK_EQ(0, stack_slot_count_); | 133 DCHECK_EQ(0, stack_slot_count_); |
134 stack_slot_count_ += static_cast<int>(slot_count); | 134 stack_slot_count_ += static_cast<int>(slot_count); |
135 frame_slot_count_ += static_cast<int>(slot_count); | 135 frame_slot_count_ += static_cast<int>(slot_count); |
136 return frame_slot_count_ - 1; | 136 return frame_slot_count_ - 1; |
137 } | 137 } |
138 | 138 |
| 139 static const int kContextSlot = 2; |
| 140 static const int kJSFunctionSlot = 3; |
| 141 |
139 private: | 142 private: |
140 int AllocateAlignedFrameSlot(int width) { | 143 int AllocateAlignedFrameSlot(int width) { |
141 DCHECK(width == 4 || width == 8); | 144 DCHECK(width == 4 || width == 8); |
142 // Skip one slot if necessary. | 145 // Skip one slot if necessary. |
143 if (width > kPointerSize) { | 146 if (width > kPointerSize) { |
144 DCHECK(width == kPointerSize * 2); | 147 DCHECK(width == kPointerSize * 2); |
145 frame_slot_count_++; | 148 frame_slot_count_++; |
146 frame_slot_count_ |= 1; | 149 frame_slot_count_ |= 1; |
147 } | 150 } |
148 return frame_slot_count_++; | 151 return frame_slot_count_++; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 int offset_; // Encodes SP or FP in the low order bit. | 185 int offset_; // Encodes SP or FP in the low order bit. |
183 | 186 |
184 static const int kFromSp = 1; | 187 static const int kFromSp = 1; |
185 static const int kFromFp = 0; | 188 static const int kFromFp = 0; |
186 }; | 189 }; |
187 } // namespace compiler | 190 } // namespace compiler |
188 } // namespace internal | 191 } // namespace internal |
189 } // namespace v8 | 192 } // namespace v8 |
190 | 193 |
191 #endif // V8_COMPILER_FRAME_H_ | 194 #endif // V8_COMPILER_FRAME_H_ |
OLD | NEW |