Created
January 23, 2010 21:12
-
-
Save jballanc/284793 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/dispatcher.cpp b/dispatcher.cpp | |
index 3eca605..612f697 100644 | |
--- a/dispatcher.cpp | |
+++ b/dispatcher.cpp | |
@@ -18,7 +18,7 @@ | |
#include <execinfo.h> | |
#include <dlfcn.h> | |
-#define ROXOR_VM_DEBUG 0 | |
+#define ROXOR_VM_DEBUG 1 | |
#define MAX_DISPATCH_ARGS 100 | |
static force_inline void | |
@@ -395,6 +395,9 @@ __rb_vm_ruby_dispatch(VALUE top, VALUE self, SEL sel, | |
rb_vm_method_node_t *node, unsigned char opt, | |
int argc, const VALUE *argv) | |
{ | |
+#if ROXOR_VM_DEBUG | |
+ printf("dispatching a method: top=%p, node->klass=%p\n", (void *)top, (void *)node->klass); | |
+#endif | |
const rb_vm_arity_t &arity = node->arity; | |
if ((argc < arity.min) || ((arity.max != -1) && (argc > arity.max))) { | |
rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)", | |
@@ -724,11 +727,12 @@ dispatch: | |
} | |
#if ROXOR_VM_DEBUG | |
- printf("ruby dispatch %c[<%s %p> %s] (imp %p block %p argc %d opt %d cached %s)\n", | |
+ printf("ruby dispatch %c[<%s %p> %s] (klass %p imp %p block %p argc %d opt %d cached %s)\n", | |
class_isMetaClass(klass) ? '+' : '-', | |
class_getName(klass), | |
(void *)self, | |
sel_getName(sel), | |
+ rcache.node->klass, | |
rcache.node->ruby_imp, | |
block, | |
argc, | |
@@ -773,6 +777,10 @@ dispatch: | |
MACRUBY_METHOD_ENTRY(class_name, method_name, file, line); | |
} | |
+#if ROXOR_VM_DEBUG | |
+ printf("calling __rb_vm_ruby_dispatch: top=%p, node->klass=%p\n", (void *)top, (void *)rcache.node->klass); | |
+#endif | |
+ | |
VALUE v = __rb_vm_ruby_dispatch(top, self, sel, rcache.node, opt, | |
argc, argv); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment