| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/object.h" | 5 #include "vm/object.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/cpu.h" | 10 #include "vm/cpu.h" |
| (...skipping 8015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8026 cls, | 8026 cls, |
| 8027 token_pos)); | 8027 token_pos)); |
| 8028 field.set_type(Type::Handle(Type::DynamicType())); | 8028 field.set_type(Type::Handle(Type::DynamicType())); |
| 8029 field.set_value(Array::empty_array()); | 8029 field.set_value(Array::empty_array()); |
| 8030 GrowableObjectArray& metadata = | 8030 GrowableObjectArray& metadata = |
| 8031 GrowableObjectArray::Handle(this->metadata()); | 8031 GrowableObjectArray::Handle(this->metadata()); |
| 8032 metadata.Add(field, Heap::kOld); | 8032 metadata.Add(field, Heap::kOld); |
| 8033 } | 8033 } |
| 8034 | 8034 |
| 8035 | 8035 |
| 8036 void Library::AddClassMetadata(const Class& cls, intptr_t token_pos) const { | 8036 void Library::AddClassMetadata(const Class& cls, |
| 8037 AddMetadata(cls, String::Handle(MakeClassMetaName(cls)), token_pos); | 8037 const Class& toplevel_class, |
| 8038 intptr_t token_pos) const { |
| 8039 // We use the toplevel class as the owner of a class's metadata field because |
| 8040 // a class's metadata is in scope of the library, not the class. |
| 8041 AddMetadata(toplevel_class, |
| 8042 String::Handle(MakeClassMetaName(cls)), |
| 8043 token_pos); |
| 8038 } | 8044 } |
| 8039 | 8045 |
| 8040 | 8046 |
| 8041 void Library::AddFieldMetadata(const Field& field, | 8047 void Library::AddFieldMetadata(const Field& field, |
| 8042 intptr_t token_pos) const { | 8048 intptr_t token_pos) const { |
| 8043 AddMetadata(Class::Handle(field.origin()), | 8049 AddMetadata(Class::Handle(field.origin()), |
| 8044 String::Handle(MakeFieldMetaName(field)), | 8050 String::Handle(MakeFieldMetaName(field)), |
| 8045 token_pos); | 8051 token_pos); |
| 8046 } | 8052 } |
| 8047 | 8053 |
| (...skipping 10169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 18217 return "_MirrorReference"; | 18223 return "_MirrorReference"; |
| 18218 } | 18224 } |
| 18219 | 18225 |
| 18220 | 18226 |
| 18221 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { | 18227 void MirrorReference::PrintToJSONStream(JSONStream* stream, bool ref) const { |
| 18222 Instance::PrintToJSONStream(stream, ref); | 18228 Instance::PrintToJSONStream(stream, ref); |
| 18223 } | 18229 } |
| 18224 | 18230 |
| 18225 | 18231 |
| 18226 } // namespace dart | 18232 } // namespace dart |
| OLD | NEW |