| 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 ASSERT(result == value); // Assert that register assignment is correct. | 231 ASSERT(result == value); // Assert that register assignment is correct. |
| 232 __ movq(Address(RBP, local().index() * kWordSize), value); | 232 __ movq(Address(RBP, local().index() * kWordSize), value); |
| 233 } | 233 } |
| 234 | 234 |
| 235 | 235 |
| 236 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone, | 236 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone, |
| 237 bool opt) const { | 237 bool opt) const { |
| 238 const intptr_t kNumInputs = 0; | 238 const intptr_t kNumInputs = 0; |
| 239 return LocationSummary::Make(zone, | 239 return LocationSummary::Make(zone, |
| 240 kNumInputs, | 240 kNumInputs, |
| 241 Location::RequiresRegister(), | 241 Assembler::IsSafe(value()) |
| 242 ? Location::Constant(this) |
| 243 : Location::RequiresRegister(), |
| 242 LocationSummary::kNoCall); | 244 LocationSummary::kNoCall); |
| 243 } | 245 } |
| 244 | 246 |
| 245 | 247 |
| 246 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 248 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 247 // The register allocator drops constant definitions that have no uses. | 249 // The register allocator drops constant definitions that have no uses. |
| 248 if (!locs()->out(0).IsInvalid()) { | 250 if (locs()->out(0).IsRegister()) { |
| 249 Register result = locs()->out(0).reg(); | 251 Register result = locs()->out(0).reg(); |
| 250 __ LoadObject(result, value()); | 252 __ LoadObject(result, value()); |
| 251 } | 253 } |
| 252 } | 254 } |
| 253 | 255 |
| 254 | 256 |
| 255 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone, | 257 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone, |
| 256 bool opt) const { | 258 bool opt) const { |
| 257 const intptr_t kNumInputs = 0; | 259 const intptr_t kNumInputs = 0; |
| 258 const intptr_t kNumTemps = 0; | 260 const intptr_t kNumTemps = 0; |
| (...skipping 6189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6448 __ Drop(1); | 6450 __ Drop(1); |
| 6449 __ popq(result); | 6451 __ popq(result); |
| 6450 } | 6452 } |
| 6451 | 6453 |
| 6452 | 6454 |
| 6453 } // namespace dart | 6455 } // namespace dart |
| 6454 | 6456 |
| 6455 #undef __ | 6457 #undef __ |
| 6456 | 6458 |
| 6457 #endif // defined TARGET_ARCH_X64 | 6459 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |