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 2731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2742 static const int kChunkSize = sizeof(Chunk); | 2742 static const int kChunkSize = sizeof(Chunk); |
2743 | 2743 |
2744 Chunk GetChunkAt(intptr_t i) const { | 2744 Chunk GetChunkAt(intptr_t i) const { |
2745 return *ChunkAddr(i); | 2745 return *ChunkAddr(i); |
2746 } | 2746 } |
2747 | 2747 |
2748 void SetChunkAt(intptr_t i, Chunk newValue) const { | 2748 void SetChunkAt(intptr_t i, Chunk newValue) const { |
2749 *ChunkAddr(i) = newValue; | 2749 *ChunkAddr(i) = newValue; |
2750 } | 2750 } |
2751 | 2751 |
| 2752 // Returns the number of chunks in use. |
2752 intptr_t Length() const { | 2753 intptr_t Length() const { |
2753 intptr_t signed_length = raw_ptr()->signed_length_; | 2754 intptr_t signed_length = raw_ptr()->signed_length_; |
2754 return Utils::Abs(signed_length); | 2755 return Utils::Abs(signed_length); |
2755 } | 2756 } |
2756 | 2757 |
2757 // SetLength does not change the sign. | 2758 // SetLength does not change the sign. |
2758 void SetLength(intptr_t length) const { | 2759 void SetLength(intptr_t length) const { |
2759 ASSERT(length >= 0); | 2760 ASSERT(length >= 0); |
2760 bool is_negative = IsNegative(); | 2761 bool is_negative = IsNegative(); |
2761 raw_ptr()->signed_length_ = length; | 2762 raw_ptr()->signed_length_ = length; |
(...skipping 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3895 } | 3896 } |
3896 | 3897 |
3897 | 3898 |
3898 intptr_t Stackmap::SizeInBits() const { | 3899 intptr_t Stackmap::SizeInBits() const { |
3899 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); | 3900 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); |
3900 } | 3901 } |
3901 | 3902 |
3902 } // namespace dart | 3903 } // namespace dart |
3903 | 3904 |
3904 #endif // VM_OBJECT_H_ | 3905 #endif // VM_OBJECT_H_ |
OLD | NEW |