OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
8 #include "src/compiler/code-generator-impl.h" | 8 #include "src/compiler/code-generator-impl.h" |
9 #include "src/compiler/gap-resolver.h" | 9 #include "src/compiler/gap-resolver.h" |
10 #include "src/compiler/node-matchers.h" | 10 #include "src/compiler/node-matchers.h" |
(...skipping 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1657 } | 1657 } |
1658 } else { | 1658 } else { |
1659 __ lea(i.OutputRegister(), i.MemoryOperand()); | 1659 __ lea(i.OutputRegister(), i.MemoryOperand()); |
1660 } | 1660 } |
1661 break; | 1661 break; |
1662 } | 1662 } |
1663 case kX87Push: | 1663 case kX87Push: |
1664 if (instr->InputAt(0)->IsFPRegister()) { | 1664 if (instr->InputAt(0)->IsFPRegister()) { |
1665 auto allocated = AllocatedOperand::cast(*instr->InputAt(0)); | 1665 auto allocated = AllocatedOperand::cast(*instr->InputAt(0)); |
1666 if (allocated.representation() == MachineRepresentation::kFloat32) { | 1666 if (allocated.representation() == MachineRepresentation::kFloat32) { |
1667 __ sub(esp, Immediate(kDoubleSize)); | 1667 __ sub(esp, Immediate(kFloatSize)); |
1668 __ fst_s(Operand(esp, 0)); | 1668 __ fst_s(Operand(esp, 0)); |
| 1669 frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize); |
1669 } else { | 1670 } else { |
1670 DCHECK(allocated.representation() == MachineRepresentation::kFloat64); | 1671 DCHECK(allocated.representation() == MachineRepresentation::kFloat64); |
1671 __ sub(esp, Immediate(kDoubleSize)); | 1672 __ sub(esp, Immediate(kDoubleSize)); |
1672 __ fst_d(Operand(esp, 0)); | 1673 __ fst_d(Operand(esp, 0)); |
| 1674 frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize); |
1673 } | 1675 } |
1674 frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize); | |
1675 } else if (instr->InputAt(0)->IsFPStackSlot()) { | 1676 } else if (instr->InputAt(0)->IsFPStackSlot()) { |
1676 auto allocated = AllocatedOperand::cast(*instr->InputAt(0)); | 1677 auto allocated = AllocatedOperand::cast(*instr->InputAt(0)); |
1677 if (allocated.representation() == MachineRepresentation::kFloat32) { | 1678 if (allocated.representation() == MachineRepresentation::kFloat32) { |
1678 __ sub(esp, Immediate(kDoubleSize)); | 1679 __ sub(esp, Immediate(kFloatSize)); |
1679 __ fld_s(i.InputOperand(0)); | 1680 __ fld_s(i.InputOperand(0)); |
1680 __ fstp_s(MemOperand(esp, 0)); | 1681 __ fstp_s(MemOperand(esp, 0)); |
| 1682 frame_access_state()->IncreaseSPDelta(kFloatSize / kPointerSize); |
1681 } else { | 1683 } else { |
1682 DCHECK(allocated.representation() == MachineRepresentation::kFloat64); | 1684 DCHECK(allocated.representation() == MachineRepresentation::kFloat64); |
1683 __ sub(esp, Immediate(kDoubleSize)); | 1685 __ sub(esp, Immediate(kDoubleSize)); |
1684 __ fld_d(i.InputOperand(0)); | 1686 __ fld_d(i.InputOperand(0)); |
1685 __ fstp_d(MemOperand(esp, 0)); | 1687 __ fstp_d(MemOperand(esp, 0)); |
| 1688 frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize); |
1686 } | 1689 } |
1687 frame_access_state()->IncreaseSPDelta(kDoubleSize / kPointerSize); | |
1688 } else if (HasImmediateInput(instr, 0)) { | 1690 } else if (HasImmediateInput(instr, 0)) { |
1689 __ push(i.InputImmediate(0)); | 1691 __ push(i.InputImmediate(0)); |
1690 frame_access_state()->IncreaseSPDelta(1); | 1692 frame_access_state()->IncreaseSPDelta(1); |
1691 } else { | 1693 } else { |
1692 __ push(i.InputOperand(0)); | 1694 __ push(i.InputOperand(0)); |
1693 frame_access_state()->IncreaseSPDelta(1); | 1695 frame_access_state()->IncreaseSPDelta(1); |
1694 } | 1696 } |
1695 break; | 1697 break; |
1696 case kX87Poke: { | 1698 case kX87Poke: { |
1697 int const slot = MiscField::decode(instr->opcode()); | 1699 int const slot = MiscField::decode(instr->opcode()); |
(...skipping 795 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2493 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 2495 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
2494 __ Nop(padding_size); | 2496 __ Nop(padding_size); |
2495 } | 2497 } |
2496 } | 2498 } |
2497 | 2499 |
2498 #undef __ | 2500 #undef __ |
2499 | 2501 |
2500 } // namespace compiler | 2502 } // namespace compiler |
2501 } // namespace internal | 2503 } // namespace internal |
2502 } // namespace v8 | 2504 } // namespace v8 |
OLD | NEW |