| Index: runtime/vm/object.cc
|
| ===================================================================
|
| --- runtime/vm/object.cc (revision 23868)
|
| +++ runtime/vm/object.cc (working copy)
|
| @@ -530,7 +530,7 @@
|
| cls = Class::New<Array>();
|
| isolate->object_store()->set_array_class(cls);
|
| cls.set_type_arguments_field_offset(Array::type_arguments_offset());
|
| - cls = Class::New<ImmutableArray>();
|
| + cls = Class::New<Array>(kImmutableArrayCid);
|
| isolate->object_store()->set_immutable_array_class(cls);
|
| cls.set_type_arguments_field_offset(Array::type_arguments_offset());
|
| cls = Class::NewStringClass(kOneByteStringCid);
|
| @@ -832,10 +832,11 @@
|
| RegisterPrivateClass(cls, Symbols::GrowableObjectArray(), core_lib);
|
| pending_classes.Add(cls, Heap::kOld);
|
|
|
| - cls = Class::New<ImmutableArray>();
|
| + cls = Class::New<Array>(kImmutableArrayCid);
|
| object_store->set_immutable_array_class(cls);
|
| cls.set_type_arguments_field_offset(Array::type_arguments_offset());
|
| ASSERT(object_store->immutable_array_class() != object_store->array_class());
|
| + cls.set_is_prefinalized();
|
| RegisterPrivateClass(cls, Symbols::ImmutableArray(), core_lib);
|
| pending_classes.Add(cls, Heap::kOld);
|
|
|
| @@ -1120,7 +1121,7 @@
|
| cls = Class::New<Array>();
|
| object_store->set_array_class(cls);
|
|
|
| - cls = Class::New<ImmutableArray>();
|
| + cls = Class::New<Array>(kImmutableArrayCid);
|
| object_store->set_immutable_array_class(cls);
|
|
|
| cls = Class::New<GrowableObjectArray>();
|
| @@ -12542,9 +12543,10 @@
|
|
|
| const char* Array::ToCString() const {
|
| if (IsNull()) {
|
| - return "Array NULL";
|
| + return IsImmutable() ? "ImmutableArray NULL" : "Array NULL";
|
| }
|
| - const char* format = "Array len:%"Pd"";
|
| + const char* format = !IsImmutable() ? "Array len:%"Pd"" :
|
| + "Immutable Array len:%"Pd"";
|
| intptr_t len = OS::SNPrint(NULL, 0, format, Length()) + 1;
|
| char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
|
| OS::SNPrint(chars, len, format, Length());
|
| @@ -12612,18 +12614,6 @@
|
| }
|
|
|
|
|
| -const char* ImmutableArray::ToCString() const {
|
| - if (IsNull()) {
|
| - return "ImmutableArray NULL";
|
| - }
|
| - const char* format = "ImmutableArray len:%"Pd"";
|
| - intptr_t len = OS::SNPrint(NULL, 0, format, Length()) + 1;
|
| - char* chars = Isolate::Current()->current_zone()->Alloc<char>(len);
|
| - OS::SNPrint(chars, len, format, Length());
|
| - return chars;
|
| -}
|
| -
|
| -
|
| void GrowableObjectArray::Add(const Object& value, Heap::Space space) const {
|
| ASSERT(!IsNull());
|
| if (Length() == Capacity()) {
|
|
|