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

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

Issue 24005002: Make TypedefMirror a direct descendant of TypeMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | runtime/lib/mirrors_impl.dart » ('J')
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/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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 411
412 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalMirrorSystem, 0) { 412 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalMirrorSystem, 0) {
413 return CreateMirrorSystem(); 413 return CreateMirrorSystem();
414 } 414 }
415 415
416 416
417 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalClassMirror, 1) { 417 DEFINE_NATIVE_ENTRY(Mirrors_makeLocalClassMirror, 1) {
418 GET_NON_NULL_NATIVE_ARGUMENT(Type, type, arguments->NativeArgAt(0)); 418 GET_NON_NULL_NATIVE_ARGUMENT(Type, type, arguments->NativeArgAt(0));
419 const Class& cls = Class::Handle(type.type_class()); 419 const Class& cls = Class::Handle(type.type_class());
420 ASSERT(!cls.IsNull()); 420 ASSERT(!cls.IsNull());
421 if (cls.IsDynamicClass() || cls.IsVoidClass()) { 421 if (cls.IsDynamicClass() ||
422 cls.IsVoidClass() ||
423 (cls.IsSignatureClass() && !cls.IsCanonicalSignatureClass())) {
424 // dynamic, void or a function typedef.
422 const Array& args = Array::Handle(Array::New(1)); 425 const Array& args = Array::Handle(Array::New(1));
423 args.SetAt(0, type); 426 args.SetAt(0, type);
424 Exceptions::ThrowByType(Exceptions::kArgument, args); 427 Exceptions::ThrowByType(Exceptions::kArgument, args);
425 UNREACHABLE(); 428 UNREACHABLE();
426 } 429 }
427 // Strip the type for generics only. 430 // Strip the type for generics only.
428 if (cls.NumTypeParameters() == 0) { 431 if (cls.NumTypeParameters() == 0) {
429 return CreateClassMirror(cls, 432 return CreateClassMirror(cls,
430 type, 433 type,
431 Object::null_instance()); 434 Object::null_instance());
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after
1444 } 1447 }
1445 1448
1446 1449
1447 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) { 1450 DEFINE_NATIVE_ENTRY(VariableMirror_type, 1) {
1448 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0)); 1451 GET_NON_NULL_NATIVE_ARGUMENT(MirrorReference, ref, arguments->NativeArgAt(0));
1449 const Field& field = Field::Handle(ref.GetFieldReferent()); 1452 const Field& field = Field::Handle(ref.GetFieldReferent());
1450 return field.type(); 1453 return field.type();
1451 } 1454 }
1452 1455
1453 } // namespace dart 1456 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/lib/mirrors_impl.dart » ('j') | runtime/lib/mirrors_impl.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698