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

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

Issue 68103016: When ClassMirrors are created by enumerating members of a LibraryMirror, have the ClassMirror use t… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | 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/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/compiler.h" 8 #include "vm/compiler.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/exceptions.h" 10 #include "vm/exceptions.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 return CreateFunctionTypeMirror(cls, type); 343 return CreateFunctionTypeMirror(cls, type);
344 } else { 344 } else {
345 // We represent typedefs as non-canonical signature classes. 345 // We represent typedefs as non-canonical signature classes.
346 return CreateTypedefMirror(cls, type, is_declaration, owner_mirror); 346 return CreateTypedefMirror(cls, type, is_declaration, owner_mirror);
347 } 347 }
348 } 348 }
349 349
350 const Bool& is_generic = Bool::Get(cls.NumTypeParameters() != 0); 350 const Bool& is_generic = Bool::Get(cls.NumTypeParameters() != 0);
351 const Bool& is_mixin_app_alias = Bool::Get(cls.is_mixin_app_alias()); 351 const Bool& is_mixin_app_alias = Bool::Get(cls.is_mixin_app_alias());
352 352
353 const Array& args = Array::Handle(Array::New(6)); 353 const Array& args = Array::Handle(Array::New(7));
354 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(cls))); 354 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(cls)));
355 args.SetAt(1, type); 355 args.SetAt(1, type);
356 // We do not set the names of anonymous mixin applications because the mirrors 356 // We do not set the names of anonymous mixin applications because the mirrors
357 // use a different naming convention than the VM (lib.S with lib.M and S&M 357 // use a different naming convention than the VM (lib.S with lib.M and S&M
358 // respectively). 358 // respectively).
359 if (!cls.IsAnonymousMixinApplication()) { 359 if (!cls.IsAnonymousMixinApplication()) {
360 args.SetAt(2, String::Handle(cls.Name())); 360 args.SetAt(2, String::Handle(cls.Name()));
361 } 361 }
362 args.SetAt(3, is_generic); 362 args.SetAt(3, owner_mirror);
363 args.SetAt(4, is_mixin_app_alias); 363 args.SetAt(4, is_generic);
364 args.SetAt(5, cls.NumTypeParameters() == 0 ? Bool::False() : is_declaration); 364 args.SetAt(5, is_mixin_app_alias);
365 args.SetAt(6, cls.NumTypeParameters() == 0 ? Bool::False() : is_declaration);
365 return CreateMirror(Symbols::_LocalClassMirrorImpl(), args); 366 return CreateMirror(Symbols::_LocalClassMirrorImpl(), args);
366 } 367 }
367 368
368 369
369 static RawInstance* CreateLibraryMirror(const Library& lib) { 370 static RawInstance* CreateLibraryMirror(const Library& lib) {
370 const Array& args = Array::Handle(Array::New(3)); 371 const Array& args = Array::Handle(Array::New(3));
371 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(lib))); 372 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(lib)));
372 String& str = String::Handle(); 373 String& str = String::Handle();
373 str = lib.name(); 374 str = lib.name();
374 args.SetAt(1, str); 375 args.SetAt(1, str);
(...skipping 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1944 1945
1945 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) { 1946 DEFINE_NATIVE_ENTRY(VariableMirror_type, 2) {
1946 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); 1947 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0));
1947 const Field& field = Field::Handle(ref.GetFieldReferent()); 1948 const Field& field = Field::Handle(ref.GetFieldReferent());
1948 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1)); 1949 GET_NATIVE_ARGUMENT(AbstractType, instantiator, arguments->NativeArgAt(1));
1949 const AbstractType& type = AbstractType::Handle(field.type()); 1950 const AbstractType& type = AbstractType::Handle(field.type());
1950 return InstantiateType(type, instantiator); 1951 return InstantiateType(type, instantiator);
1951 } 1952 }
1952 1953
1953 } // namespace dart 1954 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698