* gc.c (obj_info): obj_info() can receive internal objects.

* gc.c (check_rvalue_consistency): obj_info() returns const char *.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2015-03-20 03:41:10 +00:00
Родитель 828453ab36
Коммит a38a1fbcc2
3 изменённых файлов: 22 добавлений и 15 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Fri Mar 20 12:38:36 2015 Koichi Sasada <ko1@atdot.net>
* gc.c (obj_info): obj_info() can receive internal objects.
* gc.c (check_rvalue_consistency): obj_info() returns const char *.
Fri Mar 20 12:14:37 2015 Koichi Sasada <ko1@atdot.net>
* gc.c (obj_info): show class name and T_DATA type_name.

17
gc.c
Просмотреть файл

@ -998,8 +998,8 @@ check_rvalue_consistency(const VALUE obj)
const int marking_bit = RVALUE_MARKING_BITMAP(obj) != 0, remembered_bit = marking_bit;
const int age = RVALUE_FLAGS_AGE(RBASIC(obj)->flags);
if (BUILTIN_TYPE(obj) == T_NONE) rb_bug("check_rvalue_consistency: %p is T_NONE", obj_info(obj));
if (BUILTIN_TYPE(obj) == T_ZOMBIE) rb_bug("check_rvalue_consistency: %p is T_ZOMBIE", obj_info(obj));
if (BUILTIN_TYPE(obj) == T_NONE) rb_bug("check_rvalue_consistency: %s is T_NONE", obj_info(obj));
if (BUILTIN_TYPE(obj) == T_ZOMBIE) rb_bug("check_rvalue_consistency: %s is T_ZOMBIE", obj_info(obj));
obj_memsize_of((VALUE)obj, FALSE);
/* check generation
@ -8817,13 +8817,11 @@ obj_info(VALUE obj)
C(RVALUE_WB_UNPROTECTED_BITMAP(obj), "U"),
obj_type_name(obj));
switch (type) {
case T_NODE:
case T_IMEMO:
break;
default:
if (RBASIC(obj)->klass == 0) {
snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s (internal)", buff);
if (internal_object_p(obj)) {
/* ignore */
}
else if (RBASIC(obj)->klass == 0) {
snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s (temporary internal)", buff);
}
else {
VALUE class_path = rb_class_path_cached(RBASIC(obj)->klass);
@ -8831,7 +8829,6 @@ obj_info(VALUE obj)
snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s (%s)", buff, RSTRING_PTR(class_path));
}
}
}
#if GC_DEBUG
snprintf(buff, OBJ_INFO_BUFFERS_SIZE, "%s @%s:%d", buff, RANY(obj)->file, RANY(obj)->line);

4
vm.c
Просмотреть файл

@ -1492,6 +1492,10 @@ vm_exec(rb_thread_t *th)
case VM_FRAME_MAGIC_LAMBDA:
EXEC_EVENT_HOOK_AND_POP_FRAME(th, RUBY_EVENT_B_RETURN, th->cfp->self, 0, 0, Qnil);
break;
case VM_FRAME_MAGIC_METHOD:
RUBY_DTRACE_METHOD_RETURN_HOOK(th, 0, 0);
EXEC_EVENT_HOOK_AND_POP_FRAME(th, RUBY_EVENT_RETURN, th->cfp->self, 0, 0, Qnil);
break;
}
vm_pop_frame(th);