| 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 #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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 intptr_t stack_index() const { | 334 intptr_t stack_index() const { |
| 335 ASSERT(HasStackIndex()); | 335 ASSERT(HasStackIndex()); |
| 336 // Decode stack index manually to preserve sign. | 336 // Decode stack index manually to preserve sign. |
| 337 return StackIndexField::decode(payload()) - kStackIndexBias; | 337 return StackIndexField::decode(payload()) - kStackIndexBias; |
| 338 } | 338 } |
| 339 | 339 |
| 340 bool HasStackIndex() const { | 340 bool HasStackIndex() const { |
| 341 return IsStackSlot() || IsDoubleStackSlot() || IsQuadStackSlot(); | 341 return IsStackSlot() || IsDoubleStackSlot() || IsQuadStackSlot(); |
| 342 } | 342 } |
| 343 | 343 |
| 344 #if !defined(TARGET_ARCH_DBC) |
| 344 // Return a memory operand for stack slot locations. | 345 // Return a memory operand for stack slot locations. |
| 345 Address ToStackSlotAddress() const; | 346 Address ToStackSlotAddress() const; |
| 347 #endif |
| 346 | 348 |
| 347 // Returns the offset from the frame pointer for stack slot locations. | 349 // Returns the offset from the frame pointer for stack slot locations. |
| 348 intptr_t ToStackSlotOffset() const; | 350 intptr_t ToStackSlotOffset() const; |
| 349 | 351 |
| 350 // Constants. | 352 // Constants. |
| 351 static Location RegisterOrConstant(Value* value); | 353 static Location RegisterOrConstant(Value* value); |
| 352 static Location RegisterOrSmiConstant(Value* value); | 354 static Location RegisterOrSmiConstant(Value* value); |
| 353 static Location WritableRegisterOrSmiConstant(Value* value); | 355 static Location WritableRegisterOrSmiConstant(Value* value); |
| 354 static Location FixedRegisterOrConstant(Value* value, Register reg); | 356 static Location FixedRegisterOrConstant(Value* value, Register reg); |
| 355 static Location FixedRegisterOrSmiConstant(Value* value, Register reg); | 357 static Location FixedRegisterOrSmiConstant(Value* value, Register reg); |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 return output_location_; | 645 return output_location_; |
| 644 } | 646 } |
| 645 | 647 |
| 646 Location* out_slot(intptr_t index) { | 648 Location* out_slot(intptr_t index) { |
| 647 ASSERT(index == 0); | 649 ASSERT(index == 0); |
| 648 return &output_location_; | 650 return &output_location_; |
| 649 } | 651 } |
| 650 | 652 |
| 651 void set_out(intptr_t index, Location loc) { | 653 void set_out(intptr_t index, Location loc) { |
| 652 ASSERT(index == 0); | 654 ASSERT(index == 0); |
| 655 #if !defined(TARGET_ARCH_DBC) |
| 653 ASSERT(!always_calls() || | 656 ASSERT(!always_calls() || |
| 654 (loc.IsMachineRegister() || loc.IsInvalid() || | 657 (loc.IsMachineRegister() || loc.IsInvalid() || |
| 655 loc.IsPairLocation())); | 658 loc.IsPairLocation())); |
| 659 #endif |
| 656 output_location_ = loc; | 660 output_location_ = loc; |
| 657 } | 661 } |
| 658 | 662 |
| 659 BitmapBuilder* stack_bitmap() { | 663 BitmapBuilder* stack_bitmap() { |
| 660 if (stack_bitmap_ == NULL) { | 664 if (stack_bitmap_ == NULL) { |
| 661 stack_bitmap_ = new BitmapBuilder(); | 665 stack_bitmap_ = new BitmapBuilder(); |
| 662 } | 666 } |
| 663 return stack_bitmap_; | 667 return stack_bitmap_; |
| 664 } | 668 } |
| 665 void SetStackBit(intptr_t index) { | 669 void SetStackBit(intptr_t index) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 710 | 714 |
| 711 #if defined(DEBUG) | 715 #if defined(DEBUG) |
| 712 intptr_t writable_inputs_; | 716 intptr_t writable_inputs_; |
| 713 #endif | 717 #endif |
| 714 }; | 718 }; |
| 715 | 719 |
| 716 | 720 |
| 717 } // namespace dart | 721 } // namespace dart |
| 718 | 722 |
| 719 #endif // VM_LOCATIONS_H_ | 723 #endif // VM_LOCATIONS_H_ |
| OLD | NEW |