Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1100)

Side by Side Diff: runtime/lib/mirrors.cc

Issue 2758003002: Fix LibraryDependencyMirrors when the target is a native extension. (Closed)
Patch Set: . Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 never "loaded" by the embedder. Use the fact that
451 // it doesn't have an prefix where asa deferred import does to distinguish
452 // it from a deferred import. It will appear like an empty library.
453 args.SetAt(1, importee_mirror);
454 } else {
455 args.SetAt(1, prefix);
456 }
450 args.SetAt(2, combinators); 457 args.SetAt(2, combinators);
451 args.SetAt(3, prefix.IsNull() ? Object::null_object() 458 args.SetAt(3, prefix.IsNull() ? Object::null_object()
452 : String::Handle(prefix.name())); 459 : String::Handle(prefix.name()));
453 args.SetAt(4, Bool::Get(is_import)); 460 args.SetAt(4, Bool::Get(is_import));
454 args.SetAt(5, Bool::Get(is_deferred)); 461 args.SetAt(5, Bool::Get(is_deferred));
455 args.SetAt(6, metadata); 462 args.SetAt(6, metadata);
456 return CreateMirror(Symbols::_LocalLibraryDependencyMirror(), args); 463 return CreateMirror(Symbols::_LocalLibraryDependencyMirror(), args);
457 } 464 }
458 465
459 466
(...skipping 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after
2087 2094
2088 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { 2095 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) {
2089 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); 2096 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0));
2090 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); 2097 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1));
2091 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); 2098 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw();
2092 } 2099 }
2093 2100
2094 #endif // !PRODUCT && !DART_PRECOMPILED_RUNTIME 2101 #endif // !PRODUCT && !DART_PRECOMPILED_RUNTIME
2095 2102
2096 } // namespace dart 2103 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698