| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 #ifndef VM_LOCATIONS_H_ | 5 #ifndef VM_LOCATIONS_H_ |
| 6 #define VM_LOCATIONS_H_ | 6 #define VM_LOCATIONS_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/bitfield.h" | 10 #include "vm/bitfield.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 Location in(intptr_t index) const { | 212 Location in(intptr_t index) const { |
| 213 return input_locations_[index]; | 213 return input_locations_[index]; |
| 214 } | 214 } |
| 215 | 215 |
| 216 Location* in_slot(intptr_t index) { | 216 Location* in_slot(intptr_t index) { |
| 217 return &input_locations_[index]; | 217 return &input_locations_[index]; |
| 218 } | 218 } |
| 219 | 219 |
| 220 void set_in(intptr_t index, Location loc) { | 220 void set_in(intptr_t index, Location loc) { |
| 221 ASSERT(!is_call() || loc.IsRegister()); |
| 221 input_locations_[index] = loc; | 222 input_locations_[index] = loc; |
| 222 } | 223 } |
| 223 | 224 |
| 224 intptr_t temp_count() const { | 225 intptr_t temp_count() const { |
| 225 return temp_locations_.length(); | 226 return temp_locations_.length(); |
| 226 } | 227 } |
| 227 | 228 |
| 228 Location temp(intptr_t index) const { | 229 Location temp(intptr_t index) const { |
| 229 return temp_locations_[index]; | 230 return temp_locations_[index]; |
| 230 } | 231 } |
| 231 | 232 |
| 232 Location* temp_slot(intptr_t index) { | 233 Location* temp_slot(intptr_t index) { |
| 233 return &temp_locations_[index]; | 234 return &temp_locations_[index]; |
| 234 } | 235 } |
| 235 | 236 |
| 236 void set_temp(intptr_t index, Location loc) { | 237 void set_temp(intptr_t index, Location loc) { |
| 238 ASSERT(!is_call() || loc.IsRegister()); |
| 237 temp_locations_[index] = loc; | 239 temp_locations_[index] = loc; |
| 238 } | 240 } |
| 239 | 241 |
| 240 Location out() const { | 242 Location out() const { |
| 241 return output_location_; | 243 return output_location_; |
| 242 } | 244 } |
| 243 | 245 |
| 244 Location* out_slot() { | 246 Location* out_slot() { |
| 245 return &output_location_; | 247 return &output_location_; |
| 246 } | 248 } |
| 247 | 249 |
| 248 | 250 |
| 249 void set_out(Location loc) { | 251 void set_out(Location loc) { |
| 252 ASSERT(!is_call() || loc.IsRegister()); |
| 250 output_location_ = loc; | 253 output_location_ = loc; |
| 251 } | 254 } |
| 252 | 255 |
| 253 bool is_call() const { | 256 bool is_call() const { |
| 254 return is_call_; | 257 return is_call_; |
| 255 } | 258 } |
| 256 | 259 |
| 257 void PrintTo(BufferFormatter* f) const; | 260 void PrintTo(BufferFormatter* f) const; |
| 258 | 261 |
| 259 static LocationSummary* Make(intptr_t input_count, | 262 static LocationSummary* Make(intptr_t input_count, |
| 260 Location out, | 263 Location out, |
| 261 ContainsCall contains_call = kNoCall); | 264 ContainsCall contains_call = kNoCall); |
| 262 | 265 |
| 263 private: | 266 private: |
| 264 // TODO(vegorov): replace with ZoneArray. | 267 // TODO(vegorov): replace with ZoneArray. |
| 265 GrowableArray<Location> input_locations_; | 268 GrowableArray<Location> input_locations_; |
| 266 GrowableArray<Location> temp_locations_; | 269 GrowableArray<Location> temp_locations_; |
| 267 Location output_location_; | 270 Location output_location_; |
| 268 | 271 |
| 269 const bool is_call_; | 272 const bool is_call_; |
| 270 }; | 273 }; |
| 271 | 274 |
| 272 | 275 |
| 273 } // namespace dart | 276 } // namespace dart |
| 274 | 277 |
| 275 #endif // VM_LOCATIONS_H_ | 278 #endif // VM_LOCATIONS_H_ |
| OLD | NEW |