Commit Graph

63 Commits

Author SHA1 Message Date
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
Ruben Ayrapetyan 3b29280b79 Using hash value stored in ecma-string for lcache search; comparing string faster but with possible false negatives while performing lcache lookup. 2014-11-28 21:27:48 +03:00
Ruben Ayrapetyan fe7e34d93e Adding ecma-string's hash to ecma_string_t. 2014-11-28 21:12:44 +03:00
Ruben Ayrapetyan 6c65c48772 Removing 'length' field from ecma-string descriptor (calculating length upon request). 2014-11-28 16:26:22 +03:00
Ruben Ayrapetyan 036521627e Introducing "on-stack" ecma-string descriptors and using them in get_variable_value / set_variable_value. 2014-11-21 13:06:30 +03:00
Ruben Ayrapetyan fb6bdd151a Moving part of ecma_compare_ecma_strings to ecma_compare_ecma_strings_longpath. 2014-11-18 17:28:03 +03:00
Ruben Ayrapetyan fd155d4699 Fixing calculation of ecma-string's hash in ecma_string_try_hash. 2014-11-17 20:19:38 +03:00
Ruben Ayrapetyan 76ed780895 Introducing cache for property by name lookup (LCache). 2014-11-17 18:52:48 +03:00
Ruben Ayrapetyan 8a6eae0ca5 Reordering comparisons in ecma_compare_ecma_strings to improve performance for frequent cases. 2014-11-17 18:52:38 +03:00
Ruben Ayrapetyan dd1e9ca3e4 Improving performance of ecma_is_string_magic. 2014-11-14 14:40:30 +03:00
Ruben Ayrapetyan 477a694622 Introducing ECMA_GET_NON_NULL_POINTER macro that is ECMA_GET_POINTER without NULL pointer check.
Replacing invocations of ECMA_GET_POINTER passing non-NULL argument with introduced ECMA_GET_NON_NULL_POINTER.
2014-11-13 19:09:13 +03:00
Ruben Ayrapetyan 8a5b1148bc Storing magic string identifier in ecma-string descriptor instead of copying magic string's characters to the descriptor or to the heap. 2014-10-31 21:16:21 +03:00
Ruben Ayrapetyan 843305fb48 Fixing some assertions in src/libecmaobjects/ecma-helpers-string.c. 2014-10-31 20:51:02 +03:00
Ilmir Usmanov 8c7dc08d93 Add literals - replacements of strings and numbers in parser. 2014-10-31 21:22:52 +04:00
Ruben Ayrapetyan ed08fe9983 Full names of magic string identifiers in src/libecmaobjects/ecma-magic-strings.inc.h 2014-10-29 17:23:43 +03:00
Ruben Ayrapetyan 26012e098f Moving magic strings definitions to ecma-magic-strings.inc.h. 2014-10-28 16:30:42 +03:00
Ruben Ayrapetyan 459750b1d0 Implementing routine for copying ecma-string and using it to duplicate ecma-string upon it's reference counter overflow. 2014-10-28 14:52:40 +03:00
Ruben Ayrapetyan fc751b0f15 Arranging JERRY_UNIMPLEMENTED macro usages and adding comments to each invocation of the macro. 2014-10-27 19:48:03 +03:00
Ruben Ayrapetyan feedb37b20 Replacing way to specify ecma-char encoding and ecma-number type: instead of defining it like CONFIG_ECMA_NUMBER_FLOAT32 now it should be defined like CONFIG_ECMA_NUMBER_TYPE=CONFIG_ECMA_NUMBER_FLOAT32. 2014-10-23 18:33:10 +04:00
Ruben Ayrapetyan ed960b78db Introducing CompactProfileError built-in object. 2014-10-16 19:49:47 +04:00
Ruben Ayrapetyan c231893b28 Implementation of Number built-in object and partial implementation of Number.prototype built-in object.
Fixing [[Prototype]] and [[Class]] properties of Array and String built-in objects.
2014-10-16 13:25:47 +04:00
Ruben Ayrapetyan e8d728f8ce Fixing typeof for boolean arguments. 2014-10-15 18:02:10 +04:00
Ruben Ayrapetyan c4ba033970 Renaming ERR_MEMORY -> ERR_OUT_OF_MEMORY. 2014-10-14 14:08:38 +04:00
Ruben Ayrapetyan 6430a104b3 ecma_ref_ecma_string -> ecma_copy_or_ref_ecma_string: copying ecma-string when the string's reference counter reaches maximum value. 2014-10-13 18:59:07 +04:00
Ruben Ayrapetyan bef5289cb6 Adding stubs for Function and Function.prototype built-ins. 2014-09-26 19:26:17 +04:00
Ruben Ayrapetyan 2d332bc98b Implementing 'Object.prototype.toString' and 'Object.prototype.valueOf' built-ins. 2014-09-26 18:50:46 +04:00
Ruben Ayrapetyan a0a2ec2cea Replacing items of ecma_object_class_t with corresponding ecma magic strings. 2014-09-26 18:04:42 +04:00
Ruben Ayrapetyan caa2663b28 Adding magic strings for property names of built-in prototype objects. 2014-09-25 19:23:22 +04:00
Ruben Ayrapetyan c235021147 Implementing [[DefaultValue]] general objects' method. 2014-09-25 18:37:38 +04:00
Ruben Ayrapetyan 4c5c48eef2 Magic strings for Array built-in. 2014-09-25 14:18:07 +04:00
Ruben Ayrapetyan c4ec42635b Implementing String's constructor and [[GetOwnProperty]]. 2014-09-24 21:31:24 +04:00
Ruben Ayrapetyan 5f9a068a61 Adding magic strings for the Math object's properties names. 2014-09-22 21:34:11 +04:00
Ruben Ayrapetyan 1e642fd527 Implementing ToPropertyDescriptor and FromPropertyDescriptor ECMA operations. 2014-09-22 19:31:35 +04:00
Ruben Ayrapetyan d7314a7300 Adding stubs for the Object object. 2014-09-22 15:56:50 +04:00
Ruben Ayrapetyan d44b13e0cd Adding magic strings for the Global object's properties names. 2014-09-19 17:45:52 +04:00
Ruben Ayrapetyan f478e161e6 Fixing ecma_string_to_zt_string and ecma_copy_zt_string_to_buffer routines. 2014-09-19 16:15:42 +04:00
Ruben Ayrapetyan 7fc3b178d8 Introducing ecma_is_string_magic, ecma_init and ecma_finalize interfaces, 'magic-string' container type for ecma-strings. Renaming ecma_is_magic_string to ecma_is_zt_string_magic. Moving magic-string related routines to ecma-helpers-string.c. 2014-09-19 12:08:19 +04:00
Ruben Ayrapetyan 5a9d4563ec Fixing performance degradation that occured in commit 9b040f31d2a2e1e4d43dd347d5e81282997dd2b5. 2014-09-05 16:27:43 +04:00
Ruben Ayrapetyan 9acbaafc8e Implementing ecma-strings relational comparison helper. 2014-09-02 21:10:50 +04:00
Ruben Ayrapetyan 0a6e1a83f8 Renaming ecma_compare_ecma_string_to_ecma_string to ecma_compare_ecma_strings. 2014-09-02 20:16:41 +04:00
Ruben Ayrapetyan 11d772fda4 Implementing unimplemented cases in ecma comparison routines. 2014-09-02 19:57:55 +04:00
Ruben Ayrapetyan afc21fad8e Simple implementation of string concatenations comparison. 2014-09-02 13:31:56 +04:00
Ruben Ayrapetyan 4d9602ba0d Supporting string concatenations that are longer than 64k. 2014-09-01 22:11:54 +04:00
Ruben Ayrapetyan 813831a23b Decimal conversion of Number to zt-string (still not precise enough). Zt-string copy and length calculation helpers. 2014-09-01 21:12:02 +04:00
Ruben Ayrapetyan 23b62bce54 Replacing doxygen header for ECMA modules 'addtogroup ecma ---TODO---' -> 'addtogroup ecma ECMA'. 2014-08-29 18:35:44 +04:00
Ruben Ayrapetyan 16cbe0c63b Removing try_get_string_by_idx and get_number_by_idx. 2014-08-28 21:19:44 +04:00
Ruben Ayrapetyan c72555d25f Introducing new type of ecma-string: concatenation of two ecma-strings (comparison is not implemented). loop_arithmetics_1kk.js: 2.8968 -> 2.8464. 2014-08-26 11:11:20 +04:00
Ruben Ayrapetyan d0963f6d3d Fixing deref and comparison for uint32-represented ecma-strings. loop_arithmetics_1kk.js: 2.8448 -> 2.9056. 2014-08-26 11:06:06 +04:00
Ruben Ayrapetyan 2194f80d71 Revert "Fixing deref and comparison for uint32-represented ecma-strings."
This reverts commit c3adae65625c4fcf25049a3a67e1f1862b443c35.
2014-08-26 11:05:19 +04:00
Ruben Ayrapetyan 6ca0942b74 Fixing deref and comparison for uint32-represented ecma-strings. 2014-08-26 10:26:47 +04:00