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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
439 } | 439 } |
440 | 440 |
441 Object& metadata = Object::Handle(ns.GetMetadata()); | 441 Object& metadata = Object::Handle(ns.GetMetadata()); |
442 if (metadata.IsError()) { | 442 if (metadata.IsError()) { |
443 Exceptions::PropagateError(Error::Cast(metadata)); | 443 Exceptions::PropagateError(Error::Cast(metadata)); |
444 UNREACHABLE(); | 444 UNREACHABLE(); |
445 } | 445 } |
446 | 446 |
447 const Array& args = Array::Handle(Array::New(7)); | 447 const Array& args = Array::Handle(Array::New(7)); |
448 args.SetAt(0, importer); | 448 args.SetAt(0, importer); |
449 args.SetAt(1, importee.Loaded() ? importee_mirror : prefix); | 449 if (importee.Loaded() || prefix.IsNull()) { |
450 // A native extension is not "loaded", but doesn't have a deferred prefix. | |
siva
2017/03/17 21:07:05
The comment here seems opposite to the condition i
rmacnak
2017/03/17 22:03:31
The first half of the condition gets eagerly loade
| |
451 // It will appear like an empty library. | |
452 args.SetAt(1, importee_mirror); | |
453 } else { | |
454 args.SetAt(1, prefix); | |
455 } | |
450 args.SetAt(2, combinators); | 456 args.SetAt(2, combinators); |
451 args.SetAt(3, prefix.IsNull() ? Object::null_object() | 457 args.SetAt(3, prefix.IsNull() ? Object::null_object() |
452 : String::Handle(prefix.name())); | 458 : String::Handle(prefix.name())); |
453 args.SetAt(4, Bool::Get(is_import)); | 459 args.SetAt(4, Bool::Get(is_import)); |
454 args.SetAt(5, Bool::Get(is_deferred)); | 460 args.SetAt(5, Bool::Get(is_deferred)); |
455 args.SetAt(6, metadata); | 461 args.SetAt(6, metadata); |
456 return CreateMirror(Symbols::_LocalLibraryDependencyMirror(), args); | 462 return CreateMirror(Symbols::_LocalLibraryDependencyMirror(), args); |
457 } | 463 } |
458 | 464 |
459 | 465 |
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2087 | 2093 |
2088 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { | 2094 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { |
2089 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2095 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
2090 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2096 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
2091 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); | 2097 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); |
2092 } | 2098 } |
2093 | 2099 |
2094 #endif // !PRODUCT && !DART_PRECOMPILED_RUNTIME | 2100 #endif // !PRODUCT && !DART_PRECOMPILED_RUNTIME |
2095 | 2101 |
2096 } // namespace dart | 2102 } // namespace dart |
OLD | NEW |