From 794eb7bc496931d8ffa3111d5723cbcbdacf7b89 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 5 Dec 2008 03:35:48 +0000 Subject: * compile.c (ruby_iseq_compile, ruby_iseq_translate_threaded_code), (ruby_insns_name_array, ruby_iseq_build_from_ary): prefixed with ruby_. * iseq.c (ruby_iseq_load, ruby_insn_make_insn_table): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- iseq.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'iseq.c') diff --git a/iseq.c b/iseq.c index 351ea41fd9..646bc4159d 100644 --- a/iseq.c +++ b/iseq.c @@ -19,10 +19,6 @@ #include "insns.inc" #include "insns_info.inc" -/* compile.c */ -void iseq_compile(VALUE self, NODE *node); -int iseq_translate_threaded_code(rb_iseq_t *iseq); - VALUE rb_cISeq; static void @@ -326,7 +322,7 @@ rb_iseq_new_with_bopt_and_opt(NODE *node, VALUE name, VALUE filename, iseq->self = self; prepare_iseq_build(iseq, name, filename, parent, type, bopt, option); - iseq_compile(self, node); + ruby_iseq_compile(self, node); cleanup_iseq_build(iseq); return self; } @@ -348,17 +344,14 @@ rb_iseq_new_with_bopt(NODE *node, VALUE name, VALUE filename, bopt, &COMPILE_OPTION_DEFAULT); } -VALUE iseq_build_from_ary(rb_iseq_t *iseq, VALUE locals, VALUE args, - VALUE exception, VALUE body); - #define CHECK_ARRAY(v) rb_convert_type(v, T_ARRAY, "Array", "to_ary") #define CHECK_STRING(v) rb_convert_type(v, T_STRING, "String", "to_str") #define CHECK_SYMBOL(v) rb_convert_type(v, T_SYMBOL, "Symbol", "to_sym") static inline VALUE CHECK_INTEGER(VALUE v) {NUM2LONG(v); return v;} -VALUE +static VALUE iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt) { - VALUE iseqval = iseq_alloc(rb_cISeq); + VALUE iseqval = iseq_alloc(self); VALUE magic, version1, version2, format_type, misc; VALUE name, filename; @@ -428,7 +421,7 @@ iseq_load(VALUE self, VALUE data, VALUE parent, VALUE opt) prepare_iseq_build(iseq, name, filename, parent, iseq_type, 0, &option); - iseq_build_from_ary(iseq, locals, args, exception, body); + ruby_iseq_build_from_ary(iseq, locals, args, exception, body); cleanup_iseq_build(iseq); return iseqval; @@ -443,6 +436,12 @@ iseq_s_load(int argc, VALUE *argv, VALUE self) return iseq_load(self, data, 0, opt); } +VALUE +ruby_iseq_load(VALUE data, VALUE parent, VALUE opt) +{ + return iseq_load(rb_cISeq, data, parent, opt); +} + static NODE * compile_string(VALUE str, VALUE file, VALUE line) { @@ -1237,7 +1236,7 @@ iseq_data_to_ary(rb_iseq_t *iseq) } struct st_table * -insn_make_insn_table(void) +ruby_insn_make_insn_table(void) { struct st_table *table; int i; @@ -1383,7 +1382,7 @@ rb_iseq_build_for_ruby2cext( iseq->iseq[i+1] = (VALUE)func; } - iseq_translate_threaded_code(iseq); + ruby_iseq_translate_threaded_code(iseq); #define ALLOC_AND_COPY(dst, src, type, size) do { \ if (size) { \ -- cgit v1.2.3