Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: runtime/vm/raw_object.h

Issue 51653006: Track live instance and allocation counts for classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/globals.h" 9 #include "vm/globals.h"
10 #include "vm/token.h" 10 #include "vm/token.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 return ClassIdTag::decode(tags); 436 return ClassIdTag::decode(tags);
437 } 437 }
438 438
439 friend class Api; 439 friend class Api;
440 friend class Array; 440 friend class Array;
441 friend class FreeListElement; 441 friend class FreeListElement;
442 friend class GCMarker; 442 friend class GCMarker;
443 friend class ExternalTypedData; 443 friend class ExternalTypedData;
444 friend class Heap; 444 friend class Heap;
445 friend class HeapProfiler; 445 friend class HeapProfiler;
446 friend class ClassStatsVisitor;
446 friend class HeapProfilerRootVisitor; 447 friend class HeapProfilerRootVisitor;
447 friend class MarkingVisitor; 448 friend class MarkingVisitor;
448 friend class Object; 449 friend class Object;
449 friend class ObjectHistogram; 450 friend class ObjectHistogram;
450 friend class RawExternalTypedData; 451 friend class RawExternalTypedData;
451 friend class RawInstructions; 452 friend class RawInstructions;
452 friend class RawInstance; 453 friend class RawInstance;
453 friend class RawTypedData; 454 friend class RawTypedData;
454 friend class Scavenger; 455 friend class Scavenger;
456 friend class ScavengerVisitor;
455 friend class SnapshotReader; 457 friend class SnapshotReader;
456 friend class SnapshotWriter; 458 friend class SnapshotWriter;
457 friend class String; 459 friend class String;
458 friend class TypedData; 460 friend class TypedData;
459 friend class TypedDataView; 461 friend class TypedDataView;
460 462
461 DISALLOW_ALLOCATION(); 463 DISALLOW_ALLOCATION();
462 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); 464 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject);
463 }; 465 };
464 466
465 467
466 class RawClass : public RawObject { 468 class RawClass : public RawObject {
467 public: 469 public:
468 enum ClassFinalizedState { 470 enum ClassFinalizedState {
469 kAllocated = 0, // Initial state. 471 kAllocated = 0, // Initial state.
470 kPreFinalized, // VM classes: size precomputed, but no checks done. 472 kPreFinalized, // VM classes: size precomputed, but no checks done.
471 kFinalized, // Class parsed, finalized and ready for use. 473 kFinalized, // Class parsed, finalized and ready for use.
472 }; 474 };
473 475
474 private: 476 private:
475 RAW_HEAP_OBJECT_IMPLEMENTATION(Class); 477 RAW_HEAP_OBJECT_IMPLEMENTATION(Class);
476 478
477 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } 479 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); }
478 RawString* name_; 480 RawString* name_;
481 RawString* user_name_;
479 RawArray* functions_; 482 RawArray* functions_;
480 RawArray* fields_; 483 RawArray* fields_;
481 RawArray* offset_in_words_to_field_; 484 RawArray* offset_in_words_to_field_;
482 RawGrowableObjectArray* closure_functions_; // Local functions and literals. 485 RawGrowableObjectArray* closure_functions_; // Local functions and literals.
483 RawArray* interfaces_; // Array of AbstractType. 486 RawArray* interfaces_; // Array of AbstractType.
484 RawGrowableObjectArray* direct_subclasses_; // Array of Class. 487 RawGrowableObjectArray* direct_subclasses_; // Array of Class.
485 RawScript* script_; 488 RawScript* script_;
486 RawLibrary* library_; 489 RawLibrary* library_;
487 RawTypeArguments* type_parameters_; // Array of TypeParameter. 490 RawTypeArguments* type_parameters_; // Array of TypeParameter.
488 RawAbstractType* super_type_; 491 RawAbstractType* super_type_;
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 // Make sure this is updated when new TypedData types are added. 1745 // Make sure this is updated when new TypedData types are added.
1743 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 13); 1746 ASSERT(kTypedDataInt8ArrayViewCid == kTypedDataInt8ArrayCid + 13);
1744 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 14); 1747 ASSERT(kExternalTypedDataInt8ArrayCid == kTypedDataInt8ArrayViewCid + 14);
1745 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 13); 1748 ASSERT(kNullCid == kExternalTypedDataInt8ArrayCid + 13);
1746 return (kNullCid - kTypedDataInt8ArrayCid); 1749 return (kNullCid - kTypedDataInt8ArrayCid);
1747 } 1750 }
1748 1751
1749 } // namespace dart 1752 } // namespace dart
1750 1753
1751 #endif // VM_RAW_OBJECT_H_ 1754 #endif // VM_RAW_OBJECT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698