OLD | NEW |
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 Loading... |
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 |
OLD | NEW |