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

Unified Diff: runtime/vm/object.cc

Issue 10034019: Add missing calls to class finalizer in various tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
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 | « runtime/vm/dart_entry_test.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 6416)
+++ runtime/vm/object.cc (working copy)
@@ -291,9 +291,9 @@
// field.
null_->ptr()->class_ = null_class_;
- // Allocate and initialize the sentinel values of an instance class.
+ // Allocate and initialize the sentinel values of Null class.
{
- cls = Class::New<Instance>();
+ cls = null_class_;
Instance& sentinel = Instance::Handle();
sentinel ^= Object::Allocate(cls, Instance::InstanceSize(), Heap::kOld);
sentinel_ = sentinel.raw();
@@ -6519,6 +6519,9 @@
return other_class.IsObjectClass() || other_class.IsDynamicClass();
}
const Class& cls = Class::Handle(clazz());
+ // We must not encounter Object::sentinel() or Object::transition_sentinel(),
+ // both instances of class NullClass, but not instance Object::null().
+ ASSERT(!cls.IsNullClass());
AbstractTypeArguments& type_arguments = AbstractTypeArguments::Handle();
const intptr_t num_type_arguments = cls.NumTypeArguments();
if (num_type_arguments > 0) {
@@ -6602,6 +6605,10 @@
const char* Instance::ToCString() const {
if (IsNull()) {
return "null";
+ } else if (raw() == Object::sentinel()) {
+ return "sentinel";
+ } else if (raw() == Object::transition_sentinel()) {
+ return "transition_sentinel";
} else if (Isolate::Current()->no_gc_scope_depth() > 0) {
// Can occur when running disassembler.
return "Instance";
« no previous file with comments | « runtime/vm/dart_entry_test.cc ('k') | runtime/vm/unit_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698