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

Unified Diff: vm/dart_entry.h

Issue 11613009: Changed the API in DartEntry for invoking dart code from C++ to make it more compatible with the re… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vm/dart_api_impl.cc ('k') | vm/dart_entry.cc » ('j') | vm/dart_entry.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/dart_entry.h
===================================================================
--- vm/dart_entry.h (revision 16238)
+++ vm/dart_entry.h (working copy)
@@ -53,6 +53,10 @@
static RawArray* New(intptr_t count,
const Array& optional_arguments_names);
+ // Allocate and return an arguments descriptor that has no optional
+ // arguments. All arguments are positional.
+ static RawArray* New(intptr_t count);
+
private:
// Absolute indexes into the array.
enum {
@@ -86,30 +90,47 @@
// On success, returns a RawInstance. On failure, a RawError.
typedef RawObject* (*invokestub)(uword entry_point,
const Array& arguments_descriptor,
- const Object** arguments,
+ const Array& arguments,
const Context& context);
// Invokes the specified instance function on the receiver.
// On success, returns a RawInstance. On failure, a RawError.
- static RawObject* InvokeDynamic(
- const Instance& receiver,
+ // This is used when there are no named arguments in the call.
+ static RawObject* InvokeDynamic(const Function& function,
+ const Array& arguments);
+
+ // Invokes the specified instance function on the receiver.
+ // On success, returns a RawInstance. On failure, a RawError.
+ static RawObject* InvokeDynamicWithNamedArgs(
regis 2012/12/18 16:21:28 It's great not to have to pass the arguments descr
siva 2012/12/18 21:18:13 Agree, I have changed the name to just InvokeDynam
const Function& function,
- const GrowableArray<const Object*>& arguments,
- const Array& optional_arguments_names);
+ const Array& arguments_descriptor,
+ const Array& arguments);
// Invoke the specified static function.
// On success, returns a RawInstance. On failure, a RawError.
- static RawObject* InvokeStatic(
+ // This is used when there are no named arguments in the call.
+ static RawObject* InvokeStatic(const Function& function,
+ const Array& arguments);
+
+ // Invoke the specified static function.
+ // On success, returns a RawInstance. On failure, a RawError.
+ static RawObject* InvokeStaticWithNamedArgs(
regis 2012/12/18 16:21:28 Overload "InvokeStatic" and swap arguments?
siva 2012/12/18 21:18:13 Done.
const Function& function,
- const GrowableArray<const Object*>& arguments,
- const Array& optional_arguments_names);
+ const Array& arguments_descriptor,
+ const Array& arguments);
// Invoke the specified closure object.
// On success, returns a RawInstance. On failure, a RawError.
- static RawObject* InvokeClosure(
+ // This is used when there are no named arguments in the call.
+ static RawObject* InvokeClosure(const Instance& closure,
regis 2012/12/18 16:21:28 The closure is the first argument and does not nee
siva 2012/12/18 21:18:13 I thought about that too, but somehow felt it is m
regis 2012/12/18 21:34:46 Sure. It is definitely more readable to repeat the
+ const Array& arguments);
+
+ // Invoke the specified closure object.
+ // On success, returns a RawInstance. On failure, a RawError.
+ static RawObject* InvokeClosureWithNamedArgs(
regis 2012/12/18 16:21:28 Overload "InvokeClosure" and swap arguments?
siva 2012/12/18 21:18:13 Swapped the arguments but retained the closure par
const Instance& closure,
- const GrowableArray<const Object*>& arguments,
- const Array& optional_arguments_names);
+ const Array& arguments_descriptor,
+ const Array& arguments);
};
« no previous file with comments | « vm/dart_api_impl.cc ('k') | vm/dart_entry.cc » ('j') | vm/dart_entry.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698