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:
Ilmir Usmanov
2014-09-16 21:22:11 +04:00
parent cd41b236d9
commit e77bd4f4e5
26 changed files with 1644 additions and 1710 deletions
+2 -2
View File
@@ -38,11 +38,11 @@ main( int __unused argc,
[ 8] = getop_meta (OPCODE_META_TYPE_CATCH, 0, 14),
[ 9] = getop_meta (OPCODE_META_TYPE_CATCH_EXCEPTION_IDENTIFIER, 2, 255),
[10] = getop_equal_value_type (0, 1, 2),
[11] = getop_is_true_jmp (0, 14),
[11] = getop_is_true_jmp_down (0, 0, 3),
[12] = getop_exitval (1),
[13] = getop_assignment (0, OPCODE_ARG_TYPE_SIMPLE, ECMA_SIMPLE_VALUE_FALSE),
[14] = getop_meta (OPCODE_META_TYPE_FINALLY, 0, 18),
[15] = getop_is_false_jmp (0, 17),
[15] = getop_is_false_jmp_down (0, 0, 2),
[16] = getop_exitval (0),
[17] = getop_exitval (1),
[18] = getop_meta (OPCODE_META_TYPE_END_TRY_CATCH_FINALLY, 255, 255),