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_RAW_OBJECT_H_ | 5 #ifndef VM_RAW_OBJECT_H_ |
6 #define VM_RAW_OBJECT_H_ | 6 #define VM_RAW_OBJECT_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/atomic.h" | 9 #include "vm/atomic.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 #define HEAP_PROFILER_SUPPORT() \ | 210 #define HEAP_PROFILER_SUPPORT() \ |
211 friend class HeapProfiler; \ | 211 friend class HeapProfiler; \ |
212 | 212 |
213 #define RAW_OBJECT_IMPLEMENTATION(object) \ | 213 #define RAW_OBJECT_IMPLEMENTATION(object) \ |
214 private: /* NOLINT */ \ | 214 private: /* NOLINT */ \ |
215 VISITOR_SUPPORT(object) \ | 215 VISITOR_SUPPORT(object) \ |
216 friend class object; \ | 216 friend class object; \ |
217 friend class RawObject; \ | 217 friend class RawObject; \ |
218 friend class Heap; \ | 218 friend class Heap; \ |
| 219 friend class Simulator; \ |
| 220 friend class SimulatorHelpers; \ |
219 DISALLOW_ALLOCATION(); \ | 221 DISALLOW_ALLOCATION(); \ |
220 DISALLOW_IMPLICIT_CONSTRUCTORS(Raw##object) | 222 DISALLOW_IMPLICIT_CONSTRUCTORS(Raw##object) |
221 | 223 |
222 // TODO(koda): Make ptr() return const*, like Object::raw_ptr(). | 224 // TODO(koda): Make ptr() return const*, like Object::raw_ptr(). |
223 #define RAW_HEAP_OBJECT_IMPLEMENTATION(object) \ | 225 #define RAW_HEAP_OBJECT_IMPLEMENTATION(object) \ |
224 private: \ | 226 private: \ |
225 RAW_OBJECT_IMPLEMENTATION(object); \ | 227 RAW_OBJECT_IMPLEMENTATION(object); \ |
226 Raw##object* ptr() const { \ | 228 Raw##object* ptr() const { \ |
227 ASSERT(IsHeapObject()); \ | 229 ASSERT(IsHeapObject()); \ |
228 return reinterpret_cast<Raw##object*>( \ | 230 return reinterpret_cast<Raw##object*>( \ |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 friend class SnapshotReader; | 645 friend class SnapshotReader; |
644 friend class SnapshotWriter; | 646 friend class SnapshotWriter; |
645 friend class String; | 647 friend class String; |
646 friend class TypedData; | 648 friend class TypedData; |
647 friend class TypedDataView; | 649 friend class TypedDataView; |
648 friend class WeakProperty; // StorePointer | 650 friend class WeakProperty; // StorePointer |
649 friend class Instance; // StorePointer | 651 friend class Instance; // StorePointer |
650 friend class StackFrame; // GetCodeObject assertion. | 652 friend class StackFrame; // GetCodeObject assertion. |
651 friend class CodeLookupTableBuilder; // profiler | 653 friend class CodeLookupTableBuilder; // profiler |
652 friend class NativeEntry; // GetClassId | 654 friend class NativeEntry; // GetClassId |
| 655 friend class Simulator; |
| 656 friend class SimulatorHelpers; |
653 | 657 |
654 DISALLOW_ALLOCATION(); | 658 DISALLOW_ALLOCATION(); |
655 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); | 659 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); |
656 }; | 660 }; |
657 | 661 |
658 | 662 |
659 class RawClass : public RawObject { | 663 class RawClass : public RawObject { |
660 public: | 664 public: |
661 enum ClassFinalizedState { | 665 enum ClassFinalizedState { |
662 kAllocated = 0, // Initial state. | 666 kAllocated = 0, // Initial state. |
(...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2355 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2359 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2356 kTypedDataInt8ArrayViewCid + 15); | 2360 kTypedDataInt8ArrayViewCid + 15); |
2357 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2361 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2358 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2362 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2359 return (kNullCid - kTypedDataInt8ArrayCid); | 2363 return (kNullCid - kTypedDataInt8ArrayCid); |
2360 } | 2364 } |
2361 | 2365 |
2362 } // namespace dart | 2366 } // namespace dart |
2363 | 2367 |
2364 #endif // VM_RAW_OBJECT_H_ | 2368 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |