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 4649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4660 | 4660 |
| 4661 // TODO(iposva): Add storing NoGCScope. | 4661 // TODO(iposva): Add storing NoGCScope. |
| 4662 DataStorePointer(ObjectAddr(index), value.raw()); | 4662 DataStorePointer(ObjectAddr(index), value.raw()); |
| 4663 } | 4663 } |
| 4664 | 4664 |
| 4665 void Add(const Object& value, Heap::Space space = Heap::kNew) const; | 4665 void Add(const Object& value, Heap::Space space = Heap::kNew) const; |
| 4666 | 4666 |
| 4667 void Grow(intptr_t new_capacity, Heap::Space space = Heap::kNew) const; | 4667 void Grow(intptr_t new_capacity, Heap::Space space = Heap::kNew) const; |
| 4668 RawObject* RemoveLast() const; | 4668 RawObject* RemoveLast() const; |
| 4669 | 4669 |
| 4670 virtual RawAbstractTypeArguments* GetTypeArguments() const { | 4670 virtual RawAbstractTypeArguments* GetTypeArguments() const { |
|
siva
2013/02/08 23:13:34
Should we assert here that
Array::Handle(data()).G
Ivan Posva
2013/02/08 23:27:32
Actually we don't and shouldn't care about the typ
siva
2013/02/08 23:32:28
I disagree, if the data is irrelevant then that fi
| |
| 4671 ASSERT(AbstractTypeArguments::AreEqual( | |
| 4672 AbstractTypeArguments::Handle(Array::Handle(data()).GetTypeArguments()), | |
| 4673 AbstractTypeArguments::Handle(raw_ptr()->type_arguments_))); | |
| 4674 return raw_ptr()->type_arguments_; | 4671 return raw_ptr()->type_arguments_; |
| 4675 } | 4672 } |
| 4676 virtual void SetTypeArguments(const AbstractTypeArguments& value) const { | 4673 virtual void SetTypeArguments(const AbstractTypeArguments& value) const { |
| 4677 ASSERT(value.IsNull() || ((value.Length() == 1) && value.IsInstantiated())); | 4674 ASSERT(value.IsNull() || ((value.Length() == 1) && value.IsInstantiated())); |
| 4678 const Array& contents = Array::Handle(data()); | 4675 const Array& contents = Array::Handle(data()); |
| 4679 contents.SetTypeArguments(value); | 4676 contents.SetTypeArguments(value); |
| 4680 StorePointer(&raw_ptr()->type_arguments_, value.raw()); | 4677 StorePointer(&raw_ptr()->type_arguments_, value.raw()); |
| 4681 } | 4678 } |
| 4682 | 4679 |
| 4683 virtual bool Equals(const Instance& other) const; | 4680 virtual bool Equals(const Instance& other) const; |
| (...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6338 | 6335 |
| 6339 | 6336 |
| 6340 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6337 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6341 intptr_t index) { | 6338 intptr_t index) { |
| 6342 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6339 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6343 } | 6340 } |
| 6344 | 6341 |
| 6345 } // namespace dart | 6342 } // namespace dart |
| 6346 | 6343 |
| 6347 #endif // VM_OBJECT_H_ | 6344 #endif // VM_OBJECT_H_ |
| OLD | NEW |