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

Unified Diff: runtime/vm/object.cc

Issue 18242003: Add a VM defined class MirrorReference as an opaque pointer for Dart code to VM internal objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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.cc
===================================================================
--- runtime/vm/object.cc (revision 24540)
+++ runtime/vm/object.cc (working copy)
@@ -929,6 +929,10 @@
object_store->set_weak_property_class(cls);
RegisterPrivateClass(cls, Symbols::_WeakProperty(), core_lib);
+ cls = Class::New<VMReference>();
+ object_store->set_vm_reference_class(cls);
+ RegisterPrivateClass(cls, Symbols::_VMReference(), core_lib);
+
// Setup some default native field classes which can be extended for
// specifying native fields in dart classes.
Library::InitNativeWrappersLibrary(isolate);
@@ -1199,6 +1203,9 @@
cls = Class::New<WeakProperty>();
object_store->set_weak_property_class(cls);
+
+ cls = Class::New<VMReference>();
+ object_store->set_vm_reference_class(cls);
}
@@ -13671,4 +13678,20 @@
return "_WeakProperty";
}
+
+RawVMReference* VMReference::New(Heap::Space space) {
+ ASSERT(Isolate::Current()->object_store()->vm_reference_class()
+ != Class::null());
+ RawObject* raw = Object::Allocate(VMReference::kClassId,
+ VMReference::InstanceSize(),
+ space);
+ return reinterpret_cast<RawVMReference*>(raw);
+}
siva 2013/06/30 01:12:48 Need to add unit tests in object_test.cc creating
rmacnak 2013/07/01 18:35:49 Added
+
+
+const char* VMReference::ToCString() const {
+ return "_VMReference";
+}
+
+
} // namespace dart

Powered by Google App Engine
This is Rietveld 408576698