Chromium Code Reviews| Index: runtime/vm/object.cc |
| =================================================================== |
| --- runtime/vm/object.cc (revision 37613) |
| +++ runtime/vm/object.cc (working copy) |
| @@ -1372,6 +1372,29 @@ |
| // Set up recognized state of all functions (core, math and typed data). |
| MethodRecognizer::InitializeState(); |
| + // Adds static const fields (class ids) to the class 'ClassID'); |
| + lib = Library::LookupLibrary(Symbols::DartInternal()); |
| + ASSERT(!lib.IsNull()); |
| + cls = lib.LookupClassAllowPrivate(Symbols::ClassID()); |
| + ASSERT(!cls.IsNull()); |
| + Field& field = Field::Handle(isolate); |
| + Smi& value = Smi::Handle(isolate); |
| + |
| +#define CLASS_LIST_WITH_NULL(V) \ |
| + V(Null) \ |
| + CLASS_LIST_NO_OBJECT(V) |
| + |
| +#define ADD_SET_FIELD(clazz) \ |
| + field = Field::New(String::Handle(Symbols::New("cid"#clazz)), \ |
|
siva
2014/06/23 21:23:31
This String::Handle can also be hoisted out and th
srdjan
2014/06/23 22:27:35
Done.
|
| + true, false, true, cls, 0); \ |
| + value = Smi::New(k##clazz##Cid); \ |
| + field.set_value(value); \ |
| + field.set_type(Type::Handle(Type::IntType())); \ |
| + cls.AddField(field); \ |
| + |
| + CLASS_LIST_WITH_NULL(ADD_SET_FIELD) |
| +#undef ADD_SET_FIELD |
| + |
| return Error::null(); |
| } |