summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core/codegen.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-09-10 10:22:49 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-09-10 10:22:49 +0900
commitb34713304a983a0a6e3259bd0b5f3215ac2ee14a (patch)
tree4adbbf9661f81fc38254a936eb61d7d8417ff4c4 /mrbgems/mruby-compiler/core/codegen.c
parent5fbea87fe592da5de15df1a518c6595d844527c1 (diff)
downloadmruby-b34713304a983a0a6e3259bd0b5f3215ac2ee14a.tar.gz
mruby-b34713304a983a0a6e3259bd0b5f3215ac2ee14a.zip
fixup! codegen.c: resurrect `s->lastpc` to reduce `iseq` scans.
Diffstat (limited to 'mrbgems/mruby-compiler/core/codegen.c')
-rw-r--r--mrbgems/mruby-compiler/core/codegen.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c
index 752cb5494..b8891cf1b 100644
--- a/mrbgems/mruby-compiler/core/codegen.c
+++ b/mrbgems/mruby-compiler/core/codegen.c
@@ -462,13 +462,7 @@ mrb_prev_pc(codegen_scope *s, const mrb_code *pc)
#define pc_addr(s) &((s)->iseq[(s)->pc])
#define addr_pc(s, addr) (uint32_t)((addr) - s->iseq)
-
-static void
-rewind_pc(codegen_scope *s)
-{
- /* should not be called when s->pc is 0 (top) */
- s->pc = addr_pc(s, mrb_prev_pc(s, pc_addr(s)));
-}
+#define rewind_pc(s) s->pc = s->lastpc
static struct mrb_insn_data
mrb_last_insn(codegen_scope *s)