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_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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 | 221 |
| 222 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 222 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 223 // The register allocator drops constant definitions that have no uses. | 223 // The register allocator drops constant definitions that have no uses. |
| 224 if (!locs()->out(0).IsInvalid()) { | 224 if (!locs()->out(0).IsInvalid()) { |
| 225 Register result = locs()->out(0).reg(); | 225 Register result = locs()->out(0).reg(); |
| 226 __ LoadObject(result, value(), PP); | 226 __ LoadObject(result, value(), PP); |
| 227 } | 227 } |
| 228 } | 228 } |
| 229 | 229 |
| 230 | 230 |
| 231 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(bool opt) const { | |
| 232 const intptr_t kNumInputs = 0; | |
| 233 const intptr_t kNumTemps = 1; | |
| 234 LocationSummary* locs = | |
| 235 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kNoCall); | |
| 236 locs->set_out(0, Location::RequiresFpuRegister()); | |
| 237 locs->set_temp(0, Location::RequiresRegister()); | |
| 238 return locs; | |
| 239 } | |
| 240 | |
| 241 | |
| 242 void UnboxedConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | |
| 243 // The register allocator drops constant definitions that have no uses. | |
| 244 if (!locs()->out(0).IsInvalid()) { | |
| 245 Register boxed = locs()->temp(0).reg(); | |
| 246 XmmRegister result = locs()->out(0).fpu_reg(); | |
| 247 __ LoadObject(boxed, value(), PP); | |
| 248 __ movsd(result, FieldAddress(boxed, Double::value_offset())); | |
|
Florian Schneider
2014/05/01 18:36:23
Do the same as on ia32 here?
srdjan
2014/05/01 20:33:04
Implemented LoadDoubleConstant, using it here.
| |
| 249 } | |
| 250 } | |
| 251 | |
| 252 | |
| 231 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { | 253 LocationSummary* AssertAssignableInstr::MakeLocationSummary(bool opt) const { |
| 232 const intptr_t kNumInputs = 3; | 254 const intptr_t kNumInputs = 3; |
| 233 const intptr_t kNumTemps = 0; | 255 const intptr_t kNumTemps = 0; |
| 234 LocationSummary* summary = | 256 LocationSummary* summary = |
| 235 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); | 257 new LocationSummary(kNumInputs, kNumTemps, LocationSummary::kCall); |
| 236 summary->set_in(0, Location::RegisterLocation(RAX)); // Value. | 258 summary->set_in(0, Location::RegisterLocation(RAX)); // Value. |
| 237 summary->set_in(1, Location::RegisterLocation(RCX)); // Instantiator. | 259 summary->set_in(1, Location::RegisterLocation(RCX)); // Instantiator. |
| 238 summary->set_in(2, Location::RegisterLocation(RDX)); // Type arguments. | 260 summary->set_in(2, Location::RegisterLocation(RDX)); // Type arguments. |
| 239 summary->set_out(0, Location::RegisterLocation(RAX)); | 261 summary->set_out(0, Location::RegisterLocation(RAX)); |
| 240 return summary; | 262 return summary; |
| (...skipping 5328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5569 PcDescriptors::kOther, | 5591 PcDescriptors::kOther, |
| 5570 locs()); | 5592 locs()); |
| 5571 __ Drop(ArgumentCount()); // Discard arguments. | 5593 __ Drop(ArgumentCount()); // Discard arguments. |
| 5572 } | 5594 } |
| 5573 | 5595 |
| 5574 } // namespace dart | 5596 } // namespace dart |
| 5575 | 5597 |
| 5576 #undef __ | 5598 #undef __ |
| 5577 | 5599 |
| 5578 #endif // defined TARGET_ARCH_X64 | 5600 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |