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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 #define HEAP_PROFILER_SUPPORT() \ | 225 #define HEAP_PROFILER_SUPPORT() \ |
226 friend class HeapProfiler; \ | 226 friend class HeapProfiler; \ |
227 | 227 |
228 #define RAW_OBJECT_IMPLEMENTATION(object) \ | 228 #define RAW_OBJECT_IMPLEMENTATION(object) \ |
229 private: /* NOLINT */ \ | 229 private: /* NOLINT */ \ |
230 VISITOR_SUPPORT(object) \ | 230 VISITOR_SUPPORT(object) \ |
231 friend class object; \ | 231 friend class object; \ |
232 friend class RawObject; \ | 232 friend class RawObject; \ |
233 friend class Heap; \ | 233 friend class Heap; \ |
| 234 friend class Simulator; \ |
| 235 friend class SimulatorHelpers; \ |
234 DISALLOW_ALLOCATION(); \ | 236 DISALLOW_ALLOCATION(); \ |
235 DISALLOW_IMPLICIT_CONSTRUCTORS(Raw##object) | 237 DISALLOW_IMPLICIT_CONSTRUCTORS(Raw##object) |
236 | 238 |
237 // TODO(koda): Make ptr() return const*, like Object::raw_ptr(). | 239 // TODO(koda): Make ptr() return const*, like Object::raw_ptr(). |
238 #define RAW_HEAP_OBJECT_IMPLEMENTATION(object) \ | 240 #define RAW_HEAP_OBJECT_IMPLEMENTATION(object) \ |
239 private: \ | 241 private: \ |
240 RAW_OBJECT_IMPLEMENTATION(object); \ | 242 RAW_OBJECT_IMPLEMENTATION(object); \ |
241 Raw##object* ptr() const { \ | 243 Raw##object* ptr() const { \ |
242 ASSERT(IsHeapObject()); \ | 244 ASSERT(IsHeapObject()); \ |
243 return reinterpret_cast<Raw##object*>( \ | 245 return reinterpret_cast<Raw##object*>( \ |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 friend class SnapshotReader; | 660 friend class SnapshotReader; |
659 friend class SnapshotWriter; | 661 friend class SnapshotWriter; |
660 friend class String; | 662 friend class String; |
661 friend class TypedData; | 663 friend class TypedData; |
662 friend class TypedDataView; | 664 friend class TypedDataView; |
663 friend class WeakProperty; // StorePointer | 665 friend class WeakProperty; // StorePointer |
664 friend class Instance; // StorePointer | 666 friend class Instance; // StorePointer |
665 friend class StackFrame; // GetCodeObject assertion. | 667 friend class StackFrame; // GetCodeObject assertion. |
666 friend class CodeLookupTableBuilder; // profiler | 668 friend class CodeLookupTableBuilder; // profiler |
667 friend class NativeEntry; // GetClassId | 669 friend class NativeEntry; // GetClassId |
| 670 friend class Simulator; |
| 671 friend class SimulatorHelpers; |
668 | 672 |
669 DISALLOW_ALLOCATION(); | 673 DISALLOW_ALLOCATION(); |
670 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); | 674 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); |
671 }; | 675 }; |
672 | 676 |
673 | 677 |
674 class RawClass : public RawObject { | 678 class RawClass : public RawObject { |
675 public: | 679 public: |
676 enum ClassFinalizedState { | 680 enum ClassFinalizedState { |
677 kAllocated = 0, // Initial state. | 681 kAllocated = 0, // Initial state. |
(...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2371 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2375 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2372 kTypedDataInt8ArrayViewCid + 15); | 2376 kTypedDataInt8ArrayViewCid + 15); |
2373 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2377 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2374 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2378 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2375 return (kNullCid - kTypedDataInt8ArrayCid); | 2379 return (kNullCid - kTypedDataInt8ArrayCid); |
2376 } | 2380 } |
2377 | 2381 |
2378 } // namespace dart | 2382 } // namespace dart |
2379 | 2383 |
2380 #endif // VM_RAW_OBJECT_H_ | 2384 #endif // VM_RAW_OBJECT_H_ |
OLD | NEW |