summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-02 12:49:35 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-07-02 12:49:35 +0000
commitee457d92c2d99d85f61346ccd7dd3a6c21b294b6 (patch)
treeb4be9dc0cdc75cfb3f7c329855251f83352b931e /iseq.c
parent0a75feb94adbce32b35e23e11b58ace9a2a3e924 (diff)
* compile.c: rename iseq_translate_direct_threaded_code()
to iseq_translate_threaded_code(). * eval_intern.h, yarvcore.h: mv EXEC_EVENT_HOOK() and exec_event_hooks() to yarvcore.h. * insnhelper.ci, vm.c: mv yarv_finish_insn_seq to vm.c. * insns.def (opt_call_c_function): fix to use RESTORE_REGS(). * iseq.c (rb_iseq_build_for_ruby2cext): fix to allocate iseq. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index 2647dd1521..da0652092f 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1372,6 +1372,7 @@ rb_iseq_build_for_ruby2cext(
const char *name,
const char *filename)
{
+ int i;
VALUE iseqval = iseq_alloc(rb_cISeq);
rb_iseq_t *iseq;
GetISeqPtr(iseqval, iseq);
@@ -1382,6 +1383,15 @@ rb_iseq_build_for_ruby2cext(
iseq->filename = rb_str_new2(filename);
iseq->mark_ary = rb_ary_new();
+ iseq->iseq = ALLOC_N(VALUE, iseq->iseq_size);
+
+ for (i=0; i<iseq->iseq_size; i+=2) {
+ iseq->iseq[i] = BIN(opt_call_c_function);
+ iseq->iseq[i+1] = (VALUE)func;
+ }
+
+ iseq_translate_threaded_code(iseq);
+
#define ALLOC_AND_COPY(dst, src, type, size) do { \
if (size) { \
(dst) = ALLOC_N(type, (size)); \