Generate bytecode while parsing

This commit is contained in:
Ilmir Usmanov
2014-07-22 20:49:51 +04:00
parent 9a0b54313d
commit efb7009cfb
16 changed files with 1882 additions and 3281 deletions
+36 -6
View File
@@ -42,21 +42,46 @@ typedef void (*opfunc)(OPCODE, struct __int_data *);
op(loop_postcond)
#define OP_CALLS_AND_ARGS(op) \
op(call_0) \
op(call_1) \
op(call_2) \
op(call_n) \
op(construct_0) \
op(construct_1) \
op(construct_n) \
op(func_decl_0) \
op(func_decl_1) \
op(func_decl_2) \
op(func_decl_n) \
op(varg_1) \
op(func_expr_0) \
op(func_expr_1) \
op(func_expr_n) \
op(varg_1_end) \
op(varg_2) \
op(varg_2_end) \
op(varg_3) \
op(varg_3_end) \
op(retval) \
op(ret)
#define OP_INITS(op) \
op(array_0) \
op(array_1) \
op(array_2) \
op(array_n) \
op(prop) \
op(prop_access) \
op(prop_get_decl) \
op(prop_set_decl) \
op(obj_0) \
op(obj_1) \
op(obj_2) \
op(obj_n) \
op(this) \
op(delete) \
op(typeof) \
op(with) \
op(end_with) \
op(decl_var)
#define OP_ASSIGNMENTS(op) \
op(assignment)
@@ -68,11 +93,13 @@ typedef void (*opfunc)(OPCODE, struct __int_data *);
#define OP_B_BITWISE(op) \
op(b_and) \
op(b_or) \
op(b_xor)
op(b_xor) \
op(b_not)
#define OP_B_LOGICAL(op) \
op(logical_and) \
op(logical_or)
op(logical_or) \
op(logical_not)
#define OP_EQUALITY(op) \
op(equal_value) \
@@ -84,7 +111,9 @@ typedef void (*opfunc)(OPCODE, struct __int_data *);
op(less_than) \
op(greater_than) \
op(less_or_equal_than) \
op(greater_or_equal_than)
op(greater_or_equal_than) \
op(instanceof) \
op(in)
#define OP_ARITHMETIC(op) \
op(addition) \
@@ -106,6 +135,7 @@ typedef void (*opfunc)(OPCODE, struct __int_data *);
#define OP_LIST(op) \
OP_LOOPS(op) \
OP_CALLS_AND_ARGS(op) \
OP_INITS(op) \
OP_ASSIGNMENTS(op) \
OP_B_LOGICAL(op) \
OP_B_BITWISE(op) \