unify emit_c and emit_i

This commit is contained in:
Yuichi Nishiwaki 2016-02-02 22:34:18 +09:00
parent 2af9020b73
commit 5637b3e435
3 changed files with 2 additions and 10 deletions

View File

@ -732,13 +732,6 @@ codegen_context_destroy(pic_state *pic, codegen_context *cxt)
cxt->clen++; \
} while (0) \
#define emit_c(pic, cxt, ins, C) do { \
check_code_size(pic, cxt); \
cxt->code[cxt->clen].insn = ins; \
cxt->code[cxt->clen].u.c = C; \
cxt->clen++; \
} while (0) \
#define emit_r(pic, cxt, ins, D, I) do { \
check_code_size(pic, cxt); \
cxt->code[cxt->clen].insn = ins; \
@ -981,7 +974,7 @@ codegen_quote(pic_state *pic, codegen_context *cxt, pic_value obj, bool tailpos)
emit_ret(pic, cxt, tailpos);
break;
case PIC_TT_CHAR:
emit_c(pic, cxt, OP_PUSHCHAR, pic_char(obj));
emit_i(pic, cxt, OP_PUSHCHAR, pic_char(obj));
emit_ret(pic, cxt, tailpos);
break;
default:

View File

@ -13,7 +13,6 @@ typedef struct {
int insn;
union {
int i;
char c;
struct {
int depth;
int idx;

View File

@ -411,7 +411,7 @@ pic_apply(pic_state *pic, struct pic_proc *proc, int argc, pic_value *argv)
NEXT;
}
CASE(OP_PUSHCHAR) {
PUSH(pic_char_value(c.u.c));
PUSH(pic_char_value(c.u.i));
NEXT;
}
CASE(OP_PUSHCONST) {