OLD | NEW |
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 #include "src/compiler/code-generator.h" | 5 #include "src/compiler/code-generator.h" |
6 | 6 |
7 #include "src/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
8 #include "src/arm64/macro-assembler-arm64.h" | 8 #include "src/arm64/macro-assembler-arm64.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/compiler/code-generator-impl.h" | 10 #include "src/compiler/code-generator-impl.h" |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 UNREACHABLE(); | 203 UNREACHABLE(); |
204 return Operand(-1); | 204 return Operand(-1); |
205 } | 205 } |
206 | 206 |
207 MemOperand ToMemOperand(InstructionOperand* op, MacroAssembler* masm) const { | 207 MemOperand ToMemOperand(InstructionOperand* op, MacroAssembler* masm) const { |
208 DCHECK_NOT_NULL(op); | 208 DCHECK_NOT_NULL(op); |
209 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); | 209 DCHECK(op->IsStackSlot() || op->IsDoubleStackSlot()); |
210 FrameOffset offset = frame_access_state()->GetFrameOffset( | 210 FrameOffset offset = frame_access_state()->GetFrameOffset( |
211 AllocatedOperand::cast(op)->index()); | 211 AllocatedOperand::cast(op)->index()); |
212 if (offset.from_frame_pointer()) { | 212 if (offset.from_frame_pointer()) { |
213 int from_sp = | 213 int from_sp = offset.offset() + frame_access_state()->GetSPToFPOffset(); |
214 offset.offset() + | |
215 ((frame()->GetSpToFpSlotCount() + frame_access_state()->sp_delta()) * | |
216 kPointerSize); | |
217 // Convert FP-offsets to SP-offsets if it results in better code. | 214 // Convert FP-offsets to SP-offsets if it results in better code. |
218 if (Assembler::IsImmLSUnscaled(from_sp) || | 215 if (Assembler::IsImmLSUnscaled(from_sp) || |
219 Assembler::IsImmLSScaled(from_sp, LSDoubleWord)) { | 216 Assembler::IsImmLSScaled(from_sp, LSDoubleWord)) { |
220 offset = FrameOffset::FromStackPointer(from_sp); | 217 offset = FrameOffset::FromStackPointer(from_sp); |
221 } | 218 } |
222 } | 219 } |
223 return MemOperand(offset.from_stack_pointer() ? masm->StackPointer() : fp, | 220 return MemOperand(offset.from_stack_pointer() ? masm->StackPointer() : fp, |
224 offset.offset()); | 221 offset.offset()); |
225 } | 222 } |
226 }; | 223 }; |
(...skipping 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1765 padding_size -= kInstructionSize; | 1762 padding_size -= kInstructionSize; |
1766 } | 1763 } |
1767 } | 1764 } |
1768 } | 1765 } |
1769 | 1766 |
1770 #undef __ | 1767 #undef __ |
1771 | 1768 |
1772 } // namespace compiler | 1769 } // namespace compiler |
1773 } // namespace internal | 1770 } // namespace internal |
1774 } // namespace v8 | 1771 } // namespace v8 |
OLD | NEW |