| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 raw()->SetCreatedFromSnapshot(); | 209 raw()->SetCreatedFromSnapshot(); |
| 210 } | 210 } |
| 211 bool IsCanonical() const { | 211 bool IsCanonical() const { |
| 212 ASSERT(!IsNull()); | 212 ASSERT(!IsNull()); |
| 213 return raw()->IsCanonical(); | 213 return raw()->IsCanonical(); |
| 214 } | 214 } |
| 215 void SetCanonical() const { | 215 void SetCanonical() const { |
| 216 ASSERT(!IsNull()); | 216 ASSERT(!IsNull()); |
| 217 raw()->SetCanonical(); | 217 raw()->SetCanonical(); |
| 218 } | 218 } |
| 219 | 219 intptr_t GetClassId() const { |
| 220 return !raw()->IsHeapObject() ? |
| 221 static_cast<intptr_t>(kSmiCid) : raw()->GetClassId(); |
| 222 } |
| 220 inline RawClass* clazz() const; | 223 inline RawClass* clazz() const; |
| 221 static intptr_t tags_offset() { return OFFSET_OF(RawObject, tags_); } | 224 static intptr_t tags_offset() { return OFFSET_OF(RawObject, tags_); } |
| 222 | 225 |
| 223 // Class testers. | 226 // Class testers. |
| 224 #define DEFINE_CLASS_TESTER(clazz) \ | 227 #define DEFINE_CLASS_TESTER(clazz) \ |
| 225 virtual bool Is##clazz() const { return false; } | 228 virtual bool Is##clazz() const { return false; } |
| 226 CLASS_LIST_FOR_HANDLES(DEFINE_CLASS_TESTER); | 229 CLASS_LIST_FOR_HANDLES(DEFINE_CLASS_TESTER); |
| 227 #undef DEFINE_CLASS_TESTER | 230 #undef DEFINE_CLASS_TESTER |
| 228 | 231 |
| 229 bool IsNull() const { return raw_ == null_; } | 232 bool IsNull() const { return raw_ == null_; } |
| (...skipping 5535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5765 | 5768 |
| 5766 | 5769 |
| 5767 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5770 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 5768 intptr_t index) { | 5771 intptr_t index) { |
| 5769 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5772 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 5770 } | 5773 } |
| 5771 | 5774 |
| 5772 } // namespace dart | 5775 } // namespace dart |
| 5773 | 5776 |
| 5774 #endif // VM_OBJECT_H_ | 5777 #endif // VM_OBJECT_H_ |
| OLD | NEW |