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 #ifndef VM_RESOLVER_H_ | 5 #ifndef VM_RESOLVER_H_ |
6 #define VM_RESOLVER_H_ | 6 #define VM_RESOLVER_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 // Resolver abstracts functionality needed to resolve dart functions at | 22 // Resolver abstracts functionality needed to resolve dart functions at |
23 // invocations. | 23 // invocations. |
24 class Resolver : public AllStatic { | 24 class Resolver : public AllStatic { |
25 public: | 25 public: |
26 // Resolve specified dart instance function. | 26 // Resolve specified dart instance function. |
27 static RawFunction* ResolveDynamic(const Instance& receiver, | 27 static RawFunction* ResolveDynamic(const Instance& receiver, |
28 const String& function_name, | 28 const String& function_name, |
29 const ArgumentsDescriptor& args_desc); | 29 const ArgumentsDescriptor& args_desc); |
30 | 30 |
| 31 // If 'allow_add' is true we may add a function to the class during lookup. |
31 static RawFunction* ResolveDynamicForReceiverClass( | 32 static RawFunction* ResolveDynamicForReceiverClass( |
32 const Class& receiver_class, | 33 const Class& receiver_class, |
33 const String& function_name, | 34 const String& function_name, |
34 const ArgumentsDescriptor& args_desc); | 35 const ArgumentsDescriptor& args_desc, |
| 36 bool allow_add = true); |
35 | 37 |
| 38 // If 'allow_add' is true we may add a function to the class during lookup. |
36 static RawFunction* ResolveDynamicAnyArgs( | 39 static RawFunction* ResolveDynamicAnyArgs( |
37 const Class& receiver_class, | 40 const Class& receiver_class, |
38 const String& function_name); | 41 const String& function_name, |
| 42 bool allow_add = true); |
39 | 43 |
40 // Resolve specified dart static function. If library.IsNull, use | 44 // Resolve specified dart static function. If library.IsNull, use |
41 // either application library or core library if no application library | 45 // either application library or core library if no application library |
42 // exists. Passing negative num_arguments means that the function | 46 // exists. Passing negative num_arguments means that the function |
43 // will be resolved by name only. | 47 // will be resolved by name only. |
44 // Otherwise null is returned if the number or names of arguments are not | 48 // Otherwise null is returned if the number or names of arguments are not |
45 // valid for the resolved function. | 49 // valid for the resolved function. |
46 static RawFunction* ResolveStatic(const Library& library, | 50 static RawFunction* ResolveStatic(const Library& library, |
47 const String& cls_name, | 51 const String& cls_name, |
48 const String& function_name, | 52 const String& function_name, |
(...skipping 11 matching lines...) Expand all Loading... |
60 // public and private functions. | 64 // public and private functions. |
61 static RawFunction* ResolveStaticAllowPrivate(const Class& cls, | 65 static RawFunction* ResolveStaticAllowPrivate(const Class& cls, |
62 const String& function_name, | 66 const String& function_name, |
63 intptr_t num_arguments, | 67 intptr_t num_arguments, |
64 const Array& argument_names); | 68 const Array& argument_names); |
65 }; | 69 }; |
66 | 70 |
67 } // namespace dart | 71 } // namespace dart |
68 | 72 |
69 #endif // VM_RESOLVER_H_ | 73 #endif // VM_RESOLVER_H_ |
OLD | NEW |