summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/objspace/objspace_dump.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/ext/objspace/objspace_dump.c b/ext/objspace/objspace_dump.c
index c80c38eba4..8fd3d9d0f3 100644
--- a/ext/objspace/objspace_dump.c
+++ b/ext/objspace/objspace_dump.c
@@ -168,10 +168,8 @@ dump_append_c(struct dump_config *dc, unsigned char c)
}
static void
-dump_append_ref(struct dump_config *dc, VALUE ref)
+dump_append_ptr(struct dump_config *dc, VALUE ref)
{
- RUBY_ASSERT(ref > 0);
-
char buffer[roomof(sizeof(VALUE) * CHAR_BIT, 4) + rb_strlen_lit("\"0x\"")];
char *buffer_start, *buffer_end;
@@ -188,6 +186,14 @@ dump_append_ref(struct dump_config *dc, VALUE ref)
}
static void
+dump_append_ref(struct dump_config *dc, VALUE ref)
+{
+ RUBY_ASSERT(ref > 0);
+ dump_append_ptr(dc, ref);
+}
+
+
+static void
dump_append_string_value(struct dump_config *dc, VALUE obj)
{
long i;
@@ -441,6 +447,20 @@ dump_object(VALUE obj, struct dump_config *dc)
}
break;
+ case imemo_callcache:
+ mid = vm_cc_cme((const struct rb_callcache *)obj)->called_id;
+ if (mid != 0) {
+ dump_append(dc, ", \"called_id\":");
+ dump_append_string_value(dc, rb_id2str(mid));
+
+ VALUE klass = ((const struct rb_callcache *)obj)->klass;
+ if (klass != 0) {
+ dump_append(dc, ", \"receiver_class\":");
+ dump_append_ref(dc, klass);
+ }
+ }
+ break;
+
default:
break;
}