Constify irep members.

- `pool`
- `syms`
- `reps`
This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-06-05 07:43:40 +09:00
parent 744ba80919
commit 5a3e014e49
21 changed files with 206 additions and 174 deletions
+6 -6
View File
@@ -920,7 +920,7 @@ argnum_error(mrb_state *mrb, mrb_int num)
MRB_API mrb_value
mrb_vm_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int stack_keep)
{
mrb_irep *irep = proc->body.irep;
const mrb_irep *irep = proc->body.irep;
mrb_value result;
struct mrb_context *c = mrb->c;
ptrdiff_t cioff = c->ci - c->cibase;
@@ -965,9 +965,9 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, const mrb_code *pc)
{
/* mrb_assert(MRB_PROC_CFUNC_P(proc)) */
const mrb_code *pc0 = pc;
mrb_irep *irep = proc->body.irep;
mrb_value *pool = irep->pool;
mrb_sym *syms = irep->syms;
const mrb_irep *irep = proc->body.irep;
const mrb_value *pool = irep->pool;
const mrb_sym *syms = irep->syms;
mrb_code insn;
int ai = mrb_gc_arena_save(mrb);
struct mrb_jmpbuf *prev_jmp = mrb->jmp;
@@ -2549,7 +2549,7 @@ RETRY_TRY_BLOCK:
L_MAKE_LAMBDA:
{
struct RProc *p;
mrb_irep *nirep = irep->reps[b];
const mrb_irep *nirep = irep->reps[b];
if (c & OP_L_CAPTURE) {
p = mrb_closure_new(mrb, nirep);
@@ -2627,7 +2627,7 @@ RETRY_TRY_BLOCK:
CASE(OP_EXEC, BB) {
mrb_value recv = regs[a];
struct RProc *p;
mrb_irep *nirep = irep->reps[b];
const mrb_irep *nirep = irep->reps[b];
/* prepare closure */
p = mrb_proc_new(mrb, nirep);