diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-07 01:25:05 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-02-07 01:25:05 +0000 |
commit | 44aef0b53f3e73ec987a668a3284d5e28bdb8121 (patch) | |
tree | 4cbe7f49ca7c1b4be5f345870ef3d99126803a31 /iseq.c | |
parent | 8ee7d0767f7940baeae60ffa95afde93f3378c93 (diff) | |
download | ruby-44aef0b53f3e73ec987a668a3284d5e28bdb8121.tar.gz |
* this commit is a result of refactoring. only renaming functions,
moving definitions place, add/remove prototypes, deleting
unused variables and removing yarv.h.
This commit doesn't change any behavior of ruby/vm.
* yarv.h, common.mk: remove yarv.h (contents are moved to yarvcore.h).
* error.c, eval_intern.h: include yarvcore.h instead yarv.h
* rename some functions:
* debug.[ch]: debug_*() -> ruby_debug_*()
* iseq.c: iseq_*() -> rb_iseq_*(), ruby_iseq_disasm()
* iseq.c: node_name() -> ruby_node_name()
* vm.c: yarv_check_redefinition_opt_method() ->
rb_vm_check_redefinition_opt_method()
* some refactoring with checking -Wall.
* array.c: remove rb_ary_ptr() (unused) and remove unused
local variables.
* object.c: add a prototype of rb_mod_module_exec().
* eval_intern.h (ruby_cref): set it inline.
* eval_load.c (rb_load), yarvcore.c: yarv_load() -> rb_load_internal().
* parse.y: add a prototype of rb_parse_in_eval() (in eval.c).
* process.c: add a prototype of rb_thread_stop_timer_thread() (in thread.c).
* thread.c: remove raw_gets() function (unused) and fix some format
mismatch (format mismatchs have remained yet. this is todo).
* thread.c (rb_thread_wait_fd_rw): fix typo on label name.
* thread_pthread.ci: comment out codes with USE_THREAD_CACHE.
* vm.c (rb_svar, rb_backref_get, rb_backref_get,
rb_lastline_get, rb_lastline_set) : moved from yarvcore.c.
* vm.c (yarv_init_redefined_flag): add a prototype and rename
yarv_opt_method_table to vm_opt_method_table.
* vm.c (rb_thread_eval): moved from yarvcore.c.
* yarvcore.c: remove unused global variables and fix to use nsdr().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 30 |
1 files changed, 14 insertions, 16 deletions
@@ -251,7 +251,7 @@ make_compile_option_value(rb_compile_option_t *option) } VALUE -yarv_iseq_new(NODE *node, VALUE name, VALUE file_name, +rb_iseq_new(NODE *node, VALUE name, VALUE file_name, VALUE parent, VALUE type) { return rb_iseq_new_with_opt(node, name, file_name, parent, type, @@ -259,7 +259,7 @@ yarv_iseq_new(NODE *node, VALUE name, VALUE file_name, } static VALUE -yarv_iseq_new_with_bopt_and_opt(NODE *node, VALUE name, VALUE file_name, +rb_iseq_new_with_bopt_and_opt(NODE *node, VALUE name, VALUE file_name, VALUE parent, VALUE type, VALUE bopt, const rb_compile_option_t *option) { @@ -280,15 +280,15 @@ rb_iseq_new_with_opt(NODE *node, VALUE name, VALUE file_name, VALUE parent, VALUE type, const rb_compile_option_t *option) { - return yarv_iseq_new_with_bopt_and_opt(node, name, file_name, parent, type, + return rb_iseq_new_with_bopt_and_opt(node, name, file_name, parent, type, Qfalse, option); } VALUE -yarv_iseq_new_with_bopt(NODE *node, VALUE name, VALUE file_name, +rb_iseq_new_with_bopt(NODE *node, VALUE name, VALUE file_name, VALUE parent, VALUE type, VALUE bopt) { - return yarv_iseq_new_with_bopt_and_opt(node, name, file_name, parent, type, + return rb_iseq_new_with_bopt_and_opt(node, name, file_name, parent, type, bopt, &COMPILE_OPTION_DEFAULT); } @@ -453,8 +453,6 @@ iseq_check(VALUE val) return iseq; } -VALUE rb_thread_eval(rb_thead_t *th, VALUE iseqval); - static VALUE iseq_eval(VALUE self) { @@ -606,7 +604,7 @@ insn_operand_intern(rb_iseq_t *iseq, break; default: - rb_bug("iseq_disasm: unknown operand type: %c", type); + rb_bug("ruby_iseq_disasm: unknown operand type: %c", type); } return ret; } @@ -616,7 +614,7 @@ insn_operand_intern(rb_iseq_t *iseq, * Iseq -> Iseq inspect object */ VALUE -iseq_disasm_insn(VALUE ret, VALUE *iseq, int pos, +ruby_iseq_disasm_insn(VALUE ret, VALUE *iseq, int pos, rb_iseq_t *iseqdat, VALUE child) { int insn = iseq[pos]; @@ -694,7 +692,7 @@ catch_type(int type) } VALUE -iseq_disasm(VALUE self) +ruby_iseq_disasm(VALUE self) { rb_iseq_t *iseqdat = iseq_check(self); VALUE *iseq; @@ -728,7 +726,7 @@ iseq_disasm(VALUE self) (int)entry->end, (int)entry->sp, (int)entry->cont); rb_str_cat2(str, buff); if (entry->iseq) { - rb_str_concat(str, iseq_disasm(entry->iseq)); + rb_str_concat(str, ruby_iseq_disasm(entry->iseq)); } } if (iseqdat->catch_table_size != 0) { @@ -788,19 +786,19 @@ iseq_disasm(VALUE self) /* show each line */ for (i = 0; i < size;) { - i += iseq_disasm_insn(str, iseq, i, iseqdat, child); + i += ruby_iseq_disasm_insn(str, iseq, i, iseqdat, child); } for (i = 0; i < RARRAY_LEN(child); i++) { VALUE isv = rb_ary_entry(child, i); - rb_str_concat(str, iseq_disasm(isv)); + rb_str_concat(str, ruby_iseq_disasm(isv)); } return str; } char * -node_name(int node) +ruby_node_name(int node) { switch (node) { case NODE_METHOD: @@ -1031,7 +1029,7 @@ int debug_node(NODE *node) { printf("node type: %d\n", nd_type(node)); - printf("node name: %s\n", node_name(nd_type(node))); + printf("node name: %s\n", ruby_node_name(nd_type(node))); printf("node filename: %s\n", node->nd_file); return 0; } @@ -1335,7 +1333,7 @@ Init_ISeq(void) rb_cISeq = rb_define_class_under(rb_cVM, "InstructionSequence", rb_cObject); rb_define_alloc_func(rb_cISeq, iseq_alloc); rb_define_method(rb_cISeq, "inspect", iseq_inspect, 0); - rb_define_method(rb_cISeq, "disasm", iseq_disasm, 0); + rb_define_method(rb_cISeq, "disasm", ruby_iseq_disasm, 0); rb_define_method(rb_cISeq, "to_a", iseq_to_a, 0); rb_define_method(rb_cISeq, "eval", iseq_eval, 0); |