mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
0a75feb94a
commit
ee457d92c2
8 changed files with 71 additions and 49 deletions
10
iseq.c
10
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)); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue