Revert change 11091.
Review URL: https://chromiumcodereview.appspot.com//10866004 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@11096 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
+20
-8
@@ -636,7 +636,7 @@ RawError* Object::Init(Isolate* isolate) {
|
||||
// Allocate and initialize the Object class and type. The Object
|
||||
// class and ByteArray subclasses are the only pre-allocated,
|
||||
// non-interface classes in the core library.
|
||||
cls = Class::New<Instance>(kInstanceCid);
|
||||
cls = Class::New<Instance>();
|
||||
object_store->set_object_class(cls);
|
||||
name = Symbols::Object();
|
||||
cls.set_name(name);
|
||||
@@ -919,9 +919,6 @@ void Object::InitFromSnapshot(Isolate* isolate) {
|
||||
// Set up empty classes in the object store, these will get
|
||||
// initialized correctly when we read from the snapshot.
|
||||
// This is done to allow bootstrapping of reading classes from the snapshot.
|
||||
cls = Class::New<Instance>(kInstanceCid);
|
||||
object_store->set_object_class(cls);
|
||||
|
||||
cls = Class::New<Array>();
|
||||
object_store->set_array_class(cls);
|
||||
|
||||
@@ -1253,9 +1250,9 @@ RawClass* Class::New() {
|
||||
result.set_handle_vtable(fake.vtable());
|
||||
result.set_instance_size(FakeObject::InstanceSize());
|
||||
result.set_next_field_offset(FakeObject::InstanceSize());
|
||||
ASSERT((FakeObject::kClassId != kInstanceCid) &&
|
||||
(FakeObject::kClassId != kClosureCid));
|
||||
result.set_id(FakeObject::kClassId);
|
||||
result.set_id((FakeObject::kClassId != kInstanceCid &&
|
||||
FakeObject::kClassId != kClosureCid) ?
|
||||
FakeObject::kClassId : kIllegalCid);
|
||||
result.raw_ptr()->state_bits_ = 0;
|
||||
// VM backed classes are almost ready: run checks and resolve class
|
||||
// references, but do not recompute size.
|
||||
@@ -1677,7 +1674,6 @@ RawClass* Class::New(intptr_t index) {
|
||||
result.raw_ptr()->state_bits_ = 0;
|
||||
result.raw_ptr()->type_arguments_instance_field_offset_ = kNoTypeArguments;
|
||||
result.raw_ptr()->num_native_fields_ = 0;
|
||||
result.raw_ptr()->token_pos_ = Scanner::kDummyTokenIndex;
|
||||
result.InitEmptyFields();
|
||||
Isolate::Current()->class_table()->Register(result);
|
||||
return result.raw();
|
||||
@@ -1770,6 +1766,22 @@ RawClass* Class::NewSignatureClass(const String& name,
|
||||
}
|
||||
|
||||
|
||||
RawClass* Class::GetClass(intptr_t class_id, bool is_signature_class) {
|
||||
if (class_id >= kIntegerCid && class_id <= kWeakPropertyCid) {
|
||||
return Isolate::Current()->class_table()->At(class_id);
|
||||
}
|
||||
if (class_id >= kNumPredefinedCids) {
|
||||
if (is_signature_class) {
|
||||
return Class::New<Closure>();
|
||||
}
|
||||
return Class::New<Instance>();
|
||||
}
|
||||
OS::Print("Class::GetClass id unknown: %d\n", class_id);
|
||||
UNREACHABLE();
|
||||
return Class::null();
|
||||
}
|
||||
|
||||
|
||||
RawClass* Class::NewNativeWrapper(const Library& library,
|
||||
const String& name,
|
||||
int field_count) {
|
||||
|
||||
@@ -41,16 +41,7 @@ RawClass* Class::ReadFrom(SnapshotReader* reader,
|
||||
if (kind == Snapshot::kFull) {
|
||||
cls = reader->NewClass(class_id, is_signature_class);
|
||||
} else {
|
||||
if (class_id < kNumPredefinedCids) {
|
||||
ASSERT((class_id >= kInstanceCid) && (class_id <= kWeakPropertyCid));
|
||||
cls = reader->isolate()->class_table()->At(class_id);
|
||||
} else {
|
||||
if (is_signature_class) {
|
||||
cls = Class::New<Closure>(kIllegalCid);
|
||||
} else {
|
||||
cls = Class::New<Instance>(kIllegalCid);
|
||||
}
|
||||
}
|
||||
cls = Class::GetClass(class_id, is_signature_class);
|
||||
}
|
||||
reader->AddBackRef(object_id, &cls, kIsDeserialized);
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ static intptr_t ClassIdFromObjectId(intptr_t object_id) {
|
||||
|
||||
|
||||
static intptr_t ObjectIdFromClassId(intptr_t class_id) {
|
||||
ASSERT((class_id > kIllegalCid) && (class_id < kNumPredefinedCids));
|
||||
ASSERT(class_id > kIllegalCid && class_id < kNumPredefinedCids);
|
||||
return (class_id + kClassIdsOffset);
|
||||
}
|
||||
|
||||
@@ -414,8 +414,7 @@ RawClass* SnapshotReader::NewClass(intptr_t class_id, bool is_signature_class) {
|
||||
ASSERT(kind_ == Snapshot::kFull);
|
||||
ASSERT(isolate()->no_gc_scope_depth() != 0);
|
||||
if (class_id < kNumPredefinedCids) {
|
||||
ASSERT((class_id >= kInstanceCid) && (class_id <= kWeakPropertyCid));
|
||||
return isolate()->class_table()->At(class_id);
|
||||
return Class::GetClass(class_id, is_signature_class);
|
||||
}
|
||||
cls_ = Object::class_class();
|
||||
RawClass* obj = reinterpret_cast<RawClass*>(
|
||||
|
||||
Reference in New Issue
Block a user