From c4c3f238d78f58242682b8c8428da63b3c018e54 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 19 Jan 2009 01:06:56 +0000 Subject: * iseq.c: rename ruby_iseq_disasm_insn() -> rb_iseq_disasm_insn(). rename ruby_iseq_disasm() -> rb_iseq_disasm(). * compile.c: rename ruby_iseq_compile() -> rb_iseq_compile_node(). rename ruby_iseq_translate_threaded_code() -> rb_iseq_translate_threaded_code(). rename ruby_insns_name_array() -> rb_insns_name_array(). rename ruby_iseq_build_from_ary() -> rb_iseq_build_from_ary(). * iseq.c, compile.c: remove ruby_insn_make_insn_table() and make static function insn_make_insn_table(). * iseq.h, ruby.c, vm.c, vm_core.h, vm_eval.c, vm_dump.c, blockinlining.c: ditto. Rename strange "ruby_" prefix to "rb_" prefix. This changes may affect only core because renamed functions require a pointer of rb_iseq_t which is not exposed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- compile.c | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'compile.c') diff --git a/compile.c b/compile.c index 0cd765c867..60cf14a4af 100644 --- a/compile.c +++ b/compile.c @@ -415,7 +415,7 @@ iseq_add_mark_object_compile_time(rb_iseq_t *iseq, VALUE v) } VALUE -ruby_iseq_compile(VALUE self, NODE *node) +rb_iseq_compile_node(VALUE self, NODE *node) { DECL_ANCHOR(ret); rb_iseq_t *iseq; @@ -503,7 +503,7 @@ ruby_iseq_compile(VALUE self, NODE *node) } int -ruby_iseq_translate_threaded_code(rb_iseq_t *iseq) +rb_iseq_translate_threaded_code(rb_iseq_t *iseq) { #if OPT_DIRECT_THREADED_CODE || OPT_CALL_THREADED_CODE extern const void **vm_get_insns_address_table(void); @@ -961,10 +961,10 @@ iseq_setup(rb_iseq_t *iseq, LINK_ANCHOR *anchor) iseq_set_optargs_table(iseq); debugs("[compile step 5 (iseq_translate_threaded_code)] \n"); - ruby_iseq_translate_threaded_code(iseq); + rb_iseq_translate_threaded_code(iseq); if (compile_debug > 1) { - VALUE str = ruby_iseq_disasm(iseq->self); + VALUE str = rb_iseq_disasm(iseq->self); printf("%s\n", StringValueCStr(str)); fflush(stdout); } @@ -5000,7 +5000,7 @@ dump_disasm_list(struct iseq_link_element *link) } VALUE -ruby_insns_name_array(void) +rb_insns_name_array(void) { VALUE ary = rb_ary_new(); int i; @@ -5090,6 +5090,20 @@ iseq_build_exception(rb_iseq_t *iseq, struct st_table *labels_table, return COMPILE_OK; } +static struct st_table * +insn_make_insn_table(void) +{ + struct st_table *table; + int i; + table = st_init_numtable(); + + for (i=0; i