Chromium Code Reviews| 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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 979 static intptr_t InstanceSize(intptr_t len) { | 979 static intptr_t InstanceSize(intptr_t len) { |
| 980 // Ensure that the types_ is not adding to the object length. | 980 // Ensure that the types_ is not adding to the object length. |
| 981 ASSERT(sizeof(RawTypeArguments) == (sizeof(RawObject) + (1 * kWordSize))); | 981 ASSERT(sizeof(RawTypeArguments) == (sizeof(RawObject) + (1 * kWordSize))); |
| 982 ASSERT(0 <= len && len <= kMaxElements); | 982 ASSERT(0 <= len && len <= kMaxElements); |
| 983 return RoundedAllocationSize( | 983 return RoundedAllocationSize( |
| 984 sizeof(RawTypeArguments) + (len * kBytesPerElement)); | 984 sizeof(RawTypeArguments) + (len * kBytesPerElement)); |
| 985 } | 985 } |
| 986 | 986 |
| 987 static RawTypeArguments* New(intptr_t len, Heap::Space space = Heap::kOld); | 987 static RawTypeArguments* New(intptr_t len, Heap::Space space = Heap::kOld); |
| 988 | 988 |
| 989 intptr_t Hash() const; | |
|
regis
2012/12/11 01:37:15
You should add a Hash() to AbstractType as well (a
Florian Schneider
2012/12/11 12:23:04
Done.
| |
| 990 | |
| 989 private: | 991 private: |
| 990 RawAbstractType** TypeAddr(intptr_t index) const; | 992 RawAbstractType** TypeAddr(intptr_t index) const; |
| 991 void SetLength(intptr_t value) const; | 993 void SetLength(intptr_t value) const; |
| 992 | 994 |
| 993 HEAP_OBJECT_IMPLEMENTATION(TypeArguments, AbstractTypeArguments); | 995 HEAP_OBJECT_IMPLEMENTATION(TypeArguments, AbstractTypeArguments); |
| 994 friend class Class; | 996 friend class Class; |
| 995 }; | 997 }; |
| 996 | 998 |
| 997 | 999 |
| 998 // An instance of InstantiatedTypeArguments is never encountered at compile | 1000 // An instance of InstantiatedTypeArguments is never encountered at compile |
| (...skipping 5142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6141 | 6143 |
| 6142 | 6144 |
| 6143 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6145 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6144 intptr_t index) { | 6146 intptr_t index) { |
| 6145 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6147 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6146 } | 6148 } |
| 6147 | 6149 |
| 6148 } // namespace dart | 6150 } // namespace dart |
| 6149 | 6151 |
| 6150 #endif // VM_OBJECT_H_ | 6152 #endif // VM_OBJECT_H_ |
| OLD | NEW |