| 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 2113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2124 if (loc.IsRegister()) { | 2124 if (loc.IsRegister()) { |
| 2125 intptr_t index = cpu_reg_slots[loc.reg()]; | 2125 intptr_t index = cpu_reg_slots[loc.reg()]; |
| 2126 ASSERT(index >= 0); | 2126 ASSERT(index >= 0); |
| 2127 locations_[i] = Location::StackSlot(index); | 2127 locations_[i] = Location::StackSlot(index); |
| 2128 } else if (loc.IsFpuRegister()) { | 2128 } else if (loc.IsFpuRegister()) { |
| 2129 intptr_t index = fpu_reg_slots[loc.fpu_reg()]; | 2129 intptr_t index = fpu_reg_slots[loc.fpu_reg()]; |
| 2130 ASSERT(index >= 0); | 2130 ASSERT(index >= 0); |
| 2131 Value* value = InputAt(i); | 2131 Value* value = InputAt(i); |
| 2132 switch (value->definition()->representation()) { | 2132 switch (value->definition()->representation()) { |
| 2133 case kUnboxedDouble: | 2133 case kUnboxedDouble: |
| 2134 case kUnboxedMint: | |
| 2135 locations_[i] = Location::DoubleStackSlot(index); | 2134 locations_[i] = Location::DoubleStackSlot(index); |
| 2136 break; | 2135 break; |
| 2137 case kUnboxedFloat32x4: | 2136 case kUnboxedFloat32x4: |
| 2138 case kUnboxedInt32x4: | 2137 case kUnboxedInt32x4: |
| 2139 case kUnboxedFloat64x2: | 2138 case kUnboxedFloat64x2: |
| 2140 locations_[i] = Location::QuadStackSlot(index); | 2139 locations_[i] = Location::QuadStackSlot(index); |
| 2141 break; | 2140 break; |
| 2142 default: | 2141 default: |
| 2143 UNREACHABLE(); | 2142 UNREACHABLE(); |
| 2144 } | 2143 } |
| 2144 } else if (loc.IsPairLocation()) { |
| 2145 UNREACHABLE(); |
| 2145 } else if (loc.IsInvalid()) { | 2146 } else if (loc.IsInvalid()) { |
| 2146 // We currently only perform one iteration of allocation | 2147 // We currently only perform one iteration of allocation |
| 2147 // sinking, so we do not expect to find materialized objects | 2148 // sinking, so we do not expect to find materialized objects |
| 2148 // here. | 2149 // here. |
| 2149 ASSERT(!InputAt(i)->definition()->IsMaterializeObject()); | 2150 ASSERT(!InputAt(i)->definition()->IsMaterializeObject()); |
| 2150 } | 2151 } |
| 2151 } | 2152 } |
| 2152 } | 2153 } |
| 2153 | 2154 |
| 2154 | 2155 |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2341 code_, | 2342 code_, |
| 2342 (outer_ == NULL) ? NULL : outer_->DeepCopy()); | 2343 (outer_ == NULL) ? NULL : outer_->DeepCopy()); |
| 2343 if (locations_ != NULL) { | 2344 if (locations_ != NULL) { |
| 2344 Location* new_locations = | 2345 Location* new_locations = |
| 2345 Isolate::Current()->current_zone()->Alloc<Location>(length); | 2346 Isolate::Current()->current_zone()->Alloc<Location>(length); |
| 2346 copy->set_locations(new_locations); | 2347 copy->set_locations(new_locations); |
| 2347 } | 2348 } |
| 2348 for (intptr_t i = 0; i < length; ++i) { | 2349 for (intptr_t i = 0; i < length; ++i) { |
| 2349 copy->values_.Add(values_[i]->Copy()); | 2350 copy->values_.Add(values_[i]->Copy()); |
| 2350 if (locations_ != NULL) { | 2351 if (locations_ != NULL) { |
| 2351 copy->locations_[i] = locations_[i]; | 2352 copy->locations_[i] = locations_[i].Copy(); |
| 2352 } | 2353 } |
| 2353 } | 2354 } |
| 2354 return copy; | 2355 return copy; |
| 2355 } | 2356 } |
| 2356 | 2357 |
| 2357 | 2358 |
| 2358 // Copies the environment and updates the environment use lists. | 2359 // Copies the environment and updates the environment use lists. |
| 2359 void Environment::DeepCopyTo(Instruction* instr) const { | 2360 void Environment::DeepCopyTo(Instruction* instr) const { |
| 2360 for (Environment::DeepIterator it(instr->env()); !it.Done(); it.Advance()) { | 2361 for (Environment::DeepIterator it(instr->env()); !it.Done(); it.Advance()) { |
| 2361 it.CurrentValue()->RemoveFromUseList(); | 2362 it.CurrentValue()->RemoveFromUseList(); |
| (...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3423 case Token::kTRUNCDIV: return 0; | 3424 case Token::kTRUNCDIV: return 0; |
| 3424 case Token::kMOD: return 1; | 3425 case Token::kMOD: return 1; |
| 3425 default: UNIMPLEMENTED(); return -1; | 3426 default: UNIMPLEMENTED(); return -1; |
| 3426 } | 3427 } |
| 3427 } | 3428 } |
| 3428 | 3429 |
| 3429 | 3430 |
| 3430 #undef __ | 3431 #undef __ |
| 3431 | 3432 |
| 3432 } // namespace dart | 3433 } // namespace dart |
| OLD | NEW |