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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 } | 263 } |
264 | 264 |
265 | 265 |
266 static RawInstance* CreateMethodMirror(const Function& func, | 266 static RawInstance* CreateMethodMirror(const Function& func, |
267 const Instance& owner_mirror, | 267 const Instance& owner_mirror, |
268 const AbstractType& instantiator) { | 268 const AbstractType& instantiator) { |
269 const Array& args = Array::Handle(Array::New(6)); | 269 const Array& args = Array::Handle(Array::New(6)); |
270 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(func))); | 270 args.SetAt(0, MirrorReference::Handle(MirrorReference::New(func))); |
271 | 271 |
272 String& name = String::Handle(func.name()); | 272 String& name = String::Handle(func.name()); |
273 name = String::IdentifierPrettyNameRetainPrivate(name); | 273 name = String::ScrubNameRetainPrivate(name); |
274 args.SetAt(1, name); | 274 args.SetAt(1, name); |
275 args.SetAt(2, owner_mirror); | 275 args.SetAt(2, owner_mirror); |
276 args.SetAt(3, instantiator); | 276 args.SetAt(3, instantiator); |
277 args.SetAt(4, Bool::Get(func.is_static())); | 277 args.SetAt(4, Bool::Get(func.is_static())); |
278 | 278 |
279 intptr_t kind_flags = 0; | 279 intptr_t kind_flags = 0; |
280 kind_flags |= (func.is_abstract() << Mirrors::kAbstract); | 280 kind_flags |= (func.is_abstract() << Mirrors::kAbstract); |
281 kind_flags |= (func.IsGetterFunction() << Mirrors::kGetter); | 281 kind_flags |= (func.IsGetterFunction() << Mirrors::kGetter); |
282 kind_flags |= (func.IsSetterFunction() << Mirrors::kSetter); | 282 kind_flags |= (func.IsSetterFunction() << Mirrors::kSetter); |
283 bool is_ctor = (func.kind() == RawFunction::kConstructor); | 283 bool is_ctor = (func.kind() == RawFunction::kConstructor); |
(...skipping 1802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2086 | 2086 |
2087 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { | 2087 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { |
2088 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2088 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
2089 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2089 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
2090 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); | 2090 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); |
2091 } | 2091 } |
2092 | 2092 |
2093 #endif // !PRODUCT | 2093 #endif // !PRODUCT |
2094 | 2094 |
2095 } // namespace dart | 2095 } // namespace dart |
OLD | NEW |