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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | 235 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); |
236 locs->set_out(0, Location::RequiresFpuRegister()); | 236 locs->set_out(0, Location::RequiresFpuRegister()); |
237 return locs; | 237 return locs; |
238 } | 238 } |
239 | 239 |
240 | 240 |
241 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 241 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
242 // The register allocator drops constant definitions that have no uses. | 242 // The register allocator drops constant definitions that have no uses. |
243 if (!locs()->out(0).IsInvalid()) { | 243 if (!locs()->out(0).IsInvalid()) { |
244 XmmRegister result = locs()->out(0).fpu_reg(); | 244 XmmRegister result = locs()->out(0).fpu_reg(); |
245 __ LoadObject(TMP, value(), PP); | 245 if (Utils::DoublesBitEqual(Double::Cast(value()).value(), 0.0)) { |
246 __ movsd(result, FieldAddress(TMP, Double::value_offset())); | 246 __ xorps(result, result); |
| 247 } else { |
| 248 __ LoadObject(TMP, value(), PP); |
| 249 __ movsd(result, FieldAddress(TMP, Double::value_offset())); |
| 250 } |
247 } | 251 } |
248 } | 252 } |
249 | 253 |
250 | 254 |
251 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { | 255 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { |
252 const intptr_t kNumInputs = 3; | 256 const intptr_t kNumInputs = 3; |
253 const intptr_t kNumTemps = 0; | 257 const intptr_t kNumTemps = 0; |
254 LocationSummary* summary = | 258 LocationSummary* summary = |
255 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 259 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
256 summary->set_in(0, Location::RegisterLocation(RAX)); // Value. | 260 summary->set_in(0, Location::RegisterLocation(RAX)); // Value. |
(...skipping 5351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5608 PcDescriptors::kOther, | 5612 PcDescriptors::kOther, |
5609 locs()); | 5613 locs()); |
5610 __ Drop(ArgumentCount()); // Discard arguments. | 5614 __ Drop(ArgumentCount()); // Discard arguments. |
5611 } | 5615 } |
5612 | 5616 |
5613 } // namespace dart | 5617 } // namespace dart |
5614 | 5618 |
5615 #undef __ | 5619 #undef __ |
5616 | 5620 |
5617 #endif // defined TARGET_ARCH_X64 | 5621 #endif // defined TARGET_ARCH_X64 |
OLD | NEW |