* gc.c (rb_raw_obj_info): fix trivial issues.

* support SPECIAL_CONSTs.
  * fix IMEMO/ment outputs.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2015-11-18 08:08:09 +00:00
parent 40b0dd1ce1
commit e2f0af5740
2 changed files with 106 additions and 91 deletions

View File

@ -1,3 +1,10 @@
Wed Nov 18 17:06:19 2015 Koichi Sasada <ko1@atdot.net>
* gc.c (rb_raw_obj_info): fix trivial issues.
* support SPECIAL_CONSTs.
* fix IMEMO/ment outputs.
Wed Nov 18 11:32:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> Wed Nov 18 11:32:15 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* compile.c (iseq_peephole_optimize): eliminate always/never * compile.c (iseq_peephole_optimize): eliminate always/never

16
gc.c
View File

@ -8961,8 +8961,12 @@ method_type_name(rb_method_type_t type)
const char * const char *
rb_raw_obj_info(char *buff, const int buff_size, VALUE obj) rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
{ {
if (SPECIAL_CONST_P(obj)) {
snprintf(buff, buff_size, "%s", obj_type_name(obj));
}
else {
const int age = RVALUE_FLAGS_AGE(RBASIC(obj)->flags); const int age = RVALUE_FLAGS_AGE(RBASIC(obj)->flags);
const int type = BUILTIN_TYPE(obj); const int type = TYPE(obj);
#define TF(c) ((c) != 0 ? "true" : "false") #define TF(c) ((c) != 0 ? "true" : "false")
#define C(c, s) ((c) != 0 ? (s) : " ") #define C(c, s) ((c) != 0 ? (s) : " ")
@ -9040,8 +9044,12 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
switch (imemo_type(obj)) { switch (imemo_type(obj)) {
case imemo_ment: { case imemo_ment: {
const rb_method_entry_t *me = &RANY(obj)->as.imemo.ment; const rb_method_entry_t *me = &RANY(obj)->as.imemo.ment;
snprintf(buff, buff_size, "%s (called_id: %s, type: %s, alias: %d, class: %s)", buff, snprintf(buff, buff_size, "%s (called_id: %s, type: %s, alias: %d, owner: %s, defined_class: %s)", buff,
rb_id2name(me->called_id), method_type_name(me->def->type), me->def->alias_count, obj_info(me->defined_class)); rb_id2name(me->called_id),
method_type_name(me->def->type),
me->def->alias_count,
obj_info(me->owner),
obj_info(me->defined_class));
break; break;
} }
case imemo_iseq: { case imemo_iseq: {
@ -9064,7 +9072,7 @@ rb_raw_obj_info(char *buff, const int buff_size, VALUE obj)
} }
#undef TF #undef TF
#undef C #undef C
}
return buff; return buff;
} }