Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef V8_COMPILER_FRAME_ACCESS_STATE_H_ | |
| 6 #define V8_COMPILER_FRAME_ACCESS_STATE_H_ | |
| 7 | |
| 8 #include "src/compiler/frame.h" | |
| 9 | |
| 10 class Frame; | |
| 11 | |
| 12 namespace v8 { | |
| 13 namespace internal { | |
| 14 namespace compiler { | |
| 15 | |
| 16 class FrameAccessState : public ZoneObject { | |
|
titzer
2015/11/23 20:00:54
What about moving this class into frame.h? The two
danno
2015/11/24 12:02:00
Done.
| |
| 17 public: | |
| 18 explicit FrameAccessState(Frame* const frame) | |
| 19 : frame_(frame), access_frame_with_fp_(false), sp_delta_(0) { | |
| 20 UseDefaultFrameAccess(); | |
| 21 } | |
| 22 | |
| 23 Frame* const frame() const { return frame_; } | |
| 24 | |
| 25 int sp_delta() const { return sp_delta_; } | |
| 26 void ClearSPDelta() { sp_delta_ = 0; } | |
| 27 void IncreaseSPDelta(int amount) { sp_delta_ += amount; } | |
| 28 | |
| 29 bool access_frame_with_fp() const { return access_frame_with_fp_; } | |
| 30 void UseDefaultFrameAccess(); | |
| 31 void UseFPToAccessFrame() { access_frame_with_fp_ = true; } | |
|
titzer
2015/11/23 20:00:54
The name of these methods doesn't really indicate
danno
2015/11/24 12:02:00
Done.
| |
| 32 void UseSPToAccessFrame() { access_frame_with_fp_ = false; } | |
| 33 | |
| 34 private: | |
| 35 Frame* const frame_; | |
| 36 bool access_frame_with_fp_; | |
| 37 int sp_delta_; | |
| 38 }; | |
| 39 | |
| 40 } // namespace compiler | |
| 41 } // namespace internal | |
| 42 } // namespace v8 | |
| 43 | |
| 44 #endif // V8_COMPILER_FRAME_ACCESS_STATE_H_ | |
| OLD | NEW |