20 Commits

Author SHA1 Message Date
Robert Fancsik
39cb67397d
Remove the usage of ecma_length_t (#4009)
Now the following conventions are applied:
 - passing the number of arguments for a function call is always uint32_t
 - string size/length/position related operation should use lit_utf8_size_t
 - Extended objects internal fields must be uint32_t

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-20 16:36:27 +02:00
Robert Fancsik
91e87fe34f Fix the limit of the maximum number of directly stored properties in a hashmap (#3032)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-03 17:46:47 +02:00
Robert Fancsik
c6a4a86257
Improve ecma_string_t descriptor (#3016)
This patch introduces several changes conntect to ecma-strings:
 - Extend the size of the reference counter to 28 bytes from 13
 - Extend the size of the string hash to 32 bytes from 16 to use the extact FNV-1a hash
 - Introduce ECMA_STATIC_STRING_FLAG to reduce the number of string ref/derefs for static strings.
 - Introduce ECMA_STRING_CONTAINER_ASCII_STRING to store run-time allocated ASCII strings more efficiently
 - Remove ECMA_STRING_CONTAINER_LIT_NUMBER to half the storage size of the parsing time allocated floating point numbers
 - Rework the global number storage, to store only the floating point numbers
 - Optimize the lookup in the global number/string/symbol tables via reduce the number of NULL checks during decompressing the next element pointers
 - Reduce the code duplication in ecma_concat_ecma_strings and ecma_append_chars_to_string
 - Improve ecma_string_get_char with optional arguments to make it more reusable.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-08-30 15:16:27 +02:00
Akos Kiss
a2645601ae Remove character pointer typedefs (#2492)
The `[jerry|ecma]_char_ptr_t` types are some old legacy that are
used quite inconsistently. Their `[jerry|ecma]_char_t *` variants
are used a lot more often, so it's better to stick to one form
throughout the code base.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-08-30 09:33:05 +02:00
Tilmann Scheller
0511091e8a Streamline copyright notices across the codebase. (#1473)
Since the project is now hosted at the JS Foundation we can move to unified copyright notices for the project.

Starting with this commit all future contributions to the project should only carry the following copyright notice (except for third-party code which requires copyright information to be preserved):

"Copyright JS Foundation and other contributors, http://js.foundation" (without the quotes)

This avoids cluttering the codebase with contributor-specific copyright notices which have a higher maintenance overhead and tend to get outdated quickly. Also dropping the year from the copyright notices helps to avoid yearly code changes just to update the copyright notices.

Note that each contributor still retains full copyright ownership of his/her contributions and the respective authorship is tracked very accurately via Git.

JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
2016-12-08 06:39:11 +01:00
Zoltan Herczeg
6d67b8dff9 Reduce memory consumption of property names.
Property names were always required a string reference which consumed
a large amount of memory for arrays. This patch reduces this consumption
by directly storing the value part of certain strings.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-11-25 05:47:01 -08:00
Zoltan Herczeg
6f1ce8d6bb Improve the construction of "length" built-in strings.
The "length" property name is the most frequently used built-in string
and also frequently created by various hot-paths. New functions are
added to improve the speed of the "length" string creation.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-07-13 23:36:27 -07:00
László Langó
9bce5b09a9 Update Jerry API
* Removed jerry_string_t and jerry_object_t
* Updated function names
* Updated return values
* Updated function descriptions
* Added new functions
* Added new unittests

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-11 09:01:29 +02:00
Zoltan Herczeg
e9a47aff95 Sixteen bit hash for strings.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-06-27 03:04:50 -07:00
Robert Sipka
7a88ddec08 Remove the unused LIT_STRING_HASH_LAST_BYTES_COUNT define macro
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-04-14 15:54:11 +02:00
Akos Kiss
7a07e55411 Unify the naming scheme of all header defines
There have been several renamings of header files but the
ifndef/define/endif preprocessor directives did not always follow
the file name changes (or perhaps never followed a unified naming
scheme). This patch gets all headers aligned with the style of the
majority.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-03-10 11:26:14 +01:00
Dániel Bátyai
d47c36f1b4 New Allocator and improved String handling.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2016-03-01 10:44:35 +01:00
Xin Hu
87a7887a81 Replace uint32_t magic string lengths with uint8_t
JerryScript-DCO-1.0-Signed-off-by: Xin Hu Xin.A.Hu@intel.com
2016-02-05 11:31:54 +01:00
Roland Takacs
21f561f8ef Refactor literal-storage to not use C++ features
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
2016-01-13 15:19:07 +01:00
Dániel Bátyai
dcd610b305 Change internal encoding of strings to CESU-8
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-10-15 13:39:00 +02:00
Andrey Shitov
ae3eea8ae8 Add functions for iterating utf-8 strings.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-07-03 13:24:27 +03:00
Ruben Ayrapetyan
e8659f373c Rename ECMA_CHAR_NULL to LIT_CHAR_NULL, move it to jerry-core/lit/lit-char-helpers.h.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-02 17:38:34 +03:00
Andrey Shitov
fd9ff8e3bd Add core unicode functionality.
Add utf-8 processing routines.
Change ecma_char_t from char/uint16_t to uint16_t.
Apply all utf-8 processing routines.
Change char to jerry_api_char in API functions' declarations.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-29 23:27:58 +03:00
Andrey Shitov
c4b0cd2196 Change ecma_length_t and jerry_api_length_t from uint16_t to uint32_t.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-29 23:27:58 +03:00
Andrey Shitov
a0c5974ab8 Move char type definitions and magic string processing functions to literal component.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-29 23:27:58 +03:00