| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 static RawInstance* CreateMirror(const String& mirror_class_name, | 29 static RawInstance* CreateMirror(const String& mirror_class_name, |
| 30 const Array& constructor_arguments) { | 30 const Array& constructor_arguments) { |
| 31 const Library& mirrors_lib = Library::Handle(Library::MirrorsLibrary()); | 31 const Library& mirrors_lib = Library::Handle(Library::MirrorsLibrary()); |
| 32 const String& constructor_name = Symbols::Dot(); | 32 const String& constructor_name = Symbols::Dot(); |
| 33 | 33 |
| 34 const Object& result = Object::Handle( | 34 const Object& result = Object::Handle( |
| 35 DartLibraryCalls::InstanceCreate(mirrors_lib, | 35 DartLibraryCalls::InstanceCreate(mirrors_lib, |
| 36 mirror_class_name, | 36 mirror_class_name, |
| 37 constructor_name, | 37 constructor_name, |
| 38 false, // Not a factory. |
| 38 constructor_arguments)); | 39 constructor_arguments)); |
| 39 ASSERT(!result.IsError()); | 40 ASSERT(!result.IsError()); |
| 40 return Instance::Cast(result).raw(); | 41 return Instance::Cast(result).raw(); |
| 41 } | 42 } |
| 42 | 43 |
| 43 | 44 |
| 44 // Conventions: | 45 // Conventions: |
| 45 // * For throwing a NSM in a class klass we use its runtime type as receiver, | 46 // * For throwing a NSM in a class klass we use its runtime type as receiver, |
| 46 // i.e., klass.RareType(). | 47 // i.e., klass.RareType(). |
| 47 // * For throwing a NSM in a library, we just pass the null instance as | 48 // * For throwing a NSM in a library, we just pass the null instance as |
| (...skipping 2049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2097 | 2098 |
| 2098 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { | 2099 DEFINE_NATIVE_ENTRY(TypeMirror_subtypeTest, 2) { |
| 2099 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 2100 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
| 2100 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 2101 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
| 2101 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); | 2102 return Bool::Get(a.IsSubtypeOf(b, NULL, NULL, Heap::kNew)).raw(); |
| 2102 } | 2103 } |
| 2103 | 2104 |
| 2104 #endif // !PRODUCT | 2105 #endif // !PRODUCT |
| 2105 | 2106 |
| 2106 } // namespace dart | 2107 } // namespace dart |
| OLD | NEW |