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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 248 |
249 Location in(intptr_t index) const { | 249 Location in(intptr_t index) const { |
250 return input_locations_[index]; | 250 return input_locations_[index]; |
251 } | 251 } |
252 | 252 |
253 Location* in_slot(intptr_t index) { | 253 Location* in_slot(intptr_t index) { |
254 return &input_locations_[index]; | 254 return &input_locations_[index]; |
255 } | 255 } |
256 | 256 |
257 void set_in(intptr_t index, Location loc) { | 257 void set_in(intptr_t index, Location loc) { |
258 ASSERT(!is_call() || loc.IsRegister()); | 258 ASSERT(!always_calls() || loc.IsRegister()); |
259 input_locations_[index] = loc; | 259 input_locations_[index] = loc; |
260 } | 260 } |
261 | 261 |
262 intptr_t temp_count() const { | 262 intptr_t temp_count() const { |
263 return temp_locations_.length(); | 263 return temp_locations_.length(); |
264 } | 264 } |
265 | 265 |
266 Location temp(intptr_t index) const { | 266 Location temp(intptr_t index) const { |
267 return temp_locations_[index]; | 267 return temp_locations_[index]; |
268 } | 268 } |
269 | 269 |
270 Location* temp_slot(intptr_t index) { | 270 Location* temp_slot(intptr_t index) { |
271 return &temp_locations_[index]; | 271 return &temp_locations_[index]; |
272 } | 272 } |
273 | 273 |
274 void set_temp(intptr_t index, Location loc) { | 274 void set_temp(intptr_t index, Location loc) { |
275 ASSERT(!is_call() || loc.IsRegister()); | 275 ASSERT(!always_calls() || loc.IsRegister()); |
276 temp_locations_[index] = loc; | 276 temp_locations_[index] = loc; |
277 } | 277 } |
278 | 278 |
279 Location out() const { | 279 Location out() const { |
280 return output_location_; | 280 return output_location_; |
281 } | 281 } |
282 | 282 |
283 Location* out_slot() { | 283 Location* out_slot() { |
284 return &output_location_; | 284 return &output_location_; |
285 } | 285 } |
286 | 286 |
287 void set_out(Location loc) { | 287 void set_out(Location loc) { |
288 ASSERT(!is_call() || loc.IsRegister()); | 288 ASSERT(!always_calls() || loc.IsRegister()); |
289 output_location_ = loc; | 289 output_location_ = loc; |
290 } | 290 } |
291 | 291 |
292 BitmapBuilder* stack_bitmap() const { return stack_bitmap_; } | 292 BitmapBuilder* stack_bitmap() const { return stack_bitmap_; } |
293 | 293 |
294 bool is_call() const { | 294 bool always_calls() const { |
295 return contains_call_ == kCall; | 295 return contains_call_ == kCall; |
296 } | 296 } |
297 | 297 |
298 bool contains_call() const { | 298 bool can_call() { |
299 return contains_call_ != kNoCall; | 299 return contains_call_ != kNoCall; |
300 } | 300 } |
301 | 301 |
302 void PrintTo(BufferFormatter* f) const; | 302 void PrintTo(BufferFormatter* f) const; |
303 | 303 |
304 static LocationSummary* Make(intptr_t input_count, | 304 static LocationSummary* Make(intptr_t input_count, |
305 Location out, | 305 Location out, |
306 ContainsCall contains_call); | 306 ContainsCall contains_call); |
307 | 307 |
308 RegisterSet* live_registers() { | 308 RegisterSet* live_registers() { |
309 return &live_registers_; | 309 return &live_registers_; |
310 } | 310 } |
311 | 311 |
312 private: | 312 private: |
313 // TODO(vegorov): replace with ZoneArray. | 313 // TODO(vegorov): replace with ZoneArray. |
314 GrowableArray<Location> input_locations_; | 314 GrowableArray<Location> input_locations_; |
315 GrowableArray<Location> temp_locations_; | 315 GrowableArray<Location> temp_locations_; |
316 Location output_location_; | 316 Location output_location_; |
317 BitmapBuilder* stack_bitmap_; | 317 BitmapBuilder* stack_bitmap_; |
318 | 318 |
319 const ContainsCall contains_call_; | 319 const ContainsCall contains_call_; |
320 RegisterSet live_registers_; | 320 RegisterSet live_registers_; |
321 }; | 321 }; |
322 | 322 |
323 | 323 |
324 } // namespace dart | 324 } // namespace dart |
325 | 325 |
326 #endif // VM_LOCATIONS_H_ | 326 #endif // VM_LOCATIONS_H_ |
OLD | NEW |