| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "lib/error.h" | 10 #include "lib/error.h" |
| (...skipping 1739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1750 __ popl(right); | 1750 __ popl(right); |
| 1751 __ popl(left); | 1751 __ popl(left); |
| 1752 | 1752 |
| 1753 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), | 1753 Label* deopt = compiler->AddDeoptStub(instance_call()->deopt_id(), |
| 1754 instance_call()->token_pos(), | 1754 instance_call()->token_pos(), |
| 1755 instance_call()->try_index(), | 1755 instance_call()->try_index(), |
| 1756 kDeoptDoubleBinaryOp, | 1756 kDeoptDoubleBinaryOp, |
| 1757 left, | 1757 left, |
| 1758 right); | 1758 right); |
| 1759 | 1759 |
| 1760 // Binary operation of two Smi's produces a Smi not a double. |
| 1761 __ movl(temp, left); |
| 1762 __ orl(temp, right); |
| 1763 __ testl(temp, Immediate(kSmiTagMask)); |
| 1764 __ j(ZERO, deopt); |
| 1765 |
| 1760 compiler->LoadDoubleOrSmiToXmm(XMM0, left, temp, deopt); | 1766 compiler->LoadDoubleOrSmiToXmm(XMM0, left, temp, deopt); |
| 1761 compiler->LoadDoubleOrSmiToXmm(XMM1, right, temp, deopt); | 1767 compiler->LoadDoubleOrSmiToXmm(XMM1, right, temp, deopt); |
| 1762 | 1768 |
| 1763 switch (op_kind()) { | 1769 switch (op_kind()) { |
| 1764 case Token::kADD: __ addsd(XMM0, XMM1); break; | 1770 case Token::kADD: __ addsd(XMM0, XMM1); break; |
| 1765 case Token::kSUB: __ subsd(XMM0, XMM1); break; | 1771 case Token::kSUB: __ subsd(XMM0, XMM1); break; |
| 1766 case Token::kMUL: __ mulsd(XMM0, XMM1); break; | 1772 case Token::kMUL: __ mulsd(XMM0, XMM1); break; |
| 1767 case Token::kDIV: __ divsd(XMM0, XMM1); break; | 1773 case Token::kDIV: __ divsd(XMM0, XMM1); break; |
| 1768 default: UNREACHABLE(); | 1774 default: UNREACHABLE(); |
| 1769 } | 1775 } |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2096 ASSERT(locs()->out().reg() == EAX); | 2102 ASSERT(locs()->out().reg() == EAX); |
| 2097 __ CompareObject(locs()->out().reg(), compiler->bool_true()); | 2103 __ CompareObject(locs()->out().reg(), compiler->bool_true()); |
| 2098 EmitBranchOnCondition(compiler, branch_condition); | 2104 EmitBranchOnCondition(compiler, branch_condition); |
| 2099 } | 2105 } |
| 2100 | 2106 |
| 2101 } // namespace dart | 2107 } // namespace dart |
| 2102 | 2108 |
| 2103 #undef __ | 2109 #undef __ |
| 2104 | 2110 |
| 2105 #endif // defined TARGET_ARCH_X64 | 2111 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |