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
A list of changes:
- 'es2015-subset' profile is deprecated, and an 'es.next' profile is added.
- The default profile is changed to 'es.next'
- Renamed the JERRY_ES2015 guard to JERRY_ESNEXT
- Renamed JERRY_ES2015_BUILTIN_* guards to JERRY_BUILTIN_*
- Moved es2015 specific tests to a new 'es.next' subdirectory
- Updated docs, targets, and test runners to reflect these changes
Resolves#3737.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This change includes several bugfixes, general improvements, and support
for additional features.
- Added full support for web compatibility syntax defined in Annex B
- Implemented parsing and matching patterns in unicode mode
- Fixed capture results when iterating with nested capturing groups
- Significantly reduced regexp bytecode size
- Reduced stack usage during regexp execution
- Improved matching performance
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
Currently, collections use object based solutions for storing elements and
iterating on them. If an element is deleted and re-inserted, the storage
position is the same as before so the iteration order is wrong.
This patch replaces the object based storage with an array based solution
that helps to store and iterate elements as expected.
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs@inf.u-szeged.hu
Also removed the ecma_append_magic_string_to_string method,
because it doesn't get used anymore.
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
A large rework because surrogate pairs must be combined.
Currently only the 0x10C80..0x10CF2 is accepted as valid identifier character from the non-basic plane.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
The algorithm is based on ECMA-262 v6, 21.2.5.6
The following helper methods are also implemented:
- RegExpExec: ECMA-262 v6, 21.2.5.2.1
- AdvanceStringIndex: ECMA-262 v6, 21.2.5.2.3
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
All the basic language element guards are merged into JERRY_ES2015 macro guard.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
We should emit function symbols for these jerry-core functions:
- ecma_compare_ecma_strings is used by test-stringbuilder.c
- ecma_is_value_number is used by test-literal-storage.c
- ecma_date_time_within_day is used by test-date-helpers.c
- jmem_heap_alloc_block is used by test-jmem.c
- jmem_heap_free_block is used by test-jmem.c
- jmem_pools_alloc is used by test-poolman.c
- jmem_pools_free is used by test-poolman.c
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
We should emit function symbols for ecma_get_magic_string
function, because it is used by unit-test-stringbuilder.c.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
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
Created a new trim helper function which is used in every situation where we need to trim a string
Co-authored-by: Tibor Dusnoki tdusnoki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
Also this patch introduces several helper function to find/put/delete properties by indexed property names to reduce code duplications.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This change adds a new string builder type, that can be used to construct
strings internally by appending various types of other strings.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
This patch reworks the core of the builtin Map object.
Advantages:
- Provide sublinear access time for the elements via Lcache and property hashmap
- This implementation is suitable for the builtin Set object as well
Also add the missing 'forEach' routine for the builtin object as well.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
There are quite a few configuration macros in the project.
As discussed in the #2520 issue there are a few awkward constructs.
Main changes:
* Renamed all CONFIG_DISABLE_<name>_BUILTIN macro to JERRY_BUILTIN_<name> format.
* The special JERRY_BUILTINS macro specifies the basic config for all es5.1 builtins.
* Renamed all CONFIG_DISABLE_ES2015_<name> to JERRY_ES2015_<name> format.
* The special JERRY_ES2015 macro specifies the basic config for all es2015 builtins.
* Renamed UNICODE_CASE_CONVERSION to JERRY_UNICODE_CASE_CONVERSION.
* Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE.
* All options (in this change) can have a value of 0 or 1.
* Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE.
JERRY_REGEXP_STRICT_MODE is set to 0 by default.
* Reworked CONFIG_ECMA_NUMBER_TYPE macro to JERRY_NUMBER_TYPE_FLOAT64 name and now
it uses the value 1 for 64 bit floating point numbers and 0 for 32 bit floating point
number.
By default the 64-bit floating point number mode is enabled.
* All new JERRY_ defines can be used wit the `#if ENABLED (JERRY_...)` construct to
test if the feature is enabled or not.
* Added/replaced a few config.h includes to correctly propagate the macro values.
* Added sanity checks for each macro to avoid incorrectly set values.
* Updated profile documentation.
* The CMake feature names are not updated at this point.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This patch contains the base functionalities that the new builtin object requires.
Currently unavailable:
- print (Symbol('foo')) - this features requires the refactor of the print handler function
- Several global symbol based builtin routines (follow up patch)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Fixes#2451Fixes#2452Fixes#2453
Co-authored-by: Robert Fancsik <frobert@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
It is superfluous to maintain multiple globals when the whole
reason of context is to keep them in a single place. It also
simplifies initialization and external context creation a bit.
Also removed unused lcache header includes.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
There are some leftover global functions in the code that are not
referenced at all anymore. These functions are removed by this
patch.
There are also some global functions that are only used in their
own modules. These functions are made static by this patch.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
When the `jerry_substring_to_utf8_char_buffer` was called
with direct strings the assert incorrectly assumed that the
string is a ref counted string and tried to access the
refcount value resulting in a failed assert.
Added direct string check for the underlying implementation
and created a test case for such simple string.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
`JERRY_UNREACHABLE`s often signal code structure that could be
improved: they can usually either be rewritten to `JERRY_ASSERT`s
or eliminated by restructuring loops, `if`s or `#if`s. Roughly,
the only valid occurences are in default cases of `switch`es. And
even they can often be merged into non-default cases.
Moreover, it is dangerous to write meaningful code after
`JERRY_UNREACHABLE` because it pretends as if there was a way to
recover from an impossible situation.
This patch rewrites/eliminates `JERRY_UNREACHABLE`s where possible
and removes misleading code from after them.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
A lot of warnings remained hibben because 'EXTRACT_ALL' was previously set to YES.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
In general, public headers should not have compiler-specific
constructs but both the core and the port headers have attributes,
which are non-standard. It's better to factor out such constructs
to a common place (a new header) and hide them behind macros, which
can then be defined on a per-compiler basis.
This patch moves the existing definitions of function attributes and
likely/unlikely builtins to the new header. At the same time, it
unifies the names of these attribute defines and where they are
used. Moreover, it touches on jerry-main and removes the uses of
`__attribute__((unused))` entirely and replaces them with the
elsewhere used `(void) ...` pattern.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
In the `ecma_string_get_chars` method
the contents of a direct string is accessed incorrectly.
It tries to extract the magic string id from the
string pointer but the direct string does not need
this step.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com