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

Unified Diff: src/compiler/frame.cc

Issue 1460183002: [turbofan] Add general support for sp-based frame access (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Last comment addressed 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
« no previous file with comments | « src/compiler/frame.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/frame.cc
diff --git a/src/compiler/frame.cc b/src/compiler/frame.cc
index 7b9a797f5a4d45345233870f49a27c284569bfbf..64ef5ed102f5b7176eb1836d34cfed9685c4c1a5 100644
--- a/src/compiler/frame.cc
+++ b/src/compiler/frame.cc
@@ -12,14 +12,41 @@ namespace v8 {
namespace internal {
namespace compiler {
-Frame::Frame(int fixed_frame_size_in_slots)
- : frame_slot_count_(fixed_frame_size_in_slots),
- outgoing_parameter_slot_count_(0),
+Frame::Frame(int fixed_frame_size_in_slots, const CallDescriptor* descriptor)
+ : needs_frame_((descriptor != nullptr) &&
+ descriptor->RequiresFrameAsIncoming()),
+ frame_slot_count_(fixed_frame_size_in_slots),
callee_saved_slot_count_(0),
spill_slot_count_(0),
allocated_registers_(NULL),
allocated_double_registers_(NULL) {}
+
+void FrameAccessState::SetFrameAccessToDefault() {
+ if (frame()->needs_frame() && !FLAG_turbo_sp_frame_access) {
+ SetFrameAccessToFP();
+ } else {
+ SetFrameAccessToSP();
+ }
+}
+
+
+FrameOffset FrameAccessState::GetFrameOffset(int spill_slot) const {
+ const int offset =
+ (StandardFrameConstants::kFixedSlotCountAboveFp - spill_slot - 1) *
+ kPointerSize;
+ if (access_frame_with_fp()) {
+ DCHECK(frame()->needs_frame());
+ return FrameOffset::FromFramePointer(offset);
+ } else {
+ // No frame. Retrieve all parameters relative to stack pointer.
+ int sp_offset =
+ offset + ((frame()->GetSpToFpSlotCount() + sp_delta()) * kPointerSize);
+ return FrameOffset::FromStackPointer(sp_offset);
+ }
+}
+
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/frame.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698