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_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
(...skipping 2001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2012 bool IsObject(intptr_t offset) const { | 2012 bool IsObject(intptr_t offset) const { |
2013 return InRange(offset) && GetBit(offset); | 2013 return InRange(offset) && GetBit(offset); |
2014 } | 2014 } |
2015 uword PC() const { return raw_ptr()->pc_; } | 2015 uword PC() const { return raw_ptr()->pc_; } |
2016 void SetPC(uword value) const { raw_ptr()->pc_ = value; } | 2016 void SetPC(uword value) const { raw_ptr()->pc_ = value; } |
2017 | 2017 |
2018 RawCode* GetCode() const { return raw_ptr()->code_; } | 2018 RawCode* GetCode() const { return raw_ptr()->code_; } |
2019 void SetCode(const Code& code) const; | 2019 void SetCode(const Code& code) const; |
2020 | 2020 |
2021 // Return the offset of the highest stack slot that has an object. | 2021 // Return the offset of the highest stack slot that has an object. |
2022 intptr_t Maximum() const; | 2022 intptr_t MaximumBitOffset() const { return raw_ptr()->max_set_bit_offset_; } |
2023 | 2023 |
2024 // Return the offset of the lowest stack slot that has an object. | 2024 // Return the offset of the lowest stack slot that has an object. |
2025 intptr_t Minimum() const; | 2025 intptr_t MinimumBitOffset() const { return raw_ptr()->min_set_bit_offset_; } |
2026 | 2026 |
2027 static intptr_t InstanceSize() { | 2027 static intptr_t InstanceSize() { |
2028 ASSERT(sizeof(RawStackmap) == OFFSET_OF(RawStackmap, data_)); | 2028 ASSERT(sizeof(RawStackmap) == OFFSET_OF(RawStackmap, data_)); |
2029 return 0; | 2029 return 0; |
2030 } | 2030 } |
2031 static intptr_t InstanceSize(intptr_t size) { | 2031 static intptr_t InstanceSize(intptr_t size) { |
2032 return RoundedAllocationSize(sizeof(RawStackmap) + (size * kWordSize)); | 2032 return RoundedAllocationSize(sizeof(RawStackmap) + (size * kWordSize)); |
2033 } | 2033 } |
2034 static RawStackmap* New(uword pc, const Code& code, BitmapBuilder* bmap); | 2034 static RawStackmap* New(uword pc, BitmapBuilder* bmap); |
2035 | 2035 |
2036 private: | 2036 private: |
2037 inline intptr_t SizeInBits() const; | 2037 inline intptr_t SizeInBits() const; |
2038 | 2038 |
| 2039 void SetMinBitOffset(intptr_t value) const { |
| 2040 raw_ptr()->min_set_bit_offset_ = value; |
| 2041 } |
| 2042 void SetMaxBitOffset(intptr_t value) const { |
| 2043 raw_ptr()->max_set_bit_offset_ = value; |
| 2044 } |
| 2045 |
2039 bool InRange(intptr_t offset) const { return offset < SizeInBits(); } | 2046 bool InRange(intptr_t offset) const { return offset < SizeInBits(); } |
2040 | 2047 |
2041 bool GetBit(intptr_t bit_offset) const; | 2048 bool GetBit(intptr_t bit_offset) const; |
2042 void SetBit(intptr_t bit_offset, bool value) const; | 2049 void SetBit(intptr_t bit_offset, bool value) const; |
2043 | 2050 |
2044 void set_bitmap_size_in_bytes(intptr_t value) const; | 2051 void set_bitmap_size_in_bytes(intptr_t value) const; |
2045 void set_pc(uword value) const; | |
2046 void set_code(const Code& code) const; | |
2047 | 2052 |
2048 HEAP_OBJECT_IMPLEMENTATION(Stackmap, Object); | 2053 HEAP_OBJECT_IMPLEMENTATION(Stackmap, Object); |
2049 friend class Class; | 2054 friend class Class; |
2050 friend class BitmapBuilder; | 2055 friend class BitmapBuilder; |
2051 }; | 2056 }; |
2052 | 2057 |
2053 | 2058 |
2054 class ExceptionHandlers : public Object { | 2059 class ExceptionHandlers : public Object { |
2055 public: | 2060 public: |
2056 intptr_t Length() const; | 2061 intptr_t Length() const; |
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3908 } | 3913 } |
3909 | 3914 |
3910 | 3915 |
3911 intptr_t Stackmap::SizeInBits() const { | 3916 intptr_t Stackmap::SizeInBits() const { |
3912 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); | 3917 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); |
3913 } | 3918 } |
3914 | 3919 |
3915 } // namespace dart | 3920 } // namespace dart |
3916 | 3921 |
3917 #endif // VM_OBJECT_H_ | 3922 #endif // VM_OBJECT_H_ |
OLD | NEW |