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 6641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6652 | 6652 |
6653 | 6653 |
6654 class UserTag : public Instance { | 6654 class UserTag : public Instance { |
6655 public: | 6655 public: |
6656 uword tag() const { return raw_ptr()->tag(); } | 6656 uword tag() const { return raw_ptr()->tag(); } |
6657 void set_tag(uword t) const { | 6657 void set_tag(uword t) const { |
6658 ASSERT(t >= UserTags::kUserTagIdOffset); | 6658 ASSERT(t >= UserTags::kUserTagIdOffset); |
6659 ASSERT(t < UserTags::kUserTagIdOffset + UserTags::kMaxUserTags); | 6659 ASSERT(t < UserTags::kUserTagIdOffset + UserTags::kMaxUserTags); |
6660 raw_ptr()->tag_ = t; | 6660 raw_ptr()->tag_ = t; |
6661 }; | 6661 }; |
| 6662 static intptr_t tag_offset() { return OFFSET_OF(RawUserTag, tag_); } |
6662 | 6663 |
6663 RawString* label() const { | 6664 RawString* label() const { |
6664 return raw_ptr()->label_; | 6665 return raw_ptr()->label_; |
6665 } | 6666 } |
6666 | 6667 |
6667 void MakeActive() const; | 6668 void MakeActive() const; |
6668 static void ClearActive(); | 6669 static void ClearActive(); |
6669 | 6670 |
6670 static intptr_t InstanceSize() { | 6671 static intptr_t InstanceSize() { |
6671 return RoundedAllocationSize(sizeof(RawUserTag)); | 6672 return RoundedAllocationSize(sizeof(RawUserTag)); |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6823 | 6824 |
6824 | 6825 |
6825 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6826 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
6826 intptr_t index) { | 6827 intptr_t index) { |
6827 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6828 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
6828 } | 6829 } |
6829 | 6830 |
6830 } // namespace dart | 6831 } // namespace dart |
6831 | 6832 |
6832 #endif // VM_OBJECT_H_ | 6833 #endif // VM_OBJECT_H_ |
OLD | NEW |