| 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 4816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4827 } | 4827 } |
| 4828 | 4828 |
| 4829 void SetLength(intptr_t value) const { | 4829 void SetLength(intptr_t value) const { |
| 4830 // This is only safe because we create a new Smi, which does not cause | 4830 // This is only safe because we create a new Smi, which does not cause |
| 4831 // heap allocation. | 4831 // heap allocation. |
| 4832 raw_ptr()->length_ = Smi::New(value); | 4832 raw_ptr()->length_ = Smi::New(value); |
| 4833 } | 4833 } |
| 4834 | 4834 |
| 4835 HEAP_OBJECT_IMPLEMENTATION(Array, Instance); | 4835 HEAP_OBJECT_IMPLEMENTATION(Array, Instance); |
| 4836 friend class Class; | 4836 friend class Class; |
| 4837 friend class Object; |
| 4837 friend class String; | 4838 friend class String; |
| 4838 }; | 4839 }; |
| 4839 | 4840 |
| 4840 | 4841 |
| 4841 class ImmutableArray : public Array { | 4842 class ImmutableArray : public Array { |
| 4842 public: | 4843 public: |
| 4843 static RawImmutableArray* New(intptr_t len, Heap::Space space = Heap::kNew); | 4844 static RawImmutableArray* New(intptr_t len, Heap::Space space = Heap::kNew); |
| 4844 | 4845 |
| 4845 private: | 4846 private: |
| 4846 FINAL_HEAP_OBJECT_IMPLEMENTATION(ImmutableArray, Array); | 4847 FINAL_HEAP_OBJECT_IMPLEMENTATION(ImmutableArray, Array); |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5657 | 5658 |
| 5658 | 5659 |
| 5659 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5660 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 5660 intptr_t index) { | 5661 intptr_t index) { |
| 5661 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5662 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 5662 } | 5663 } |
| 5663 | 5664 |
| 5664 } // namespace dart | 5665 } // namespace dart |
| 5665 | 5666 |
| 5666 #endif // VM_OBJECT_H_ | 5667 #endif // VM_OBJECT_H_ |
| OLD | NEW |