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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
6 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 2263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2274 | 2274 |
2275 void MaterializeObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2275 void MaterializeObjectInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2276 UNREACHABLE(); | 2276 UNREACHABLE(); |
2277 } | 2277 } |
2278 | 2278 |
2279 | 2279 |
2280 // This function should be kept in sync with | 2280 // This function should be kept in sync with |
2281 // FlowGraphCompiler::SlowPathEnvironmentFor(). | 2281 // FlowGraphCompiler::SlowPathEnvironmentFor(). |
2282 void MaterializeObjectInstr::RemapRegisters(intptr_t* fpu_reg_slots, | 2282 void MaterializeObjectInstr::RemapRegisters(intptr_t* fpu_reg_slots, |
2283 intptr_t* cpu_reg_slots) { | 2283 intptr_t* cpu_reg_slots) { |
| 2284 if (registers_remapped_) { |
| 2285 return; |
| 2286 } |
| 2287 registers_remapped_ = true; |
| 2288 |
2284 for (intptr_t i = 0; i < InputCount(); i++) { | 2289 for (intptr_t i = 0; i < InputCount(); i++) { |
2285 Location loc = LocationAt(i); | 2290 Location loc = LocationAt(i); |
2286 if (loc.IsRegister()) { | 2291 if (loc.IsRegister()) { |
2287 intptr_t index = cpu_reg_slots[loc.reg()]; | 2292 intptr_t index = cpu_reg_slots[loc.reg()]; |
2288 ASSERT(index >= 0); | 2293 ASSERT(index >= 0); |
2289 locations_[i] = Location::StackSlot(index); | 2294 locations_[i] = Location::StackSlot(index); |
2290 } else if (loc.IsFpuRegister()) { | 2295 } else if (loc.IsFpuRegister()) { |
2291 intptr_t index = fpu_reg_slots[loc.fpu_reg()]; | 2296 intptr_t index = fpu_reg_slots[loc.fpu_reg()]; |
2292 ASSERT(index >= 0); | 2297 ASSERT(index >= 0); |
2293 Value* value = InputAt(i); | 2298 Value* value = InputAt(i); |
2294 switch (value->definition()->representation()) { | 2299 switch (value->definition()->representation()) { |
2295 case kUnboxedDouble: | 2300 case kUnboxedDouble: |
2296 locations_[i] = Location::DoubleStackSlot(index); | 2301 locations_[i] = Location::DoubleStackSlot(index); |
2297 break; | 2302 break; |
2298 case kUnboxedFloat32x4: | 2303 case kUnboxedFloat32x4: |
2299 case kUnboxedInt32x4: | 2304 case kUnboxedInt32x4: |
2300 case kUnboxedFloat64x2: | 2305 case kUnboxedFloat64x2: |
2301 locations_[i] = Location::QuadStackSlot(index); | 2306 locations_[i] = Location::QuadStackSlot(index); |
2302 break; | 2307 break; |
2303 default: | 2308 default: |
2304 UNREACHABLE(); | 2309 UNREACHABLE(); |
2305 } | 2310 } |
2306 } else if (loc.IsPairLocation()) { | 2311 } else if (loc.IsPairLocation()) { |
2307 UNREACHABLE(); | 2312 UNREACHABLE(); |
2308 } else if (loc.IsInvalid()) { | 2313 } else if (loc.IsInvalid() && |
2309 // We currently only perform one iteration of allocation | 2314 InputAt(i)->definition()->IsMaterializeObject()) { |
2310 // sinking, so we do not expect to find materialized objects | 2315 InputAt(i)->definition()->AsMaterializeObject()->RemapRegisters( |
2311 // here. | 2316 fpu_reg_slots, cpu_reg_slots); |
2312 ASSERT(!InputAt(i)->definition()->IsMaterializeObject()); | |
2313 } | 2317 } |
2314 } | 2318 } |
2315 } | 2319 } |
2316 | 2320 |
2317 | 2321 |
2318 LocationSummary* StoreContextInstr::MakeLocationSummary(Isolate* isolate, | 2322 LocationSummary* StoreContextInstr::MakeLocationSummary(Isolate* isolate, |
2319 bool optimizing) const { | 2323 bool optimizing) const { |
2320 const intptr_t kNumInputs = 1; | 2324 const intptr_t kNumInputs = 1; |
2321 const intptr_t kNumTemps = 0; | 2325 const intptr_t kNumTemps = 0; |
2322 LocationSummary* summary = new(isolate) LocationSummary( | 2326 LocationSummary* summary = new(isolate) LocationSummary( |
(...skipping 1782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4105 case Token::kTRUNCDIV: return 0; | 4109 case Token::kTRUNCDIV: return 0; |
4106 case Token::kMOD: return 1; | 4110 case Token::kMOD: return 1; |
4107 default: UNIMPLEMENTED(); return -1; | 4111 default: UNIMPLEMENTED(); return -1; |
4108 } | 4112 } |
4109 } | 4113 } |
4110 | 4114 |
4111 | 4115 |
4112 #undef __ | 4116 #undef __ |
4113 | 4117 |
4114 } // namespace dart | 4118 } // namespace dart |
OLD | NEW |