irep->pool struct pool -> mrb_value

This commit is contained in:
Miura Hideki
2013-11-17 16:33:39 +09:00
parent 2bda965258
commit 54c5b12fb7
8 changed files with 74 additions and 84 deletions
+4 -7
View File
@@ -554,7 +554,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int
/* mrb_assert(mrb_proc_cfunc_p(proc)) */
mrb_irep *irep = proc->body.irep;
mrb_code *pc = irep->iseq;
struct irep_pool *pool = irep->pool;
mrb_value *pool = irep->pool;
mrb_sym *syms = irep->syms;
mrb_value *regs = NULL;
mrb_code i;
@@ -618,10 +618,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int
CASE(OP_LOADL) {
/* A Bx R(A) := Pool(Bx) */
if (pool[GETARG_Bx(i)].type == IREP_TT_FLOAT)
SET_FLT_VALUE(mrb, regs[GETARG_A(i)], pool[GETARG_Bx(i)].value.f);
else
SET_INT_VALUE(regs[GETARG_A(i)], pool[GETARG_Bx(i)].value.i);
regs[GETARG_A(i)] = pool[GETARG_Bx(i)];
NEXT;
}
@@ -1939,7 +1936,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int
CASE(OP_STRING) {
/* A Bx R(A) := str_new(Lit(Bx)) */
regs[GETARG_A(i)] = mrb_str_new(mrb, pool[GETARG_Bx(i)].value.s->buf, pool[GETARG_Bx(i)].value.s->len);
regs[GETARG_A(i)] = mrb_str_dup(mrb, pool[GETARG_Bx(i)]);
mrb_gc_arena_restore(mrb, ai);
NEXT;
}
@@ -2134,7 +2131,7 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int
CASE(OP_ERR) {
/* Bx raise RuntimeError with message Lit(Bx) */
mrb_value msg = mrb_str_new(mrb, pool[GETARG_Bx(i)].value.s->buf, pool[GETARG_Bx(i)].value.s->len);
mrb_value msg = mrb_str_dup(mrb, pool[GETARG_Bx(i)]);
mrb_value exc;
if (GETARG_A(i) == 0) {