summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core/codegen.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-07-31 17:28:42 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-07-31 17:28:42 +0900
commitbeb6e5c299bb411a7f2a9e355e6eeca3aa785c74 (patch)
tree706d4a1cffc4f85367f08079a6e3da1332ab8ffd /mrbgems/mruby-compiler/core/codegen.c
parent889f0f5f36212606056af4fbb7865f900c2b8af1 (diff)
downloadmruby-beb6e5c299bb411a7f2a9e355e6eeca3aa785c74.tar.gz
mruby-beb6e5c299bb411a7f2a9e355e6eeca3aa785c74.zip
Bytecode support for `mrdb`.
Diffstat (limited to 'mrbgems/mruby-compiler/core/codegen.c')
-rw-r--r--mrbgems/mruby-compiler/core/codegen.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c
index 070aaac51..b8caba3a0 100644
--- a/mrbgems/mruby-compiler/core/codegen.c
+++ b/mrbgems/mruby-compiler/core/codegen.c
@@ -296,15 +296,8 @@ on_eval(codegen_scope *s)
return FALSE;
}
-struct mrb_insn_data {
- uint8_t insn;
- uint16_t a;
- uint16_t b;
- uint8_t c;
-};
-
struct mrb_insn_data
-mrb_decode_insn(codegen_scope *s, mrb_code *pc)
+mrb_decode_insn(mrb_code *pc)
{
struct mrb_insn_data data = { 0 };
mrb_code insn = READ_B();
@@ -353,7 +346,7 @@ mrb_decode_insn(codegen_scope *s, mrb_code *pc)
return data;
}
-struct mrb_insn_data
+static struct mrb_insn_data
mrb_last_insn(codegen_scope *s)
{
if (s->pc == s->lastpc) {
@@ -362,7 +355,7 @@ mrb_last_insn(codegen_scope *s)
data.insn = OP_NOP;
return data;
}
- return mrb_decode_insn(s, &s->iseq[s->lastpc]);
+ return mrb_decode_insn(&s->iseq[s->lastpc]);
}
static mrb_bool