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

Unified Diff: src/compiler/frame.h

Issue 1708583002: Revert of More simplification and unification of frame handling (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 months 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 | « no previous file | 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.h
diff --git a/src/compiler/frame.h b/src/compiler/frame.h
index 011a0f02d5820e07c2064e528bbc0b2d1d8651c1..72f756b0dcd8e9693e21b9a5bf88f7ef3132d27f 100644
--- a/src/compiler/frame.h
+++ b/src/compiler/frame.h
@@ -34,10 +34,19 @@
// determined after register allocation once the number of used callee-saved
// register is certain.
//
-// The frame region immediately below the fixed header contains spill slots
-// starting at slot 4 for JSFunctions. The callee-saved frame region below that
-// starts at 4+spill_slot_count_. Callee stack slots corresponding to
-// parameters are accessible through negative slot ids.
+// Every pointer in a frame has a slot id. On 32-bit platforms, doubles consume
+// two slots.
+//
+// Stack slot indices >= 0 access the callee stack with slot 0 corresponding to
+// the callee's saved return address and 1 corresponding to the saved frame
+// pointer. Some frames have additional information stored in the fixed header,
+// for example JSFunctions store the function context and marker in the fixed
+// header, with slot index 2 corresponding to the current function context and 3
+// corresponding to the frame marker/JSFunction. The frame region immediately
+// below the fixed header contains spill slots starting at 4 for JsFunctions.
+// The callee-saved frame region below that starts at 4+spill_slot_count_.
+// Callee stack slots corresponding to parameters are accessible through
+// negative slot ids.
//
// Every slot of a caller or callee frame is accessible by the register
// allocator and gap resolver with a SpillSlotOperand containing its
@@ -67,19 +76,29 @@
// |- - - - - - - - -| | frame slots
// ... | ... | Spill slots (slot >= 0)
// |- - - - - - - - -| | |
-// m+3 | spill m | v |
+// m+4 | spill m | v |
// +-----------------+---- |
-// m+4 | callee-saved 1 | ^ |
+// m+5 | callee-saved 1 | ^ |
// |- - - - - - - - -| | |
// | ... | Callee-saved |
// |- - - - - - - - -| | |
-// m+r+3 | callee-saved r | v v
+// m+r+4 | callee-saved r | v v
// -----+-----------------+----- <-- stack ptr -------------
//
class Frame : public ZoneObject {
public:
explicit Frame(int fixed_frame_size_in_slots,
const CallDescriptor* descriptor);
+
+ static int FPOffsetToSlot(int frame_offset) {
+ return StandardFrameConstants::kFixedSlotCountAboveFp - 1 -
+ frame_offset / kPointerSize;
+ }
+
+ static int SlotToFPOffset(int slot) {
+ return (StandardFrameConstants::kFixedSlotCountAboveFp - 1 - slot) *
+ kPointerSize;
+ }
inline bool needs_frame() const { return needs_frame_; }
inline void MarkNeedsFrame() { needs_frame_ = true; }
« no previous file with comments | « no previous file | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698