100 Commits
Author SHA1 Message Date
Ilmir Usmanov 7e7bdc2aac Rework literal indexes hash table to simple array in order to improve performance 2014-12-15 22:56:22 +03:00
Ilmir Usmanov 864bd3de06 Fix comment. 2014-12-15 22:47:41 +03:00
Ilmir Usmanov ddac13f944 Fix parsing of empty file 2014-12-15 17:10:04 +03:00
Ilmir Usmanov c1ebb8db50 Fix expression statement parsing in case of statement starts with keyword 2014-12-12 16:36:18 +03:00
Ilmir Usmanov 6aee69d6df Fix native_call opcode dumping 2014-12-12 16:34:59 +03:00
Ilmir Usmanov 4b7871bdde Fix 'op=' assignment bytecode dumping in case of arrays 2014-12-10 19:20:33 +03:00
Ilmir Usmanov dc8ab27900 Split parser into parser itself, opcodes dumper and syntax errors checker.
Add internal hash map of literal indexes:
  In this hash map key is pair of block number and literal's unique identifier in the block, and the value is a literal index that unique in the whole program.
  Block is a continues array of opcodes. So, bytecode is splitted into blocks.
  Each block has its own uid counter. To get literal index the interpreter looks up it in the hash map.
  Thus, now JS program is able to have more than 255 identifiers/string literals.
  The first 128 (0-127) uids are reserved for block's uid counter, the other 128 (128-255) are reserved for tmp variables.
2014-12-10 18:31:59 +03:00
Ilmir Usmanov fc9e83d290 Remove obsolete unit tests. 2014-12-10 18:29:43 +03:00
Ilmir Usmanov a251bf5d6f Add array list structure.
Change hash table to use array lists instead of linked lists.
2014-12-10 18:27:36 +03:00
Ilmir Usmanov 8c7dc08d93 Add literals - replacements of strings and numbers in parser. 2014-10-31 21:22:52 +04:00
Ilmir Usmanov d8acb0b6e2 'undefined' is not literal, so dump it as identifier. 2014-10-30 19:48:06 +04:00
Ilmir Usmanov d5878132cc Dump 'use strict' prior to reg_var_decl. 2014-10-30 18:17:41 +04:00
Ilmir Usmanov 4735570b31 Add SyntaxErrors on parsing ObjectDeclarations. 2014-10-28 13:39:25 +04:00
Ilmir Usmanov cd8ab6594b Fix test262 runner script 2014-10-27 18:08:22 +04:00
Ilmir Usmanov 7d13970e95 Fix compiling several input files 2014-10-27 15:27:25 +04:00
Ilmir Usmanov a55517f57a Remove 'logical_or' and 'logical_and' opcodes 2014-10-27 14:55:02 +04:00
Ilmir Usmanov f163f9f5da Allocate memory for string literals and identifiers dinamically. 2014-10-23 17:04:36 +04:00
Ilmir Usmanov 6b06cef1c8 Property getters and setters also create scope 2014-10-22 14:26:14 +04:00
Ilmir Usmanov ec6572d501 Add support of function expressions scopes. Uncomment tests. 2014-10-21 22:22:04 +04:00
Ilmir Usmanov 62a42fa087 Add fail tests. Fix parser. 2014-10-21 20:35:07 +04:00
Ilmir Usmanov 3f7fca4d39 Implement full support of strict mode in parser. 2014-10-20 16:54:40 +04:00
Ilmir Usmanov bd7fd40a32 Fix 'function' declaration parsing 2014-10-16 21:12:03 +04:00
Ilmir Usmanov 99d21743b0 Fix tests from test-suite 2014-10-16 20:42:24 +04:00
Ilmir Usmanov b1e6656fb4 Fix property increment 2014-10-16 20:32:19 +04:00
Ilmir Usmanov 90789453ba Fix 'prototype' property. 2014-10-16 18:07:56 +04:00
Ilmir Usmanov 2a5cbe5975 Fix tests from jerry-test-suite. 2014-10-16 18:03:35 +04:00
Ilmir Usmanov 2637911b3e Fix 'this_arg' 2014-10-16 16:05:48 +04:00
Ilmir Usmanov 16556eb830 Fix 'switch' bytecode generation. Remove __strtof. Fix opcodes pretty-printing. 2014-10-16 15:33:54 +04:00
Ilmir Usmanov 6b733b8cd2 Fix 'continue' bytecode generation. Fix tests. 2014-10-15 21:04:00 +04:00
Ilmir Usmanov e1e7752a62 Fix bytecode generation of binary expressions. Fix bytecode generation of query operator. Fix tests. 2014-10-15 20:08:43 +04:00
Ilmir Usmanov 49d990ad32 Allow some of FutureReservedWords in non-strict mode 2014-10-15 17:53:19 +04:00
Ilmir Usmanov 77d56c5f93 Fix function end meta in property setter and getter 2014-10-15 17:15:43 +04:00
Ilmir Usmanov af5cf79d3c Use tmps as property names 2014-10-15 16:40:56 +04:00
Ilmir Usmanov a9856dcf9a Add support of NaN in opfunc_unary_minus 2014-10-15 15:33:00 +04:00
Ilmir Usmanov 032031a861 Add unary_plus and unary_minus opcodes 2014-10-15 15:20:49 +04:00
Ilmir Usmanov 819361c234 Fix postfix expression parsing 2014-10-15 14:33:39 +04:00
Ilmir Usmanov a49b52105e Fix generation of this_arg. Fix pretty-printing of retval, prop_setter, prop_getter and string assignments 2014-10-15 12:57:11 +04:00
Ilmir Usmanov c8686d9d9b Fix test 2014-10-15 10:53:40 +04:00
Ilmir Usmanov 7a156334bb Fix vargs pretty-printing 2014-10-15 10:53:40 +04:00
Ilmir Usmanov 948c74b4b9 Os by default. 2014-10-14 22:06:04 +04:00
Ilmir Usmanov 562f877328 Remove end-of-file marker and fix lsr's operands. 2014-10-14 22:02:02 +04:00
Ilmir Usmanov 9be0a85c1c Fix 'while' bytecode generation 2014-10-14 16:55:09 +04:00
Ilmir Usmanov 64e286f766 Enable pretty-printer only on host and debug 2014-10-14 15:06:21 +04:00
Ilmir Usmanov 053cbc769f Fix alignment: part 2 2014-10-14 15:06:21 +04:00
Ilmir Usmanov 85ad5f8350 Fix alignment 2014-10-13 21:42:25 +04:00
Ilmir Usmanov 8a517ab03e Add support of octal integer literals 2014-10-13 17:45:20 +04:00
Ilmir Usmanov c33afca360 Add support of 'default' clause in 'switch' statement 2014-10-13 16:32:17 +04:00
Ilmir Usmanov 18618c6501 Freaking FINALLY: postparser 2014-10-12 20:34:23 +04:00
Ilmir Usmanov 63662dfb35 Postparser landing patch: add tree of scopes 2014-10-12 20:34:23 +04:00
Ilmir Usmanov cb7e54fe22 Preparser landing patch: refactor linked-list 2014-10-12 20:34:22 +04:00
Ilmir Usmanov cd67b69bf9 Fix integer overflow while parsing numbers 2014-10-10 20:22:08 +04:00
Ilmir Usmanov 5c6dbd1466 Allow absent of semicolon before '}' token 2014-10-10 19:05:37 +04:00
Ilmir Usmanov 19d0690586 Support properties named 'get' and 'set' 2014-10-10 18:27:28 +04:00
Ilmir Usmanov e91cb75dcc Fix locus of strings 2014-10-10 17:14:48 +04:00
Ilmir Usmanov 64a0d8a8b0 Fix error message on for-in loops 2014-10-10 14:57:56 +04:00
Ilmir Usmanov 2c90f8a7f1 Fix break and continue generation 2014-10-09 20:55:16 +04:00
Ilmir Usmanov 9cd4344c4e Fix for loop parsing 2014-10-09 19:58:13 +04:00
Ilmir Usmanov eeb497b84b Fix if-else without braces 2014-10-09 19:41:42 +04:00
Ilmir Usmanov 29c734d95d Reuse tmps in vargs 2014-10-09 18:28:28 +04:00
Ilmir Usmanov a902a97025 Add another 'out of memory' error message 2014-10-09 17:49:02 +04:00
Ilmir Usmanov bfa186d43a Generate only one var_decl opcodes for each variable declared in a scope 2014-10-09 15:30:30 +04:00
Ilmir Usmanov 29ffa6f777 Pretty-printer refactoring. Add pretty-printing of metas. 2014-10-09 13:19:36 +04:00
Ilmir Usmanov 1dd94c12b2 Fix insert_semicolon 2014-10-08 19:15:25 +04:00
Ilmir Usmanov 24920cba57 Fix property names parsing 2014-10-08 17:09:02 +04:00
Ilmir Usmanov c3f493c693 Some minor fixes in parser: Do not warn on escape sequences. Allow 'new' operator without parens. Fix 'var' parsing in preparser. Fix a test. 2014-10-08 16:32:36 +04:00
Ilmir Usmanov 9775d23274 Support 'delete' and 'void' operators in parser. 2014-10-08 14:52:38 +04:00
Ilmir Usmanov 3d3da5d481 Preparser: new pass to order var_decls prior to parser 2014-10-07 20:14:41 +04:00
Ilmir Usmanov 62cc3cc604 Fix && and || parsing 2014-10-06 14:35:26 +04:00
Ilmir Usmanov 17ee2eca50 Warn on escape sequences 2014-10-06 14:35:26 +04:00
Ilmir Usmanov 3d5fd214f3 Add switch-case 2014-10-06 14:35:26 +04:00
Ilmir Usmanov 8c7daf4850 Print ERR_MEMORY on stack 2014-10-06 14:35:26 +04:00
Ilmir Usmanov d3dc64ca53 Pretty-print native_calls 2014-10-06 14:35:26 +04:00
Ilmir Usmanov 3819883f80 Add human-readable syntax errors 2014-10-03 19:01:45 +04:00
Ilmir Usmanov c4c713535e Fix insert_semicolon 2014-10-02 21:35:39 +04:00
Ilmir Usmanov af00691d1d Add this_arg dumping in parser 2014-10-02 19:31:29 +04:00
Ilmir Usmanov eff5e1a80b Fix stack operations in parser 2014-10-02 15:04:00 +04:00
Ilmir Usmanov c8b97214fe Parse undefined as simple 2014-10-01 14:30:04 +04:00
Ilmir Usmanov 6561c3fe6c Add support of array initialization like [1,,,'4'] 2014-09-30 19:44:45 +04:00
Ilmir Usmanov 9d129e15dc Allocate stack memory by chunks 2014-09-30 18:40:24 +04:00
Ilmir Usmanov cde880b1cf Fix 'break' parsing 2014-09-25 18:06:21 +04:00
Ilmir Usmanov 42876bdc8f Add support of native calls 2014-09-25 15:57:57 +04:00
Ilmir Usmanov 05a2224faa Fix parsing of assignment expressions without assignment operator. 2014-09-24 16:53:58 +04:00
Ilmir Usmanov 0a4616b65f Remove call_0, call_1, func_decl_0, func_decl_1, func_decl_2 opcodes. 2014-09-24 16:33:28 +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 615903dbf5 Fix call expression without args bytecode generation 2014-09-22 20:21:44 +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 d4cd8be349 Fix asserts in opfunc_*jmp_down functions. 2014-09-16 22:36:26 +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
Ilmir Usmanov a2fe594d0f Merge branch 'geppetto' 2014-08-19 16:22:39 +04:00
Ilmir Usmanov 126b8814a8 Add rules to check switch-cases 2014-08-19 16:22:05 +04:00
Ilmir Usmanov 2e1da4cae5 Quickfix N2 2014-08-12 22:48:24 +04:00
Ilmir Usmanov 6f41c1c59b Quickfix 2014-08-12 22:30:24 +04:00
Ilmir Usmanov bbde9f4180 Merge branch 'geppetto' 2014-08-12 22:27:32 +04:00
Ilmir Usmanov 0a68baa479 Add support of floating-point literals 2014-08-12 22:27:12 +04:00
Ilmir Usmanov bca7f7f095 Merge branch 'geppetto' 2014-08-11 23:18:06 +04:00