Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: src/compiler/frame-access-state.h

Issue 1460183002: [turbofan] Add general support for sp-based frame access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: All platforms Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..d6138277132cbd3f60b847dc07fcd096fae507e7
--- /dev/null
+++ b/src/compiler/frame-access-state.h
@@ -0,0 +1,44 @@
+// Copyright 2015 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 {
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.
+ 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; }
titzer 2015/11/23 20:00:54 The name of these methods doesn't really indicate
danno 2015/11/24 12:02:00 Done.
+ 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_

Powered by Google App Engine
This is Rietveld 408576698