Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: runtime/vm/resolver.cc

Issue 135123011: Introduce cache of resolved names in library (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698