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

Side by Side Diff: src/compiler/frame.h

Issue 1777013004: Small cleanup refactoring of sp-to-fp offset and slot conversions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_FRAME_H_ 5 #ifndef V8_COMPILER_FRAME_H_
6 #define V8_COMPILER_FRAME_H_ 6 #define V8_COMPILER_FRAME_H_
7 7
8 #include "src/bit-vector.h" 8 #include "src/bit-vector.h"
9 #include "src/frames.h" 9 #include "src/frames.h"
10 10
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 218
219 int sp_delta() const { return sp_delta_; } 219 int sp_delta() const { return sp_delta_; }
220 void ClearSPDelta() { sp_delta_ = 0; } 220 void ClearSPDelta() { sp_delta_ = 0; }
221 void IncreaseSPDelta(int amount) { sp_delta_ += amount; } 221 void IncreaseSPDelta(int amount) { sp_delta_ += amount; }
222 222
223 bool access_frame_with_fp() const { return access_frame_with_fp_; } 223 bool access_frame_with_fp() const { return access_frame_with_fp_; }
224 void SetFrameAccessToDefault(); 224 void SetFrameAccessToDefault();
225 void SetFrameAccessToFP() { access_frame_with_fp_ = true; } 225 void SetFrameAccessToFP() { access_frame_with_fp_ = true; }
226 void SetFrameAccessToSP() { access_frame_with_fp_ = false; } 226 void SetFrameAccessToSP() { access_frame_with_fp_ = false; }
227 227
228 int GetSpToFpSlotCount() const {
229 return frame_->GetSpToFpSlotCount() + sp_delta();
230 }
231 int GetSpToFpOffset() const { return GetSpToFpSlotCount() * kPointerSize; }
232
228 // Get the frame offset for a given spill slot. The location depends on the 233 // Get the frame offset for a given spill slot. The location depends on the
229 // calling convention and the specific frame layout, and may thus be 234 // calling convention and the specific frame layout, and may thus be
230 // architecture-specific. Negative spill slots indicate arguments on the 235 // architecture-specific. Negative spill slots indicate arguments on the
231 // caller's frame. 236 // caller's frame.
232 FrameOffset GetFrameOffset(int spill_slot) const; 237 FrameOffset GetFrameOffset(int spill_slot) const;
233 238
234 private: 239 private:
235 Frame* const frame_; 240 Frame* const frame_;
236 bool access_frame_with_fp_; 241 bool access_frame_with_fp_;
237 int sp_delta_; 242 int sp_delta_;
238 }; 243 };
239 } // namespace compiler 244 } // namespace compiler
240 } // namespace internal 245 } // namespace internal
241 } // namespace v8 246 } // namespace v8
242 247
243 #endif // V8_COMPILER_FRAME_H_ 248 #endif // V8_COMPILER_FRAME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698