Dump FrozenCore specially
This commit is contained in:
parent
d915e7ee00
commit
081cc4eb28
3
iseq.c
3
iseq.c
@ -1861,6 +1861,7 @@ local_var_name(const rb_iseq_t *diseq, VALUE level, VALUE op)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int rb_insn_unified_local_var_level(VALUE);
|
int rb_insn_unified_local_var_level(VALUE);
|
||||||
|
VALUE rb_dump_literal(VALUE lit);
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_insn_operand_intern(const rb_iseq_t *iseq,
|
rb_insn_operand_intern(const rb_iseq_t *iseq,
|
||||||
@ -1936,7 +1937,7 @@ rb_insn_operand_intern(const rb_iseq_t *iseq,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ret = rb_inspect(op);
|
ret = rb_dump_literal(op);
|
||||||
if (CLASS_OF(op) == rb_cISeq) {
|
if (CLASS_OF(op) == rb_cISeq) {
|
||||||
if (child) {
|
if (child) {
|
||||||
rb_ary_push(child, op);
|
rb_ary_push(child, op);
|
||||||
|
21
node.c
21
node.c
@ -26,7 +26,7 @@
|
|||||||
#define A_ID(id) add_id(buf, (id))
|
#define A_ID(id) add_id(buf, (id))
|
||||||
#define A_INT(val) rb_str_catf(buf, "%d", (val))
|
#define A_INT(val) rb_str_catf(buf, "%d", (val))
|
||||||
#define A_LONG(val) rb_str_catf(buf, "%ld", (val))
|
#define A_LONG(val) rb_str_catf(buf, "%ld", (val))
|
||||||
#define A_LIT(lit) AR(rb_inspect(lit))
|
#define A_LIT(lit) AR(rb_dump_literal(lit))
|
||||||
#define A_NODE_HEADER(node, term) \
|
#define A_NODE_HEADER(node, term) \
|
||||||
rb_str_catf(buf, "@ %s (line: %d, location: (%d,%d)-(%d,%d))%s"term, \
|
rb_str_catf(buf, "@ %s (line: %d, location: (%d,%d)-(%d,%d))%s"term, \
|
||||||
ruby_node_name(nd_type(node)), nd_line(node), \
|
ruby_node_name(nd_type(node)), nd_line(node), \
|
||||||
@ -79,6 +79,25 @@
|
|||||||
|
|
||||||
#define LAST_NODE (next_indent = " ")
|
#define LAST_NODE (next_indent = " ")
|
||||||
|
|
||||||
|
VALUE
|
||||||
|
rb_dump_literal(VALUE lit)
|
||||||
|
{
|
||||||
|
if (!RB_SPECIAL_CONST_P(lit)) {
|
||||||
|
VALUE str;
|
||||||
|
switch (RB_BUILTIN_TYPE(lit)) {
|
||||||
|
case T_CLASS: case T_MODULE: case T_ICLASS:
|
||||||
|
str = rb_class_path(lit);
|
||||||
|
if (FL_TEST(lit, FL_SINGLETON)) {
|
||||||
|
str = rb_sprintf("<%"PRIsVALUE">", str);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rb_inspect(lit);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_indent(VALUE buf, VALUE indent)
|
add_indent(VALUE buf, VALUE indent)
|
||||||
{
|
{
|
||||||
|
1
vm.c
1
vm.c
@ -3123,6 +3123,7 @@ Init_VM(void)
|
|||||||
|
|
||||||
/* FrozenCore (hidden) */
|
/* FrozenCore (hidden) */
|
||||||
fcore = rb_class_new(rb_cBasicObject);
|
fcore = rb_class_new(rb_cBasicObject);
|
||||||
|
rb_set_class_path(fcore, rb_cRubyVM, "FrozenCore");
|
||||||
RBASIC(fcore)->flags = T_ICLASS;
|
RBASIC(fcore)->flags = T_ICLASS;
|
||||||
klass = rb_singleton_class(fcore);
|
klass = rb_singleton_class(fcore);
|
||||||
rb_define_method_id(klass, id_core_set_method_alias, m_core_set_method_alias, 3);
|
rb_define_method_id(klass, id_core_set_method_alias, m_core_set_method_alias, 3);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user