| 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 "lib/invocation_mirror.h" | 5 #include "lib/invocation_mirror.h" |
| 6 #include "vm/bootstrap_natives.h" | 6 #include "vm/bootstrap_natives.h" |
| 7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/exceptions.h" | 9 #include "vm/exceptions.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 // represents the declaration or a non-null runtime type if it represents an | 315 // represents the declaration or a non-null runtime type if it represents an |
| 316 // instantiation. | 316 // instantiation. |
| 317 ASSERT(!(cls.NumTypeParameters() == 0) || !type.IsNull()); | 317 ASSERT(!(cls.NumTypeParameters() == 0) || !type.IsNull()); |
| 318 | 318 |
| 319 const Array& args = Array::Handle(Array::New(5)); | 319 const Array& args = Array::Handle(Array::New(5)); |
| 320 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(cls))); | 320 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(cls))); |
| 321 args.SetAt(1, type); | 321 args.SetAt(1, type); |
| 322 // We do not set the names of anonymous mixin applications because the mirrors | 322 // We do not set the names of anonymous mixin applications because the mirrors |
| 323 // use a different naming convention than the VM (lib.S with lib.M and S&M | 323 // use a different naming convention than the VM (lib.S with lib.M and S&M |
| 324 // respectively). | 324 // respectively). |
| 325 if ((cls.mixin() == Type::null()) || cls.is_mixin_typedef()) { | 325 if (!cls.IsMixinApplication() || cls.is_mixin_typedef()) { |
| 326 args.SetAt(2, String::Handle(cls.UserVisibleName())); | 326 args.SetAt(2, String::Handle(cls.UserVisibleName())); |
| 327 } | 327 } |
| 328 args.SetAt(3, is_generic); | 328 args.SetAt(3, is_generic); |
| 329 args.SetAt(4, is_mixin_typedef); | 329 args.SetAt(4, is_mixin_typedef); |
| 330 return CreateMirror(Symbols::_LocalClassMirrorImpl(), args); | 330 return CreateMirror(Symbols::_LocalClassMirrorImpl(), args); |
| 331 } | 331 } |
| 332 | 332 |
| 333 | 333 |
| 334 static RawInstance* CreateLibraryMirror(const Library& lib) { | 334 static RawInstance* CreateLibraryMirror(const Library& lib) { |
| 335 const Array& args = Array::Handle(Array::New(3)); | 335 const Array& args = Array::Handle(Array::New(3)); |
| (...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1444 } | 1444 } |
| 1445 | 1445 |
| 1446 | 1446 |
| 1447 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { | 1447 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { |
| 1448 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); | 1448 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); |
| 1449 const Field& field = Field::Handle(ref.GetFieldReferent()); | 1449 const Field& field = Field::Handle(ref.GetFieldReferent()); |
| 1450 return field.type(); | 1450 return field.type(); |
| 1451 } | 1451 } |
| 1452 | 1452 |
| 1453 } // namespace dart | 1453 } // namespace dart |
| OLD | NEW |