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/mirrors.h" | 5 #include "lib/mirrors.h" |
6 | 6 |
7 #include "lib/invocation_mirror.h" | 7 #include "lib/invocation_mirror.h" |
8 #include "vm/bootstrap_natives.h" | 8 #include "vm/bootstrap_natives.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 args.SetAt(4, Bool::Get(cls.is_abstract())); | 348 args.SetAt(4, Bool::Get(cls.is_abstract())); |
349 args.SetAt(5, Bool::Get(cls.IsGeneric())); | 349 args.SetAt(5, Bool::Get(cls.IsGeneric())); |
350 args.SetAt(6, Bool::Get(cls.is_mixin_app_alias())); | 350 args.SetAt(6, Bool::Get(cls.is_mixin_app_alias())); |
351 args.SetAt(7, cls.NumTypeParameters() == 0 ? Bool::False() : is_declaration); | 351 args.SetAt(7, cls.NumTypeParameters() == 0 ? Bool::False() : is_declaration); |
352 args.SetAt(8, Bool::Get(cls.is_enum_class())); | 352 args.SetAt(8, Bool::Get(cls.is_enum_class())); |
353 return CreateMirror(Symbols::_LocalClassMirror(), args); | 353 return CreateMirror(Symbols::_LocalClassMirror(), args); |
354 } | 354 } |
355 | 355 |
356 | 356 |
357 static RawInstance* CreateLibraryMirror(const Library& lib) { | 357 static RawInstance* CreateLibraryMirror(const Library& lib) { |
| 358 ASSERT(!lib.IsNull()); |
358 const Array& args = Array::Handle(Array::New(3)); | 359 const Array& args = Array::Handle(Array::New(3)); |
359 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(lib))); | 360 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(lib))); |
360 String& str = String::Handle(); | 361 String& str = String::Handle(); |
361 str = lib.name(); | 362 str = lib.name(); |
362 args.SetAt(1, str); | 363 args.SetAt(1, str); |
363 str = lib.url(); | 364 str = lib.url(); |
364 if (str.Equals("dart:_builtin") || str.Equals("dart:_blink")) { | 365 if (str.Equals("dart:_builtin") || str.Equals("dart:_blink")) { |
365 // Censored library (grumble). | 366 // Censored library (grumble). |
366 return Instance::null(); | 367 return Instance::null(); |
367 } | 368 } |
(...skipping 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2033 } | 2034 } |
2034 | 2035 |
2035 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) { | 2036 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) { |
2036 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2037 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
2037 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2038 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
2038 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw(); | 2039 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw(); |
2039 } | 2040 } |
2040 | 2041 |
2041 | 2042 |
2042 } // namespace dart | 2043 } // namespace dart |
OLD | NEW |