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

Unified Diff: vm/object.cc

Issue 10866004: Revert change 11091. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 4 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 | vm/raw_object_snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object.cc
===================================================================
--- vm/object.cc (revision 11095)
+++ vm/object.cc (working copy)
@@ -636,7 +636,7 @@
// 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 @@
// 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 @@
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 @@
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::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) {
« no previous file with comments | « no previous file | vm/raw_object_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698