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 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 if (locs()->out(0).IsRegister()) { |
| 162 Register result = locs()->out(0).reg(); | 164 Register result = locs()->out(0).reg(); |
| 163 __ LoadObjectSafely(result, value()); | 165 __ LoadObjectSafely(result, value()); |
| 164 } | 166 } |
|
srdjan
2015/09/30 17:00:20
Maybe:
else {
ASSERT(locs()->out(0).IsInvalid()
Florian Schneider
2015/10/01 09:16:31
Done.
| |
| 165 } | 167 } |
| 166 | 168 |
| 167 | 169 |
| 168 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone, | 170 LocationSummary* UnboxedConstantInstr::MakeLocationSummary(Zone* zone, |
| 169 bool opt) const { | 171 bool opt) const { |
| 170 const intptr_t kNumInputs = 0; | 172 const intptr_t kNumInputs = 0; |
| 171 const intptr_t kNumTemps = | 173 const intptr_t kNumTemps = |
| 172 (constant_address() == 0) && (representation() != kUnboxedInt32) ? 1 : 0; | 174 (constant_address() == 0) && (representation() != kUnboxedInt32) ? 1 : 0; |
| 173 LocationSummary* locs = new(zone) LocationSummary( | 175 LocationSummary* locs = new(zone) LocationSummary( |
| 174 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); | 176 zone, kNumInputs, kNumTemps, LocationSummary::kNoCall); |
| (...skipping 6692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6867 __ Drop(1); | 6869 __ Drop(1); |
| 6868 __ popl(result); | 6870 __ popl(result); |
| 6869 } | 6871 } |
| 6870 | 6872 |
| 6871 | 6873 |
| 6872 } // namespace dart | 6874 } // namespace dart |
| 6873 | 6875 |
| 6874 #undef __ | 6876 #undef __ |
| 6875 | 6877 |
| 6876 #endif // defined TARGET_ARCH_IA32 | 6878 #endif // defined TARGET_ARCH_IA32 |
| OLD | NEW |