[macruby-changes] [935] MacRuby/branches/experimental/roxor.cpp
source_changes at macosforge.org
source_changes at macosforge.org
Sun Mar 15 23:14:33 PDT 2009
Revision: 935
http://trac.macosforge.org/projects/ruby/changeset/935
Author: lsansonetti at apple.com
Date: 2009-03-15 23:14:33 -0700 (Sun, 15 Mar 2009)
Log Message:
-----------
increased the MAX_DISPATCH_ARGS + added some comments about future work
Modified Paths:
--------------
MacRuby/branches/experimental/roxor.cpp
Modified: MacRuby/branches/experimental/roxor.cpp
===================================================================
--- MacRuby/branches/experimental/roxor.cpp 2009-03-16 06:13:59 UTC (rev 934)
+++ MacRuby/branches/experimental/roxor.cpp 2009-03-16 06:14:33 UTC (rev 935)
@@ -4148,8 +4148,10 @@
}
static inline VALUE
-__rb_vm_rcall(VALUE self, NODE *node, IMP pimp, const node_arity &arity, int argc, const VALUE *argv)
+__rb_vm_rcall(VALUE self, NODE *node, IMP pimp, const node_arity &arity,
+ int argc, const VALUE *argv)
{
+ // TODO investigate why this function is not inlined!
if ((arity.real != argc) || (arity.max == -1)) {
VALUE *new_argv = (VALUE *)alloca(sizeof(VALUE) * arity.real);
assert(argc >= arity.min);
@@ -4507,9 +4509,14 @@
rb_vm_dispatch(struct mcache *cache, VALUE self, SEL sel, void *block,
unsigned char super, int argc, ...)
{
-#define MAX_DISPATCH_ARGS 100
+#define MAX_DISPATCH_ARGS 200
VALUE argv[MAX_DISPATCH_ARGS];
if (argc > 0) {
+ // TODO we should only determine the real argc here (by taking into
+ // account the length splat arguments) and do the real unpacking of
+ // splat arguments in __rb_vm_rcall(). This way we can optimize more
+ // things (for ex. no need to unpack splats that are passed as a splat
+ // argument in the method being called!).
va_list ar;
va_start(ar, argc);
int i, real_argc = 0;
@@ -4522,7 +4529,8 @@
}
else {
if (splat_arg_follows) {
- VALUE ary = rb_check_convert_type(arg, T_ARRAY, "Array", "to_a");
+ VALUE ary = rb_check_convert_type(arg, T_ARRAY, "Array",
+ "to_a");
if (NIL_P(ary)) {
ary = rb_ary_new3(1, arg);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090315/b934ceb4/attachment.html>
More information about the macruby-changes
mailing list