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/compiler/code-generator-impl.h" | 7 #include "src/compiler/code-generator-impl.h" |
8 #include "src/compiler/gap-resolver.h" | 8 #include "src/compiler/gap-resolver.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/osr.h" | 10 #include "src/compiler/osr.h" |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 DCHECK(output.code() == 0); | 1062 DCHECK(output.code() == 0); |
1063 __ fstp(0); | 1063 __ fstp(0); |
1064 __ fld_s(i.MemoryOperand()); | 1064 __ fld_s(i.MemoryOperand()); |
1065 } else { | 1065 } else { |
1066 size_t index = 0; | 1066 size_t index = 0; |
1067 Operand operand = i.MemoryOperand(&index); | 1067 Operand operand = i.MemoryOperand(&index); |
1068 __ fst_s(operand); | 1068 __ fst_s(operand); |
1069 } | 1069 } |
1070 break; | 1070 break; |
1071 } | 1071 } |
| 1072 case kX87BitcastFI: { |
| 1073 __ fstp(0); |
| 1074 __ mov(i.OutputRegister(), MemOperand(esp, 0)); |
| 1075 __ lea(esp, Operand(esp, kFloatSize)); |
| 1076 break; |
| 1077 } |
| 1078 case kX87BitcastIF: { |
| 1079 if (instr->InputAt(0)->IsRegister()) { |
| 1080 __ lea(esp, Operand(esp, -kFloatSize)); |
| 1081 __ mov(MemOperand(esp, 0), i.InputRegister(0)); |
| 1082 __ fstp(0); |
| 1083 __ fld_s(MemOperand(esp, 0)); |
| 1084 __ lea(esp, Operand(esp, kFloatSize)); |
| 1085 } else { |
| 1086 __ lea(esp, Operand(esp, -kDoubleSize)); |
| 1087 __ mov(MemOperand(esp, 0), i.InputRegister(0)); |
| 1088 __ fstp(0); |
| 1089 __ fld_d(MemOperand(esp, 0)); |
| 1090 __ lea(esp, Operand(esp, kDoubleSize)); |
| 1091 } |
| 1092 break; |
| 1093 } |
1072 case kX87Lea: { | 1094 case kX87Lea: { |
1073 AddressingMode mode = AddressingModeField::decode(instr->opcode()); | 1095 AddressingMode mode = AddressingModeField::decode(instr->opcode()); |
1074 // Shorten "leal" to "addl", "subl" or "shll" if the register allocation | 1096 // Shorten "leal" to "addl", "subl" or "shll" if the register allocation |
1075 // and addressing mode just happens to work out. The "addl"/"subl" forms | 1097 // and addressing mode just happens to work out. The "addl"/"subl" forms |
1076 // in these cases are faster based on measurements. | 1098 // in these cases are faster based on measurements. |
1077 if (mode == kMode_MI) { | 1099 if (mode == kMode_MI) { |
1078 __ Move(i.OutputRegister(), Immediate(i.InputInt32(0))); | 1100 __ Move(i.OutputRegister(), Immediate(i.InputInt32(0))); |
1079 } else if (i.InputRegister(0).is(i.OutputRegister())) { | 1101 } else if (i.InputRegister(0).is(i.OutputRegister())) { |
1080 if (mode == kMode_MRI) { | 1102 if (mode == kMode_MRI) { |
1081 int32_t constant_summand = i.InputInt32(1); | 1103 int32_t constant_summand = i.InputInt32(1); |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1854 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; | 1876 int padding_size = last_lazy_deopt_pc_ + space_needed - current_pc; |
1855 __ Nop(padding_size); | 1877 __ Nop(padding_size); |
1856 } | 1878 } |
1857 } | 1879 } |
1858 | 1880 |
1859 #undef __ | 1881 #undef __ |
1860 | 1882 |
1861 } // namespace compiler | 1883 } // namespace compiler |
1862 } // namespace internal | 1884 } // namespace internal |
1863 } // namespace v8 | 1885 } // namespace v8 |
OLD | NEW |