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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 case kX87Lzcnt: | 655 case kX87Lzcnt: |
656 __ Lzcnt(i.OutputRegister(), i.InputOperand(0)); | 656 __ Lzcnt(i.OutputRegister(), i.InputOperand(0)); |
657 break; | 657 break; |
658 case kX87Popcnt: | 658 case kX87Popcnt: |
659 __ Popcnt(i.OutputRegister(), i.InputOperand(0)); | 659 __ Popcnt(i.OutputRegister(), i.InputOperand(0)); |
660 break; | 660 break; |
661 case kX87LoadFloat64Constant: { | 661 case kX87LoadFloat64Constant: { |
662 InstructionOperand* source = instr->InputAt(0); | 662 InstructionOperand* source = instr->InputAt(0); |
663 InstructionOperand* destination = instr->Output(); | 663 InstructionOperand* destination = instr->Output(); |
664 DCHECK(source->IsConstant()); | 664 DCHECK(source->IsConstant()); |
665 X87OperandConverter g(this, NULL); | 665 X87OperandConverter g(this, nullptr); |
666 Constant src_constant = g.ToConstant(source); | 666 Constant src_constant = g.ToConstant(source); |
667 | 667 |
668 DCHECK_EQ(Constant::kFloat64, src_constant.type()); | 668 DCHECK_EQ(Constant::kFloat64, src_constant.type()); |
669 uint64_t src = bit_cast<uint64_t>(src_constant.ToFloat64()); | 669 uint64_t src = bit_cast<uint64_t>(src_constant.ToFloat64()); |
670 uint32_t lower = static_cast<uint32_t>(src); | 670 uint32_t lower = static_cast<uint32_t>(src); |
671 uint32_t upper = static_cast<uint32_t>(src >> 32); | 671 uint32_t upper = static_cast<uint32_t>(src >> 32); |
672 if (destination->IsDoubleRegister()) { | 672 if (destination->IsDoubleRegister()) { |
673 __ sub(esp, Immediate(kDoubleSize)); | 673 __ sub(esp, Immediate(kDoubleSize)); |
674 __ mov(MemOperand(esp, 0), Immediate(lower)); | 674 __ mov(MemOperand(esp, 0), Immediate(lower)); |
675 __ mov(MemOperand(esp, kInt32Size), Immediate(upper)); | 675 __ mov(MemOperand(esp, kInt32Size), Immediate(upper)); |
(...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1758 if (pop_count == 0) { | 1758 if (pop_count == 0) { |
1759 __ ret(0); | 1759 __ ret(0); |
1760 } else { | 1760 } else { |
1761 __ Ret(pop_count * kPointerSize, ebx); | 1761 __ Ret(pop_count * kPointerSize, ebx); |
1762 } | 1762 } |
1763 } | 1763 } |
1764 | 1764 |
1765 | 1765 |
1766 void CodeGenerator::AssembleMove(InstructionOperand* source, | 1766 void CodeGenerator::AssembleMove(InstructionOperand* source, |
1767 InstructionOperand* destination) { | 1767 InstructionOperand* destination) { |
1768 X87OperandConverter g(this, NULL); | 1768 X87OperandConverter g(this, nullptr); |
1769 // Dispatch on the source and destination operand kinds. Not all | 1769 // Dispatch on the source and destination operand kinds. Not all |
1770 // combinations are possible. | 1770 // combinations are possible. |
1771 if (source->IsRegister()) { | 1771 if (source->IsRegister()) { |
1772 DCHECK(destination->IsRegister() || destination->IsStackSlot()); | 1772 DCHECK(destination->IsRegister() || destination->IsStackSlot()); |
1773 Register src = g.ToRegister(source); | 1773 Register src = g.ToRegister(source); |
1774 Operand dst = g.ToOperand(destination); | 1774 Operand dst = g.ToOperand(destination); |
1775 __ mov(dst, src); | 1775 __ mov(dst, src); |
1776 } else if (source->IsStackSlot()) { | 1776 } else if (source->IsStackSlot()) { |
1777 DCHECK(destination->IsRegister() || destination->IsStackSlot()); | 1777 DCHECK(destination->IsRegister() || destination->IsStackSlot()); |
1778 Operand src = g.ToOperand(source); | 1778 Operand src = g.ToOperand(source); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1902 } | 1902 } |
1903 } | 1903 } |
1904 } else { | 1904 } else { |
1905 UNREACHABLE(); | 1905 UNREACHABLE(); |
1906 } | 1906 } |
1907 } | 1907 } |
1908 | 1908 |
1909 | 1909 |
1910 void CodeGenerator::AssembleSwap(InstructionOperand* source, | 1910 void CodeGenerator::AssembleSwap(InstructionOperand* source, |
1911 InstructionOperand* destination) { | 1911 InstructionOperand* destination) { |
1912 X87OperandConverter g(this, NULL); | 1912 X87OperandConverter g(this, nullptr); |
1913 // Dispatch on the source and destination operand kinds. Not all | 1913 // Dispatch on the source and destination operand kinds. Not all |
1914 // combinations are possible. | 1914 // combinations are possible. |
1915 if (source->IsRegister() && destination->IsRegister()) { | 1915 if (source->IsRegister() && destination->IsRegister()) { |
1916 // Register-register. | 1916 // Register-register. |
1917 Register src = g.ToRegister(source); | 1917 Register src = g.ToRegister(source); |
1918 Register dst = g.ToRegister(destination); | 1918 Register dst = g.ToRegister(destination); |
1919 __ xchg(dst, src); | 1919 __ xchg(dst, src); |
1920 } else if (source->IsRegister() && destination->IsStackSlot()) { | 1920 } else if (source->IsRegister() && destination->IsStackSlot()) { |
1921 // Register-memory. | 1921 // Register-memory. |
1922 __ xchg(g.ToRegister(source), g.ToOperand(destination)); | 1922 __ xchg(g.ToRegister(source), g.ToOperand(destination)); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1998 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1998 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1999 __ Nop(padding_size); | 1999 __ Nop(padding_size); |
2000 } | 2000 } |
2001 } | 2001 } |
2002 | 2002 |
2003 #undef __ | 2003 #undef __ |
2004 | 2004 |
2005 } // namespace compiler | 2005 } // namespace compiler |
2006 } // namespace internal | 2006 } // namespace internal |
2007 } // namespace v8 | 2007 } // namespace v8 |
OLD | NEW |