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

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

Issue 891053004: Make Dart_Invoke work for private static functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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/resolver.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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 OS::Print("ResolveStatic error '%s': %s.\n", 215 OS::Print("ResolveStatic error '%s': %s.\n",
216 function_name.ToCString(), 216 function_name.ToCString(),
217 error_message.ToCString()); 217 error_message.ToCString());
218 } 218 }
219 return Function::null(); 219 return Function::null();
220 } 220 }
221 return function.raw(); 221 return function.raw();
222 } 222 }
223 223
224
225 RawFunction* Resolver::ResolveStaticAllowPrivate(const Class& cls,
226 const String& function_name,
227 intptr_t num_arguments,
228 const Array& argument_names) {
229 ASSERT(!cls.IsNull());
230 if (FLAG_trace_resolving) {
231 OS::Print("ResolveStaticAllowPrivate '%s'\n", function_name.ToCString());
232 }
233 const Function& function =
234 Function::Handle(cls.LookupStaticFunctionAllowPrivate(function_name));
235 if (function.IsNull() ||
236 !function.AreValidArguments(num_arguments, argument_names, NULL)) {
237 // Return a null function to signal to the upper levels to throw a
238 // resolution error or maybe throw the error right here.
239 if (FLAG_trace_resolving) {
240 String& error_message = String::Handle(String::New("function not found"));
241 if (!function.IsNull()) {
242 // Obtain more detailed error message.
243 function.AreValidArguments(num_arguments,
244 argument_names,
245 &error_message);
246 }
247 OS::Print("ResolveStaticAllowPrivate error '%s': %s.\n",
248 function_name.ToCString(),
249 error_message.ToCString());
250 }
251 return Function::null();
252 }
253 return function.raw();
254 }
255
224 } // namespace dart 256 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/resolver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698