| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/bootstrap_natives.h" | 5 #include "vm/bootstrap_natives.h" |
| 6 | 6 |
| 7 #include "lib/invocation_mirror.h" |
| 7 #include "vm/exceptions.h" | 8 #include "vm/exceptions.h" |
| 8 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 9 #include "vm/native_entry.h" | 10 #include "vm/native_entry.h" |
| 10 #include "vm/object.h" | 11 #include "vm/object.h" |
| 11 #include "vm/stack_frame.h" | 12 #include "vm/stack_frame.h" |
| 12 #include "vm/symbols.h" | 13 #include "vm/symbols.h" |
| 13 | 14 |
| 14 namespace dart { | 15 namespace dart { |
| 15 | 16 |
| 16 DECLARE_FLAG(bool, enable_type_checks); | 17 DECLARE_FLAG(bool, enable_type_checks); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 GET_NON_NULL_NATIVE_ARGUMENT(Instance, func_args, arguments->NativeArgAt(4)); | 55 GET_NON_NULL_NATIVE_ARGUMENT(Instance, func_args, arguments->NativeArgAt(4)); |
| 55 GET_NON_NULL_NATIVE_ARGUMENT( | 56 GET_NON_NULL_NATIVE_ARGUMENT( |
| 56 Instance, func_named_args, arguments->NativeArgAt(5)); | 57 Instance, func_named_args, arguments->NativeArgAt(5)); |
| 57 const Array& dart_arguments = Array::Handle(Array::New(6)); | 58 const Array& dart_arguments = Array::Handle(Array::New(6)); |
| 58 dart_arguments.SetAt(0, instance); | 59 dart_arguments.SetAt(0, instance); |
| 59 dart_arguments.SetAt(1, member_name); | 60 dart_arguments.SetAt(1, member_name); |
| 60 dart_arguments.SetAt(2, invocation_type); | 61 dart_arguments.SetAt(2, invocation_type); |
| 61 dart_arguments.SetAt(3, func_args); | 62 dart_arguments.SetAt(3, func_args); |
| 62 dart_arguments.SetAt(4, func_named_args); | 63 dart_arguments.SetAt(4, func_named_args); |
| 63 | 64 |
| 64 if (is_method.value()) { | 65 if (is_method.value() && |
| 66 (((invocation_type.Value() >> InvocationMirror::kCallShift) & |
| 67 InvocationMirror::kCallMask) != InvocationMirror::kSuper)) { |
| 65 // Report if a function with same name (but different arguments) has been | 68 // Report if a function with same name (but different arguments) has been |
| 66 // found. | 69 // found. |
| 67 Function& function = Function::Handle(); | 70 Function& function = Function::Handle(); |
| 68 if (instance.IsClosure()) { | 71 if (instance.IsClosure()) { |
| 69 function = Closure::function(instance); | 72 function = Closure::function(instance); |
| 70 } else { | 73 } else { |
| 71 Class& instance_class = Class::Handle(instance.clazz()); | 74 Class& instance_class = Class::Handle(instance.clazz()); |
| 72 function = instance_class.LookupDynamicFunction(member_name); | 75 function = instance_class.LookupDynamicFunction(member_name); |
| 73 while (function.IsNull()) { | 76 while (function.IsNull()) { |
| 74 instance_class = instance_class.SuperClass(); | 77 instance_class = instance_class.SuperClass(); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 } | 220 } |
| 218 | 221 |
| 219 | 222 |
| 220 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) { | 223 DEFINE_NATIVE_ENTRY(AbstractType_toString, 1) { |
| 221 const AbstractType& type = | 224 const AbstractType& type = |
| 222 AbstractType::CheckedHandle(arguments->NativeArgAt(0)); | 225 AbstractType::CheckedHandle(arguments->NativeArgAt(0)); |
| 223 return type.UserVisibleName(); | 226 return type.UserVisibleName(); |
| 224 } | 227 } |
| 225 | 228 |
| 226 } // namespace dart | 229 } // namespace dart |
| OLD | NEW |