Index: src/compiler/frame-access-state.h |
diff --git a/src/compiler/frame-access-state.h b/src/compiler/frame-access-state.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2b93cd27f3eba4481d38fa8af68e5565136cf34d |
--- /dev/null |
+++ b/src/compiler/frame-access-state.h |
@@ -0,0 +1,44 @@ |
+// Copyright 2014 the V8 project authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef V8_COMPILER_FRAME_ACCESS_STATE_H_ |
+#define V8_COMPILER_FRAME_ACCESS_STATE_H_ |
+ |
+#include "src/compiler/frame.h" |
+ |
+class Frame; |
+ |
+namespace v8 { |
+namespace internal { |
+namespace compiler { |
+ |
+class FrameAccessState : public ZoneObject { |
+ public: |
+ explicit FrameAccessState(Frame* const frame) |
+ : frame_(frame), access_frame_with_fp_(false), sp_delta_(0) { |
+ UseDefaultFrameAccess(); |
+ } |
+ |
+ Frame* const frame() const { return frame_; } |
+ |
+ int sp_delta() const { return sp_delta_; } |
+ void ClearSPDelta() { sp_delta_ = 0; } |
+ void IncreaseSPDelta(int amount) { sp_delta_ += amount; } |
+ |
+ bool access_frame_with_fp() const { return access_frame_with_fp_; } |
+ void UseDefaultFrameAccess(); |
+ void UseFPToAccessFrame() { access_frame_with_fp_ = true; } |
+ void UseSPToAccessFrame() { access_frame_with_fp_ = false; } |
+ |
+ private: |
+ Frame* const frame_; |
+ bool access_frame_with_fp_; |
+ int sp_delta_; |
+}; |
+ |
+} // namespace compiler |
+} // namespace internal |
+} // namespace v8 |
+ |
+#endif // V8_COMPILER_FRAME_ACCESS_STATE_H_ |