Chromium Code Reviews| 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/intermediate_language.h" | 8 #include "vm/intermediate_language.h" |
| 9 | 9 |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 3665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3676 } | 3676 } |
| 3677 case Token::kBIT_XOR: { | 3677 case Token::kBIT_XOR: { |
| 3678 __ xorps(left, right); | 3678 __ xorps(left, right); |
| 3679 break; | 3679 break; |
| 3680 } | 3680 } |
| 3681 default: UNREACHABLE(); | 3681 default: UNREACHABLE(); |
| 3682 } | 3682 } |
| 3683 } | 3683 } |
| 3684 | 3684 |
| 3685 | 3685 |
| 3686 LocationSummary* MathSqrtInstr::MakeLocationSummary() const { | 3686 LocationSummary* MathUnaryInstr::MakeLocationSummary() const { |
| 3687 const intptr_t kNumInputs = 1; | 3687 const intptr_t kNumInputs = 1; |
| 3688 const intptr_t kNumTemps = 0; | 3688 const intptr_t kNumTemps = 0; |
| 3689 LocationSummary* summary = | 3689 LocationSummary* summary = |
| 3690 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3690 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3691 summary->set_in(0, Location::RequiresFpuRegister()); | 3691 summary->set_in(0, Location::RequiresFpuRegister()); |
| 3692 summary->set_out(Location::RequiresFpuRegister()); | 3692 summary->set_out(Location::RequiresFpuRegister()); |
| 3693 return summary; | 3693 return summary; |
| 3694 } | 3694 } |
| 3695 | 3695 |
| 3696 | 3696 |
| 3697 void MathSqrtInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3697 void MathUnaryInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3698 __ sqrtsd(locs()->out().fpu_reg(), locs()->in(0).fpu_reg()); | 3698 if (kind() == MethodRecognizer::kMathSqrt) { |
| 3699 __ sqrtsd(locs()->out().fpu_reg(), locs()->in(0).fpu_reg()); | |
| 3700 return; | |
| 3701 } | |
|
Ivan Posva
2013/08/05 23:32:16
How about
if (kind() == MethodRecognizer::kMathSq
srdjan
2013/08/06 15:43:05
Done.
(In many cases I prefer return from the mid
| |
| 3702 | |
| 3703 if ((kind() == MethodRecognizer::kMathCos) || | |
| 3704 (kind() == MethodRecognizer::kMathSin)) { | |
| 3705 __ pushl(EAX); | |
| 3706 __ pushl(EAX); | |
| 3707 __ movsd(Address(ESP, 0), locs()->in(0).fpu_reg()); | |
| 3708 __ fldl(Address(ESP, 0)); | |
| 3709 if (kind() == MethodRecognizer::kMathSin) { | |
| 3710 __ fsin(); | |
| 3711 } else { | |
| 3712 ASSERT(kind() == MethodRecognizer::kMathCos); | |
| 3713 __ fcos(); | |
| 3714 } | |
| 3715 __ fstpl(Address(ESP, 0)); | |
| 3716 __ movsd(locs()->out().fpu_reg(), Address(ESP, 0)); | |
| 3717 __ addl(ESP, Immediate(2 * kWordSize)); | |
| 3718 return; | |
| 3719 } | |
| 3720 UNREACHABLE(); | |
| 3699 } | 3721 } |
| 3700 | 3722 |
| 3701 | 3723 |
| 3702 LocationSummary* MathMinMaxInstr::MakeLocationSummary() const { | 3724 LocationSummary* MathMinMaxInstr::MakeLocationSummary() const { |
| 3703 if (result_cid() == kDoubleCid) { | 3725 if (result_cid() == kDoubleCid) { |
| 3704 const intptr_t kNumInputs = 2; | 3726 const intptr_t kNumInputs = 2; |
| 3705 const intptr_t kNumTemps = 1; | 3727 const intptr_t kNumTemps = 1; |
| 3706 LocationSummary* summary = | 3728 LocationSummary* summary = |
| 3707 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 3729 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| 3708 summary->set_in(0, Location::RequiresFpuRegister()); | 3730 summary->set_in(0, Location::RequiresFpuRegister()); |
| (...skipping 1220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4929 PcDescriptors::kOther, | 4951 PcDescriptors::kOther, |
| 4930 locs()); | 4952 locs()); |
| 4931 __ Drop(2); // Discard type arguments and receiver. | 4953 __ Drop(2); // Discard type arguments and receiver. |
| 4932 } | 4954 } |
| 4933 | 4955 |
| 4934 } // namespace dart | 4956 } // namespace dart |
| 4935 | 4957 |
| 4936 #undef __ | 4958 #undef __ |
| 4937 | 4959 |
| 4938 #endif // defined TARGET_ARCH_IA32 | 4960 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |