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

Unified Diff: runtime/vm/object.h

Issue 11979003: Add a new operator |= which does a simple assignment of the raw pointer into (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 17236)
+++ runtime/vm/object.h (working copy)
@@ -33,6 +33,12 @@
class LocalScope;
class Symbols;
+#if defined(DEBUG)
+#define CHECK_HANDLE() CheckHandle();
+#else
+#define CHECK_HANDLE()
+#endif
+
#define OBJECT_IMPLEMENTATION(object, super) \
public: /* NOLINT */ \
Raw##object* raw() const { return reinterpret_cast<Raw##object*>(raw_); } \
@@ -44,6 +50,10 @@
initializeHandle(this, value); \
ASSERT(IsNull() || Is##object()); \
} \
+ void operator|=(RawObject* value) { \
+ raw_ = value; \
+ CHECK_HANDLE(); \
+ } \
static object& Handle(Isolate* isolate, Raw##object* raw_ptr) { \
object* obj = \
reinterpret_cast<object*>(VMHandles::AllocateHandle(isolate)); \
@@ -366,6 +376,7 @@
}
inline void SetRaw(RawObject* value);
+ void CheckHandle() const;
cpp_vtable vtable() const { return bit_copy<cpp_vtable>(*this); }
void set_vtable(cpp_vtable value) { *vtable_address() = value; }
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | runtime/vm/object.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698