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

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

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: Review feedback 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
« no previous file with comments | « src/compiler/frame.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 #include "src/compiler/frame.h" 5 #include "src/compiler/frame.h"
6 6
7 #include "src/compiler/linkage.h" 7 #include "src/compiler/linkage.h"
8 #include "src/compiler/register-allocator.h" 8 #include "src/compiler/register-allocator.h"
9 #include "src/macro-assembler.h" 9 #include "src/macro-assembler.h"
10 10
(...skipping 26 matching lines...) Expand all
37 void FrameAccessState::SetFrameAccessToDefault() { 37 void FrameAccessState::SetFrameAccessToDefault() {
38 if (frame()->needs_frame() && !FLAG_turbo_sp_frame_access) { 38 if (frame()->needs_frame() && !FLAG_turbo_sp_frame_access) {
39 SetFrameAccessToFP(); 39 SetFrameAccessToFP();
40 } else { 40 } else {
41 SetFrameAccessToSP(); 41 SetFrameAccessToSP();
42 } 42 }
43 } 43 }
44 44
45 45
46 FrameOffset FrameAccessState::GetFrameOffset(int spill_slot) const { 46 FrameOffset FrameAccessState::GetFrameOffset(int spill_slot) const {
47 const int offset = 47 const int frame_offset = FrameSlotToFPOffset(spill_slot);
48 (StandardFrameConstants::kFixedSlotCountAboveFp - spill_slot - 1) *
49 kPointerSize;
50 if (access_frame_with_fp()) { 48 if (access_frame_with_fp()) {
51 DCHECK(frame()->needs_frame()); 49 DCHECK(frame()->needs_frame());
52 return FrameOffset::FromFramePointer(offset); 50 return FrameOffset::FromFramePointer(frame_offset);
53 } else { 51 } else {
54 // No frame. Retrieve all parameters relative to stack pointer. 52 // No frame. Retrieve all parameters relative to stack pointer.
55 int sp_offset = 53 int sp_offset = frame_offset + GetSPToFPOffset();
56 offset + ((frame()->GetSpToFpSlotCount() + sp_delta()) * kPointerSize);
57 return FrameOffset::FromStackPointer(sp_offset); 54 return FrameOffset::FromStackPointer(sp_offset);
58 } 55 }
59 } 56 }
60 57
61 58
62 } // namespace compiler 59 } // namespace compiler
63 } // namespace internal 60 } // namespace internal
64 } // namespace v8 61 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698