| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 ASSERT(result == value); // Assert that register assignment is correct. | 144 ASSERT(result == value); // Assert that register assignment is correct. |
| 145 __ movl(Address(EBP, local().index() * kWordSize), value); | 145 __ movl(Address(EBP, local().index() * kWordSize), value); |
| 146 } | 146 } |
| 147 | 147 |
| 148 | 148 |
| 149 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone, | 149 LocationSummary* ConstantInstr::MakeLocationSummary(Zone* zone, |
| 150 bool opt) const { | 150 bool opt) const { |
| 151 const intptr_t kNumInputs = 0; | 151 const intptr_t kNumInputs = 0; |
| 152 return LocationSummary::Make(zone, | 152 return LocationSummary::Make(zone, |
| 153 kNumInputs, | 153 kNumInputs, |
| 154 Location::RequiresRegister(), | 154 Assembler::IsSafe(value()) |
| 155 ? Location::Constant(this) |
| 156 : Location::RequiresRegister(), |
| 155 LocationSummary::kNoCall); | 157 LocationSummary::kNoCall); |
| 156 } | 158 } |
| 157 | 159 |
| 158 | 160 |
| 159 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 161 void ConstantInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 160 // The register allocator drops constant definitions that have no uses. | 162 // The register allocator drops constant definitions that have no uses. |
| 161 if (!locs()->out(0).IsInvalid()) { | 163 Location out = locs()->out(0); |
| 162 Register result = locs()->out(0).reg(); | 164 ASSERT(out.IsRegister() || out.IsConstant() || out.IsInvalid()); |
| 165 if (out.IsRegister()) { |
| 166 Register result = out.reg(); |
| 163 __ LoadObjectSafely(result, value()); | 167 __ LoadObjectSafely(result, value()); |
| 164 } | 168 } |
| 165 } | 169 } |
| 166 | 170 |
| 167 | 171 |
| 168 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone, | 172 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone, |
| 169 bool opt) const { | 173 bool opt) const { |
| 170 const intptr_t kNumInputs = 0; | 174 const intptr_t kNumInputs = 0; |
| 171 const intptr_t kNumTemps = | 175 const intptr_t kNumTemps = |
| 172 (constant_address() == 0) && (representation() != kUnboxedInt32) ? 1 : 0; | 176 (constant_address() == 0) && (representation() != kUnboxedInt32) ? 1 : 0; |
| (...skipping 6694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6867 __ Drop(1); | 6871 __ Drop(1); |
| 6868 __ popl(result); | 6872 __ popl(result); |
| 6869 } | 6873 } |
| 6870 | 6874 |
| 6871 | 6875 |
| 6872 } // namespace dart | 6876 } // namespace dart |
| 6873 | 6877 |
| 6874 #undef __ | 6878 #undef __ |
| 6875 | 6879 |
| 6876 #endif // defined TARGET_ARCH_IA32 | 6880 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |