| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. |
| 6 #if defined(TARGET_ARCH_IA32) | 6 #if defined(TARGET_ARCH_IA32) |
| 7 | 7 |
| 8 #include "vm/flow_graph_compiler.h" | 8 #include "vm/flow_graph_compiler.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 __ Drop(1); | 1311 __ Drop(1); |
| 1312 __ jmp(skip_call); | 1312 __ jmp(skip_call); |
| 1313 __ Bind(&is_false); | 1313 __ Bind(&is_false); |
| 1314 __ LoadObject(result, Bool::False()); | 1314 __ LoadObject(result, Bool::False()); |
| 1315 __ Drop(1); | 1315 __ Drop(1); |
| 1316 __ jmp(skip_call); | 1316 __ jmp(skip_call); |
| 1317 __ Bind(&fall_through); | 1317 __ Bind(&fall_through); |
| 1318 } | 1318 } |
| 1319 | 1319 |
| 1320 | 1320 |
| 1321 void FlowGraphCompiler::LoadDoubleOrSmiToFpu(FpuRegister result, | |
| 1322 Register reg, | |
| 1323 Register temp, | |
| 1324 Label* not_double_or_smi) { | |
| 1325 Label is_smi, done; | |
| 1326 __ testl(reg, Immediate(kSmiTagMask)); | |
| 1327 __ j(ZERO, &is_smi); | |
| 1328 __ CompareClassId(reg, kDoubleCid, temp); | |
| 1329 __ j(NOT_EQUAL, not_double_or_smi); | |
| 1330 __ movsd(result, FieldAddress(reg, Double::value_offset())); | |
| 1331 __ jmp(&done); | |
| 1332 __ Bind(&is_smi); | |
| 1333 __ movl(temp, reg); | |
| 1334 __ SmiUntag(temp); | |
| 1335 __ cvtsi2sd(result, temp); | |
| 1336 __ Bind(&done); | |
| 1337 } | |
| 1338 | |
| 1339 | |
| 1340 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { | 1321 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { |
| 1341 // TODO(vegorov): consider saving only caller save (volatile) registers. | 1322 // TODO(vegorov): consider saving only caller save (volatile) registers. |
| 1342 const intptr_t xmm_regs_count = locs->live_registers()->fpu_regs_count(); | 1323 const intptr_t xmm_regs_count = locs->live_registers()->fpu_regs_count(); |
| 1343 if (xmm_regs_count > 0) { | 1324 if (xmm_regs_count > 0) { |
| 1344 __ subl(ESP, Immediate(xmm_regs_count * kDoubleSize)); | 1325 __ subl(ESP, Immediate(xmm_regs_count * kDoubleSize)); |
| 1345 // Store XMM registers with the lowest register number at the lowest | 1326 // Store XMM registers with the lowest register number at the lowest |
| 1346 // address. | 1327 // address. |
| 1347 intptr_t offset = 0; | 1328 intptr_t offset = 0; |
| 1348 for (intptr_t reg_idx = 0; reg_idx < kNumberOfXmmRegisters; ++reg_idx) { | 1329 for (intptr_t reg_idx = 0; reg_idx < kNumberOfXmmRegisters; ++reg_idx) { |
| 1349 XmmRegister xmm_reg = static_cast<XmmRegister>(reg_idx); | 1330 XmmRegister xmm_reg = static_cast<XmmRegister>(reg_idx); |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1722 __ popl(ECX); | 1703 __ popl(ECX); |
| 1723 __ popl(EAX); | 1704 __ popl(EAX); |
| 1724 } | 1705 } |
| 1725 | 1706 |
| 1726 | 1707 |
| 1727 #undef __ | 1708 #undef __ |
| 1728 | 1709 |
| 1729 } // namespace dart | 1710 } // namespace dart |
| 1730 | 1711 |
| 1731 #endif // defined TARGET_ARCH_IA32 | 1712 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |