| 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 "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
| (...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 token_pos); | 1467 token_pos); |
| 1468 // Stub returns result in flags (result of a cmpl, we need ZF computed). | 1468 // Stub returns result in flags (result of a cmpl, we need ZF computed). |
| 1469 __ popl(right); | 1469 __ popl(right); |
| 1470 __ popl(left); | 1470 __ popl(left); |
| 1471 } else { | 1471 } else { |
| 1472 __ cmpl(left, right); | 1472 __ cmpl(left, right); |
| 1473 } | 1473 } |
| 1474 } | 1474 } |
| 1475 | 1475 |
| 1476 | 1476 |
| 1477 // Implement equality spec: if any of the arguments is null do identity check. | |
| 1478 // Fallthrough calls super equality. | |
| 1479 void FlowGraphCompiler::EmitSuperEqualityCallPrologue(Register result, | |
| 1480 Label* skip_call) { | |
| 1481 const Immediate& raw_null = | |
| 1482 Immediate(reinterpret_cast<intptr_t>(Object::null())); | |
| 1483 Label check_identity, fall_through; | |
| 1484 __ cmpl(Address(ESP, 0 * kWordSize), raw_null); | |
| 1485 __ j(EQUAL, &check_identity, Assembler::kNearJump); | |
| 1486 __ cmpl(Address(ESP, 1 * kWordSize), raw_null); | |
| 1487 __ j(NOT_EQUAL, &fall_through, Assembler::kNearJump); | |
| 1488 | |
| 1489 __ Bind(&check_identity); | |
| 1490 __ popl(result); | |
| 1491 __ cmpl(result, Address(ESP, 0 * kWordSize)); | |
| 1492 Label is_false; | |
| 1493 __ j(NOT_EQUAL, &is_false, Assembler::kNearJump); | |
| 1494 __ LoadObject(result, Bool::True()); | |
| 1495 __ Drop(1); | |
| 1496 __ jmp(skip_call); | |
| 1497 __ Bind(&is_false); | |
| 1498 __ LoadObject(result, Bool::False()); | |
| 1499 __ Drop(1); | |
| 1500 __ jmp(skip_call); | |
| 1501 __ Bind(&fall_through); | |
| 1502 } | |
| 1503 | |
| 1504 | |
| 1505 // This function must be in sync with FlowGraphCompiler::RecordSafepoint. | 1477 // This function must be in sync with FlowGraphCompiler::RecordSafepoint. |
| 1506 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { | 1478 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { |
| 1507 // TODO(vegorov): consider saving only caller save (volatile) registers. | 1479 // TODO(vegorov): consider saving only caller save (volatile) registers. |
| 1508 const intptr_t xmm_regs_count = locs->live_registers()->fpu_regs_count(); | 1480 const intptr_t xmm_regs_count = locs->live_registers()->fpu_regs_count(); |
| 1509 if (xmm_regs_count > 0) { | 1481 if (xmm_regs_count > 0) { |
| 1510 __ subl(ESP, Immediate(xmm_regs_count * kFpuRegisterSize)); | 1482 __ subl(ESP, Immediate(xmm_regs_count * kFpuRegisterSize)); |
| 1511 // Store XMM registers with the lowest register number at the lowest | 1483 // Store XMM registers with the lowest register number at the lowest |
| 1512 // address. | 1484 // address. |
| 1513 intptr_t offset = 0; | 1485 intptr_t offset = 0; |
| 1514 for (intptr_t reg_idx = 0; reg_idx < kNumberOfXmmRegisters; ++reg_idx) { | 1486 for (intptr_t reg_idx = 0; reg_idx < kNumberOfXmmRegisters; ++reg_idx) { |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1912 __ movups(reg, Address(ESP, 0)); | 1884 __ movups(reg, Address(ESP, 0)); |
| 1913 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1885 __ addl(ESP, Immediate(kFpuRegisterSize)); |
| 1914 } | 1886 } |
| 1915 | 1887 |
| 1916 | 1888 |
| 1917 #undef __ | 1889 #undef __ |
| 1918 | 1890 |
| 1919 } // namespace dart | 1891 } // namespace dart |
| 1920 | 1892 |
| 1921 #endif // defined TARGET_ARCH_IA32 | 1893 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |