unify emit_c and emit_i
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
+1
-1
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user