summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-05 13:34:34 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-05 13:34:34 +0000
commit51782c7f38f39f2146b5882d56df0cb8d1ec1847 (patch)
tree59217cf224f41515c87a6433776a985d01759abc /iseq.c
parent7ac90158e284783159fefc37fa88fc2dc0bdd5a9 (diff)
merges r20535 from trunk into ruby_1_9_1.
* 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/branches/ruby_1_9_1@20554 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/iseq.c b/iseq.c
index c4ccc3c24e..3b93ff0255 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;
@@ -1306,7 +1305,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) { \