Add try-catch-finally support: parse and generate opcodes for this construct
Fix varg generation: generate *_n opcodes with parameters in following meta opcodes Add stack internal structure: dimanically allocated stack. Use dynamically allocated memory in parser: every local and global variables are stored in dinamically allocated stacks. Use dynamically allocated memory in serializer: opcodes are also stored in stack. Change is_true_jmp and is_false_jmp opcodes to relative. Change *jmp* opcodes to be able to store opcode_counter_t instead of idx_t.
This commit is contained in:
@@ -165,12 +165,13 @@ opcode_counter_t read_meta_opcode_counter (opcode_meta_type expected_type, int_d
|
||||
p##_3 (a, remainder, dst, var_left, var_right)
|
||||
|
||||
#define OP_JUMPS(p, a) \
|
||||
p##_1 (a, jmp, opcode_idx) \
|
||||
p##_1 (a, jmp_up, opcode_count) \
|
||||
p##_1 (a, jmp_down, opcode_count) \
|
||||
p##_2 (a, jmp_up, opcode_1, opcode_2) \
|
||||
p##_2 (a, jmp_down, opcode_1, opcode_2) \
|
||||
p##_0 (a, nop) \
|
||||
p##_2 (a, is_true_jmp, value, opcode) \
|
||||
p##_2 (a, is_false_jmp, value, opcode)
|
||||
p##_3 (a, is_true_jmp_up, value, opcode_1, opcode_2) \
|
||||
p##_3 (a, is_true_jmp_down, value, opcode_1, opcode_2) \
|
||||
p##_3 (a, is_false_jmp_up, value, opcode_1, opcode_2) \
|
||||
p##_3 (a, is_false_jmp_down, value, opcode_1, opcode_2)
|
||||
|
||||
#define OP_LIST_FULL(p, a) \
|
||||
OP_CALLS_AND_ARGS (p, a) \
|
||||
|
||||
Reference in New Issue
Block a user