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; | 139 static const int kContextSlot = 2 + StandardFrameConstants::kCPSlotCount; |
140 static const int kJSFunctionSlot = 3; | 140 static const int kJSFunctionSlot = 3 + StandardFrameConstants::kCPSlotCount; |
141 | 141 |
142 private: | 142 private: |
143 int AllocateAlignedFrameSlot(int width) { | 143 int AllocateAlignedFrameSlot(int width) { |
144 DCHECK(width == 4 || width == 8); | 144 DCHECK(width == 4 || width == 8); |
145 // Skip one slot if necessary. | 145 // Skip one slot if necessary. |
146 if (width > kPointerSize) { | 146 if (width > kPointerSize) { |
147 DCHECK(width == kPointerSize * 2); | 147 DCHECK(width == kPointerSize * 2); |
148 frame_slot_count_++; | 148 frame_slot_count_++; |
149 frame_slot_count_ |= 1; | 149 frame_slot_count_ |= 1; |
150 } | 150 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 int offset_; // Encodes SP or FP in the low order bit. | 185 int offset_; // Encodes SP or FP in the low order bit. |
186 | 186 |
187 static const int kFromSp = 1; | 187 static const int kFromSp = 1; |
188 static const int kFromFp = 0; | 188 static const int kFromFp = 0; |
189 }; | 189 }; |
190 } // namespace compiler | 190 } // namespace compiler |
191 } // namespace internal | 191 } // namespace internal |
192 } // namespace v8 | 192 } // namespace v8 |
193 | 193 |
194 #endif // V8_COMPILER_FRAME_H_ | 194 #endif // V8_COMPILER_FRAME_H_ |
OLD | NEW |