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_RAW_OBJECT_H_ | 5 #ifndef VM_RAW_OBJECT_H_ |
6 #define VM_RAW_OBJECT_H_ | 6 #define VM_RAW_OBJECT_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
10 #include "vm/token.h" | 10 #include "vm/token.h" |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 RawLocalVarDescriptors* var_descriptors_; | 759 RawLocalVarDescriptors* var_descriptors_; |
760 RawArray* comments_; | 760 RawArray* comments_; |
761 RawObject** to() { | 761 RawObject** to() { |
762 return reinterpret_cast<RawObject**>(&ptr()->comments_); | 762 return reinterpret_cast<RawObject**>(&ptr()->comments_); |
763 } | 763 } |
764 | 764 |
765 intptr_t pointer_offsets_length_; | 765 intptr_t pointer_offsets_length_; |
766 // This cannot be boolean because of alignment issues on x64 architectures. | 766 // This cannot be boolean because of alignment issues on x64 architectures. |
767 intptr_t is_optimized_; | 767 intptr_t is_optimized_; |
768 | 768 |
769 // The number of spill slots used by an optimized code object. This is | |
770 // used as the length of each stackmap in the code. | |
771 intptr_t spill_slot_count_; | |
772 | |
773 // Variable length data follows here. | 769 // Variable length data follows here. |
774 int32_t data_[0]; | 770 int32_t data_[0]; |
775 | 771 |
776 friend class StackFrame; | 772 friend class StackFrame; |
777 }; | 773 }; |
778 | 774 |
779 | 775 |
780 class RawInstructions : public RawObject { | 776 class RawInstructions : public RawObject { |
781 RAW_HEAP_OBJECT_IMPLEMENTATION(Instructions); | 777 RAW_HEAP_OBJECT_IMPLEMENTATION(Instructions); |
782 | 778 |
(...skipping 17 matching lines...) Expand all Loading... |
800 class RawPcDescriptors : public RawObject { | 796 class RawPcDescriptors : public RawObject { |
801 RAW_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors); | 797 RAW_HEAP_OBJECT_IMPLEMENTATION(PcDescriptors); |
802 | 798 |
803 RawSmi* length_; // Number of descriptors. | 799 RawSmi* length_; // Number of descriptors. |
804 | 800 |
805 // Variable length data follows here. | 801 // Variable length data follows here. |
806 intptr_t data_[0]; | 802 intptr_t data_[0]; |
807 }; | 803 }; |
808 | 804 |
809 | 805 |
810 // Stackmap is an immutable representation of the layout of the stack at | 806 // Stackmap is an immutable representation of the layout of the stack at a |
811 // a PC. The stack map representation consists of a bit map which marks | 807 // PC. The stack map representation consists of a bit map which marks each |
812 // each stack slot index starting from the FP (frame pointer) as an object | 808 // live object index starting from the base of the frame. |
813 // or regular untagged value. | 809 // |
814 // The Stackmap also consists of a link to code object corresponding to | 810 // The Stackmap also consists of a link to the code object corresponding to |
815 // the frame which the stack map is describing. | 811 // the frame which the stack map is describing. The bit map representation |
816 // The bit map representation is optimized for dense and small bit maps, | 812 // is optimized for dense and small bit maps, without any upper bound. |
817 // without any upper bound. | |
818 class RawStackmap : public RawObject { | 813 class RawStackmap : public RawObject { |
819 RAW_HEAP_OBJECT_IMPLEMENTATION(Stackmap); | 814 RAW_HEAP_OBJECT_IMPLEMENTATION(Stackmap); |
820 | 815 |
821 RawObject** from() { | |
822 return reinterpret_cast<RawObject**>(&ptr()->code_); | |
823 } | |
824 RawCode* code_; // Code object corresponding to the frame described. | 816 RawCode* code_; // Code object corresponding to the frame described. |
825 RawSmi* bitmap_size_in_bytes_; // Size of the bit map in bytes. | 817 |
826 RawObject** to() { | 818 intptr_t length_; // Length of payload, in bits. |
827 return reinterpret_cast<RawObject**>(&ptr()->bitmap_size_in_bytes_); | |
828 } | |
829 uword pc_; // PC corresponding to this stack map representation. | 819 uword pc_; // PC corresponding to this stack map representation. |
830 intptr_t min_set_bit_index_; // Minimum bit offset which is set. | |
831 intptr_t max_set_bit_index_; // Maximum bit offset which is set. | |
832 | 820 |
833 // Variable length data follows here (bitmap of the stack layout). | 821 // Variable length data follows here (bitmap of the stack layout). |
834 uint8_t data_[0]; | 822 uint8_t data_[0]; |
835 }; | 823 }; |
836 | 824 |
837 | 825 |
838 class RawLocalVarDescriptors : public RawObject { | 826 class RawLocalVarDescriptors : public RawObject { |
839 public: | 827 public: |
840 enum VarInfoKind { | 828 enum VarInfoKind { |
841 kStackVar = 1, | 829 kStackVar = 1, |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 kExternalUint64ArrayCid == kByteArrayCid + 18 && | 1575 kExternalUint64ArrayCid == kByteArrayCid + 18 && |
1588 kExternalFloat32ArrayCid == kByteArrayCid + 19 && | 1576 kExternalFloat32ArrayCid == kByteArrayCid + 19 && |
1589 kExternalFloat64ArrayCid == kByteArrayCid + 20 && | 1577 kExternalFloat64ArrayCid == kByteArrayCid + 20 && |
1590 kStacktraceCid == kByteArrayCid + 21); | 1578 kStacktraceCid == kByteArrayCid + 21); |
1591 return (index >= kByteArrayCid && index <= kExternalFloat64ArrayCid); | 1579 return (index >= kByteArrayCid && index <= kExternalFloat64ArrayCid); |
1592 } | 1580 } |
1593 | 1581 |
1594 } // namespace dart | 1582 } // namespace dart |
1595 | 1583 |
1596 #endif // VM_RAW_OBJECT_H_ | 1584 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |