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++; \ cxt->clen++; \
} while (0) \ } 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 { \ #define emit_r(pic, cxt, ins, D, I) do { \
check_code_size(pic, cxt); \ check_code_size(pic, cxt); \
cxt->code[cxt->clen].insn = ins; \ 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); emit_ret(pic, cxt, tailpos);
break; break;
case PIC_TT_CHAR: 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); emit_ret(pic, cxt, tailpos);
break; break;
default: default:

View File

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

View File

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