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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 // Encapsulates the mutable state maintained during code generation about the | 222 // Encapsulates the mutable state maintained during code generation about the |
223 // current function's frame. | 223 // current function's frame. |
224 class FrameAccessState : public ZoneObject { | 224 class FrameAccessState : public ZoneObject { |
225 public: | 225 public: |
226 explicit FrameAccessState(Frame* const frame) | 226 explicit FrameAccessState(Frame* const frame) |
227 : frame_(frame), access_frame_with_fp_(false), sp_delta_(0) { | 227 : frame_(frame), access_frame_with_fp_(false), sp_delta_(0) { |
228 SetFrameAccessToDefault(); | 228 SetFrameAccessToDefault(); |
229 } | 229 } |
230 | 230 |
231 Frame* const frame() const { return frame_; } | 231 Frame* frame() const { return frame_; } |
232 | 232 |
233 int sp_delta() const { return sp_delta_; } | 233 int sp_delta() const { return sp_delta_; } |
234 void ClearSPDelta() { sp_delta_ = 0; } | 234 void ClearSPDelta() { sp_delta_ = 0; } |
235 void IncreaseSPDelta(int amount) { sp_delta_ += amount; } | 235 void IncreaseSPDelta(int amount) { sp_delta_ += amount; } |
236 | 236 |
237 bool access_frame_with_fp() const { return access_frame_with_fp_; } | 237 bool access_frame_with_fp() const { return access_frame_with_fp_; } |
238 void SetFrameAccessToDefault(); | 238 void SetFrameAccessToDefault(); |
239 void SetFrameAccessToFP() { access_frame_with_fp_ = true; } | 239 void SetFrameAccessToFP() { access_frame_with_fp_ = true; } |
240 void SetFrameAccessToSP() { access_frame_with_fp_ = false; } | 240 void SetFrameAccessToSP() { access_frame_with_fp_ = false; } |
241 | 241 |
242 // Get the frame offset for a given spill slot. The location depends on the | 242 // Get the frame offset for a given spill slot. The location depends on the |
243 // calling convention and the specific frame layout, and may thus be | 243 // calling convention and the specific frame layout, and may thus be |
244 // architecture-specific. Negative spill slots indicate arguments on the | 244 // architecture-specific. Negative spill slots indicate arguments on the |
245 // caller's frame. | 245 // caller's frame. |
246 FrameOffset GetFrameOffset(int spill_slot) const; | 246 FrameOffset GetFrameOffset(int spill_slot) const; |
247 | 247 |
248 private: | 248 private: |
249 Frame* const frame_; | 249 Frame* const frame_; |
250 bool access_frame_with_fp_; | 250 bool access_frame_with_fp_; |
251 int sp_delta_; | 251 int sp_delta_; |
252 }; | 252 }; |
253 } // namespace compiler | 253 } // namespace compiler |
254 } // namespace internal | 254 } // namespace internal |
255 } // namespace v8 | 255 } // namespace v8 |
256 | 256 |
257 #endif // V8_COMPILER_FRAME_H_ | 257 #endif // V8_COMPILER_FRAME_H_ |
OLD | NEW |