Commit Graph

73 Commits

Author SHA1 Message Date
Ilmir Usmanov 05a2224faa Fix parsing of assignment expressions without assignment operator. 2014-09-24 16:53:58 +04:00
Ilmir Usmanov 0738ec6a54 Add generation of prop_setter. 2014-09-24 15:30:37 +04:00
Ilmir Usmanov 8bcc37d0f8 Fix prop_getter, construct_n, array_n generation. 2014-09-23 22:53:35 +04:00
Ilmir Usmanov f17ca4c455 Fix post_* opcodes generation 2014-09-23 20:32:22 +04:00
Ilmir Usmanov d26b7f9f4e Fix reg_var_decl generation. 2014-09-23 20:05:10 +04:00
Ilmir Usmanov 8a5b956e38 Simplify serializer/deserializer. Reduce memory usage in lexer. Create HashTable data structure. Finish preparations for introducing new strings addressation. 2014-09-23 16:45:10 +04:00
Ilmir Usmanov 56e6d2a380 Add if_else.js test. Fix bytecode generation. 2014-09-17 20:21:30 +04:00
Ilmir Usmanov 70cc5128cc Add test try_catch_finally.js. Fix parser and interpreter 2014-09-17 18:58:16 +04:00
Ilmir Usmanov e77bd4f4e5 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.
2014-09-16 21:32:59 +04:00
Ruben Ayrapetyan ddb2e6e9d5 Introducing and implementing 'throw' and 'try' opcode handlers. 2014-08-28 18:57:34 +04:00
Ruben Ayrapetyan 647f6b3c67 Renaming OPCODE_META_TYPE_OPCODE_COUNTER -> OPCODE_META_TYPE_FUNCTION_END. 2014-08-28 16:49:03 +04:00
Ruben Ayrapetyan 9d45f68370 Introducing 'opcode counter' type for 'meta' opcode; replacing 'jmp_down' opcodes that are used as pointers only with 'meta' opcodes of the introduced type. 2014-08-28 15:17:49 +04:00
Ruben Ayrapetyan 5d2b535cec Implementing 'with' opcode; replacing 'end_with' opcode with 'meta' opcode of corresponding type. 2014-08-27 21:38:53 +04:00
Ruben Ayrapetyan f08c242156 Implementing 'obj_decl' opcode; replacing 'prop', 'prop_get_decl', 'prop_set_decl' with 'meta' opcodes of corresponding types. 2014-08-27 20:43:31 +04:00
Ruben Ayrapetyan 76121926d1 Splitting 'delete' opcode to 'delete_var' and 'delete_prop'. Implementing corresponding opcode handlers. 2014-08-27 17:12:59 +04:00
Ruben Ayrapetyan 02f31fbcfb Adding 'func_expr_n' opcode; replacing arg1 and arg2 of 'func_decl_n' opcode with arg_list. 2014-08-26 15:58:57 +04:00
e.gavrin a99907670b OPCODE define replaced with opcode_t. T_IDX define replaced with idx_t. 2014-08-23 00:53:41 +04:00
e.gavrin 0eece0be5a Remove not needed opcode-support.[c,h] 2014-08-23 00:24:49 +04:00
e.gavrin d4a9d9430e Refactoring of libcoreint part1 2014-08-23 00:16:56 +04:00
e.gavrin 5b2b04f5f9 Various opcode's refinements: obj[0,1, 2, n]->obj_decl, array[0, 1, 2, n]->array_decl, func_expr[0, 1, n]->removed, varg[1_end, 2_end, 3_end, 3]->varg_list. 2014-08-21 15:49:10 +04:00
Ruben Ayrapetyan 284e7fc91b Renaming prop_access opcode to prop_getter; introducing prop_setter opcode; implementing property getter/setter opcode handlers. 2014-08-20 16:34:03 +04:00
Ilmir Usmanov 126b8814a8 Add rules to check switch-cases 2014-08-19 16:22:05 +04:00
Ruben Ayrapetyan 116a80f8ae Ilmir's fix of register variables counting. 2014-08-15 19:46:02 +04:00
e.gavrin c5f33d184d fix style errors in libjsparser 2014-08-13 16:23:59 +04:00
e.gavrin 19e71e98e2 fix style error 2014-08-13 15:39:56 +04:00
Ilmir Usmanov 0a68baa479 Add support of floating-point literals 2014-08-12 22:27:12 +04:00
Ilmir Usmanov 5373b60955 Reformat 2014-08-11 23:17:45 +04:00
Ilmir Usmanov 4a7bb710fa Add 'assert' intrinsic 2014-08-06 14:17:53 +04:00
Ilmir Usmanov 97dc322085 Fix assertions in parser 2014-08-04 17:50:08 +04:00
Ilmir Usmanov eee88ffdc2 Add basic support of 'break' and 'continue' statements (without identifiers) 2014-08-04 17:09:02 +04:00
Ilmir Usmanov 59403ac7f2 Parse empty files correctly 2014-08-01 15:49:35 +04:00
Ilmir Usmanov d15cf8f436 Fix some bugs in lexer 2014-08-01 15:24:48 +04:00
Ruben Ayrapetyan 020325d199 __HOST -> __TARGET_HOST_X64 2014-07-31 22:23:05 +04:00
Ilmir Usmanov 2e0a3d4aca Add support of input several files 2014-07-31 21:23:29 +04:00
Ilmir Usmanov 14f0563d1a Fix couple of bugs show-opcodes: lexer should not dump lines, serializer must not rewrite a single opcode when dumping 2014-07-31 21:09:42 +04:00
Ilmir Usmanov 2809ffb36d Add scope reordering ("use strict" -> func_decl -> var_decl -> other opcodes); Add --show-opcodes console parameter 2014-07-31 19:30:27 +04:00
Ilmir Usmanov 8c5309d131 Add jump after function declaration and function expression header 2014-07-29 20:22:12 +04:00
Ilmir Usmanov bc9d80147a Reduce lexer's memory consumption 2014-07-29 11:55:16 +04:00
Ilmir Usmanov 1b6638f073 Add ERR_MEMORY exit code to show that there was not enough memory; fix debug.stm build 2014-07-28 19:39:11 +04:00
Ilmir Usmanov 40007126fa Fix memory corruptions in lexer, which occured while parsing cse.js; remove lexer.log and parser.log files 2014-07-25 14:16:29 +04:00
Ilmir Usmanov c9c26251a4 Add savings bytecode in memory on target 2014-07-25 12:37:29 +04:00
Ilmir Usmanov 3b0fef6e04 Add opcodes for increment and decrement; add optimizer 2014-07-24 19:27:58 +04:00
Ilmir Usmanov c837c7d435 Optimize reg_var_decl memory usage 2014-07-24 16:54:59 +04:00
Ilmir Usmanov 1790739b93 Add 'reg_var_decl' opcode 2014-07-24 15:45:55 +04:00
Ilmir Usmanov 764efa41b8 Fix parsing of for-loops. 2014-07-23 20:47:31 +04:00
Ruben Ayrapetyan 26c00acd50 Refinement of src/main.c. 2014-07-23 19:08:06 +04:00
Ilmir Usmanov e5cdf93d2d Dump script line before bytecode (Only on host). Fix parsing literals: assing literal to temp before usage. 2014-07-23 18:43:03 +04:00
Ilmir Usmanov d57da2aa8a Num literals outside of assignments (in lists) are not allowed 2014-07-23 17:52:02 +04:00
Ilmir Usmanov f264d24b5a Rewrite serializer and lexer: adjust nums' ids, dump strings, nums and rewrites 2014-07-23 17:36:11 +04:00
Ilmir Usmanov 1b2a52da51 Parse blinky 2014-07-23 15:39:01 +04:00