OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "include/dart_mirrors_api.h" | 5 #include "include/dart_mirrors_api.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/class_finalizer.h" | 8 #include "vm/class_finalizer.h" |
9 #include "vm/dart.h" | 9 #include "vm/dart.h" |
10 #include "vm/dart_api_impl.h" | 10 #include "vm/dart_api_impl.h" |
11 #include "vm/dart_api_state.h" | 11 #include "vm/dart_api_state.h" |
12 #include "vm/dart_entry.h" | 12 #include "vm/dart_entry.h" |
13 #include "vm/exceptions.h" | 13 #include "vm/exceptions.h" |
14 #include "vm/growable_array.h" | 14 #include "vm/growable_array.h" |
15 #include "vm/object.h" | 15 #include "vm/object.h" |
16 #include "vm/resolver.h" | 16 #include "vm/resolver.h" |
17 #include "vm/stack_frame.h" | 17 #include "vm/stack_frame.h" |
18 #include "vm/symbols.h" | 18 #include "vm/symbols.h" |
19 | 19 |
20 namespace dart { | 20 namespace dart { |
21 | 21 |
22 // Facilitate quick access to the current zone once we have the curren thread. | 22 // Facilitate quick access to the current zone once we have the current thread. |
23 #define Z (T->zone()) | 23 #define Z (T->zone()) |
24 | 24 |
25 | 25 |
26 // --- Classes and Interfaces Reflection --- | 26 // --- Classes and Interfaces Reflection --- |
27 | 27 |
28 DART_EXPORT Dart_Handle Dart_TypeName(Dart_Handle object) { | 28 DART_EXPORT Dart_Handle Dart_TypeName(Dart_Handle object) { |
29 DARTSCOPE(Thread::Current()); | 29 DARTSCOPE(Thread::Current()); |
30 const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object)); | 30 const Object& obj = Object::Handle(Z, Api::UnwrapHandle(object)); |
31 if (obj.IsType()) { | 31 if (obj.IsType()) { |
32 const Class& cls = Class::Handle(Type::Cast(obj).type_class()); | 32 const Class& cls = Class::Handle(Type::Cast(obj).type_class()); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 RETURN_TYPE_ERROR(Z, closure, Instance); | 349 RETURN_TYPE_ERROR(Z, closure, Instance); |
350 } | 350 } |
351 | 351 |
352 ASSERT(ClassFinalizer::AllClassesFinalized()); | 352 ASSERT(ClassFinalizer::AllClassesFinalized()); |
353 | 353 |
354 RawFunction* rf = Closure::Cast(closure_obj).function(); | 354 RawFunction* rf = Closure::Cast(closure_obj).function(); |
355 return Api::NewHandle(T, rf); | 355 return Api::NewHandle(T, rf); |
356 } | 356 } |
357 | 357 |
358 } // namespace dart | 358 } // namespace dart |
OLD | NEW |