| 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/resolver.h" | 5 #include "vm/resolver.h" |
| 6 | 6 |
| 7 #include "vm/dart_entry.h" | 7 #include "vm/dart_entry.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 RawFunction* Resolver::ResolveStatic(const Library& library, | 144 RawFunction* Resolver::ResolveStatic(const Library& library, |
| 145 const String& class_name, | 145 const String& class_name, |
| 146 const String& function_name, | 146 const String& function_name, |
| 147 intptr_t num_arguments, | 147 intptr_t num_arguments, |
| 148 const Array& argument_names) { | 148 const Array& argument_names) { |
| 149 ASSERT(!library.IsNull()); | 149 ASSERT(!library.IsNull()); |
| 150 Function& function = Function::Handle(); | 150 Function& function = Function::Handle(); |
| 151 if (class_name.IsNull() || (class_name.Length() == 0)) { | 151 if (class_name.IsNull() || (class_name.Length() == 0)) { |
| 152 // Check if we are referring to a top level function. | 152 // Check if we are referring to a top level function. |
| 153 const Object& object = Object::Handle(library.LookupObject(function_name)); | 153 const Object& object = Object::Handle(library.ResolveName(function_name)); |
| 154 if (!object.IsNull() && object.IsFunction()) { | 154 if (!object.IsNull() && object.IsFunction()) { |
| 155 function ^= object.raw(); | 155 function ^= object.raw(); |
| 156 if (!function.AreValidArguments(num_arguments, argument_names, NULL)) { | 156 if (!function.AreValidArguments(num_arguments, argument_names, NULL)) { |
| 157 if (FLAG_trace_resolving) { | 157 if (FLAG_trace_resolving) { |
| 158 String& error_message = String::Handle(); | 158 String& error_message = String::Handle(); |
| 159 // Obtain more detailed error message. | 159 // Obtain more detailed error message. |
| 160 function.AreValidArguments(num_arguments, | 160 function.AreValidArguments(num_arguments, |
| 161 argument_names, | 161 argument_names, |
| 162 &error_message); | 162 &error_message); |
| 163 OS::Print("ResolveStatic error '%s': %s.\n", | 163 OS::Print("ResolveStatic error '%s': %s.\n", |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 OS::Print("ResolveStatic error '%s': %s.\n", | 218 OS::Print("ResolveStatic error '%s': %s.\n", |
| 219 function_name.ToCString(), | 219 function_name.ToCString(), |
| 220 error_message.ToCString()); | 220 error_message.ToCString()); |
| 221 } | 221 } |
| 222 return Function::null(); | 222 return Function::null(); |
| 223 } | 223 } |
| 224 return function.raw(); | 224 return function.raw(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 } // namespace dart | 227 } // namespace dart |
| OLD | NEW |