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

Unified Diff: runtime/vm/object.h

Issue 15689012: More cleanup to avoid creation of redundant handles (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 7 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
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 23498)
+++ runtime/vm/object.h (working copy)
@@ -110,9 +110,16 @@
ASSERT(obj.Is##object()); \
return reinterpret_cast<const object&>(obj); \
} \
+ static Raw##object* RawCast(RawObject* raw) { \
+ ASSERT(Object::Handle(raw).Is##object()); \
+ return reinterpret_cast<Raw##object*>(raw); \
+ } \
static Raw##object* null() { \
return reinterpret_cast<Raw##object*>(Object::null()); \
} \
+ static const object& null_object() { \
+ return reinterpret_cast<const object&>(Object::null_object()); \
Ivan Posva 2013/06/01 00:34:40 This will not have the correct vtable setup.
+ } \
virtual const char* ToCString() const; \
static const ClassId kClassId = k##object##Cid; \
private: /* NOLINT */ \
@@ -305,6 +312,10 @@
}
static RawObject* null() { return null_; }
+ static const Object& null_object() {
+ ASSERT(null_object_ != NULL);
+ return *null_object_;
+ }
static const Array& empty_array() {
ASSERT(empty_array_ != NULL);
return *empty_array_;
@@ -342,6 +353,11 @@
ASSERT(bool_false_ != NULL);
return *bool_false_;
}
+
+ static const Smi& smi_illegal_cid() {
+ ASSERT(smi_illegal_cid_ != NULL);
+ return *smi_illegal_cid_;
+ }
static const LanguageError& snapshot_writer_error() {
ASSERT(snapshot_writer_error_ != NULL);
return *snapshot_writer_error_;
@@ -533,6 +549,7 @@
// The static values below are read-only handle pointers for singleton
// objects that are shared between the different isolates.
+ static Object* null_object_;
static Array* empty_array_;
static Instance* sentinel_;
static Instance* transition_sentinel_;
@@ -540,6 +557,7 @@
static Instance* non_constant_;
static Bool* bool_true_;
static Bool* bool_false_;
+ static Smi* smi_illegal_cid_;
static LanguageError* snapshot_writer_error_;
friend void ClassTable::Register(const Class& cls);
@@ -3251,7 +3269,7 @@
#endif // DEBUG
intptr_t TestEntryLength() const;
- void WriteSentinel() const;
+ void WriteSentinel(const Array& data) const;
FINAL_HEAP_OBJECT_IMPLEMENTATION(ICData, Object);
friend class Class;
« no previous file with comments | « runtime/vm/class_finalizer.cc ('k') | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698