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/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 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 // runtime type of null is the Null type, which we correctly return here. | 1353 // runtime type of null is the Null type, which we correctly return here. |
1354 return type.Canonicalize(); | 1354 return type.Canonicalize(); |
1355 } | 1355 } |
1356 | 1356 |
1357 | 1357 |
1358 DEFINE_NATIVE_ENTRY(ClosureMirror_function, 1) { | 1358 DEFINE_NATIVE_ENTRY(ClosureMirror_function, 1) { |
1359 GET_NON_NULL_NATIVE_ARGUMENT(Instance, closure, arguments->NativeArgAt(0)); | 1359 GET_NON_NULL_NATIVE_ARGUMENT(Instance, closure, arguments->NativeArgAt(0)); |
1360 ASSERT(!closure.IsNull()); | 1360 ASSERT(!closure.IsNull()); |
1361 | 1361 |
1362 Function& function = Function::Handle(); | 1362 Function& function = Function::Handle(); |
1363 bool callable = closure.IsCallable(&function, NULL); | 1363 bool callable = closure.IsCallable(&function); |
1364 if (callable) { | 1364 if (callable) { |
1365 return CreateMethodMirror(function, Instance::null_instance()); | 1365 return CreateMethodMirror(function, Instance::null_instance()); |
1366 } | 1366 } |
1367 return Instance::null(); | 1367 return Instance::null(); |
1368 } | 1368 } |
1369 | 1369 |
1370 | 1370 |
1371 DEFINE_NATIVE_ENTRY(ClassMirror_invoke, 5) { | 1371 DEFINE_NATIVE_ENTRY(ClassMirror_invoke, 5) { |
1372 // Argument 0 is the mirror, which is unused by the native. It exists | 1372 // Argument 0 is the mirror, which is unused by the native. It exists |
1373 // because this native is an instance method in order to be polymorphic | 1373 // because this native is an instance method in order to be polymorphic |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1962 } | 1962 } |
1963 | 1963 |
1964 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) { | 1964 DEFINE_NATIVE_ENTRY(TypeMirror_moreSpecificTest, 2) { |
1965 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); | 1965 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, a, arguments->NativeArgAt(0)); |
1966 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); | 1966 GET_NON_NULL_NATIVE_ARGUMENT(AbstractType, b, arguments->NativeArgAt(1)); |
1967 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw(); | 1967 return Bool::Get(a.IsMoreSpecificThan(b, NULL)).raw(); |
1968 } | 1968 } |
1969 | 1969 |
1970 | 1970 |
1971 } // namespace dart | 1971 } // namespace dart |
OLD | NEW |