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

Unified Diff: vm/raw_object.h

Issue 9965042: - Add a class index to the classes. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/object_store.h ('k') | vm/raw_object.cc » ('j') | vm/raw_object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/raw_object.h
===================================================================
--- vm/raw_object.h (revision 6994)
+++ vm/raw_object.h (working copy)
@@ -85,6 +85,7 @@
enum ObjectKind {
+ kIllegalObjectKind = 0,
#define DEFINE_OBJECT_KIND(clazz) \
k##clazz,
CLASS_LIST(DEFINE_OBJECT_KIND)
@@ -92,7 +93,13 @@
// The following entry does not describe a real object, but instead it
// identifies free list elements in the heap.
kFreeListElement,
- kNumOfObjectKinds = kFreeListElement
+ // The following entries do not describe a real object, but instead are used
+ // to allocate class indexes for pre-allocated instance classes such as the
+ // Null, Void, Dynamic and other similar classes.
+ kNullClassIndex,
+ kDynamicClassIndex,
+ kVoidClassIndex,
+ kNumPredefinedKinds = 100
};
enum ObjectAlignment {
@@ -160,6 +167,8 @@
kReservedBit10M = 7,
kSizeTagBit = 8,
kSizeTagSize = 8,
+ kClassTagBit = kSizeTagBit + kSizeTagSize,
+ kClassTagSize = 16
};
// Encodes the object size in the tag in units of object alignment.
@@ -193,6 +202,8 @@
}
};
+ class ClassTag : public BitField<intptr_t, kClassTagBit, kClassTagSize> {};
+
bool IsHeapObject() const {
uword value = reinterpret_cast<uword>(this);
return (value & kSmiTagMask) == kHeapObjectTag;
@@ -341,6 +352,7 @@
cpp_vtable handle_vtable_;
intptr_t instance_size_;
ObjectKind instance_kind_;
+ intptr_t index_; // Index in the class table.
intptr_t type_arguments_instance_field_offset_; // May be kNoTypeArguments.
intptr_t next_field_offset_; // Offset of then next instance field.
intptr_t num_native_fields_; // Number of native fields in class.
« no previous file with comments | « vm/object_store.h ('k') | vm/raw_object.cc » ('j') | vm/raw_object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698