| 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 4194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4205 RawObject* Evaluate(const String& expr, | 4205 RawObject* Evaluate(const String& expr, |
| 4206 const Array& param_names, | 4206 const Array& param_names, |
| 4207 const Array& param_values) const; | 4207 const Array& param_values) const; |
| 4208 | 4208 |
| 4209 static intptr_t InstanceSize() { | 4209 static intptr_t InstanceSize() { |
| 4210 return RoundedAllocationSize(sizeof(RawInstance)); | 4210 return RoundedAllocationSize(sizeof(RawInstance)); |
| 4211 } | 4211 } |
| 4212 | 4212 |
| 4213 static RawInstance* New(const Class& cls, Heap::Space space = Heap::kNew); | 4213 static RawInstance* New(const Class& cls, Heap::Space space = Heap::kNew); |
| 4214 | 4214 |
| 4215 // Array/list element address computations. |
| 4216 static intptr_t DataOffsetFor(intptr_t cid); |
| 4217 static intptr_t ElementSizeFor(intptr_t cid); |
| 4218 |
| 4215 protected: | 4219 protected: |
| 4216 virtual void PrintSharedInstanceJSON(JSONObject* jsobj, bool ref) const; | 4220 virtual void PrintSharedInstanceJSON(JSONObject* jsobj, bool ref) const; |
| 4217 | 4221 |
| 4218 private: | 4222 private: |
| 4219 RawObject** FieldAddrAtOffset(intptr_t offset) const { | 4223 RawObject** FieldAddrAtOffset(intptr_t offset) const { |
| 4220 ASSERT(IsValidFieldOffset(offset)); | 4224 ASSERT(IsValidFieldOffset(offset)); |
| 4221 return reinterpret_cast<RawObject**>(raw_value() - kHeapObjectTag + offset); | 4225 return reinterpret_cast<RawObject**>(raw_value() - kHeapObjectTag + offset); |
| 4222 } | 4226 } |
| 4223 RawObject** FieldAddr(const Field& field) const { | 4227 RawObject** FieldAddr(const Field& field) const { |
| 4224 return FieldAddrAtOffset(field.Offset()); | 4228 return FieldAddrAtOffset(field.Offset()); |
| (...skipping 2841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7066 | 7070 |
| 7067 | 7071 |
| 7068 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7072 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 7069 intptr_t index) { | 7073 intptr_t index) { |
| 7070 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7074 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 7071 } | 7075 } |
| 7072 | 7076 |
| 7073 } // namespace dart | 7077 } // namespace dart |
| 7074 | 7078 |
| 7075 #endif // VM_OBJECT_H_ | 7079 #endif // VM_OBJECT_H_ |
| OLD | NEW |