Commit Graph
25 Commits
Author SHA1 Message Date
Dániel Bátyai 6744376bbe Add Configuration doc to the README (#2988)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-07-25 20:33:20 +02:00
Dániel Bátyai d3c78d8c6a Improve lastIndex calculation in RegExp match (#2982)
Co-authored-by: Marko Fabo <[email protected]>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-07-25 18:20:51 +02:00
Dániel Bátyai 5d6eebac4c Add documentation for configuration options (#2977)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-07-23 15:32:41 +02:00
Dániel Bátyai ec11a7b4e9 Resolve module paths relative to the current module (#2976)
The current module implementation resolves module paths relative to the
current working directory, but paths should be resolved relative to the
currently evaluated module/source.

This requires a change in the jerry_port_normalize_path port API
function, so that it also takes the current module path as an argument.
On the engine side, we now also create a module object for the main
script, so that we can properly identify the base path for other
modules.

Co-authored-by: Marko Fabo <[email protected]>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-07-17 14:44:18 +02:00
Dániel Bátyai ff22634e27 Refactor memory management (#2954)
This PR is a general cleanup for garbage collection and memory
allocation code paths.

Changes:
  * Removed an unnecesary local variable from 'ecma_gc_mark'.
  * Refactored 'ecma_gc_run' to have an implicit list head during
    iteration, which results in one less condition in the loops,
    and changed the loops to use compressed pointers to reduce the
    overall amount of compression/decompression.
  * Renamed 'jmem_free_unused_memory_severity_t' to 'jmem_pressure_t',
    and added additional values.
  * Removed 'jmem_free_unused_memory_callback', instead
    'ecma_free_unused_memory' is now called directly.
  * Reworked 'ecma_free_unused_memory' to handle all code paths related
    to 'jmem_pressure_t', and moved all relevant code paths into this
    function. This simplifies the code paths in other places.
  * Reworked 'jmem_heap_gc_and_alloc_block' to be more streamlined.
  * Changed mem-stats to not report unused pool chunks as allocated
    memory.
  * Created an allocator internal API for allocating/freeing memory blocks
    that are not reported as used memory in mem-stats.
  * Removed iteration statistics for the jerry allocator from mem-stats,
    as they don't provide any actually useful information.

Co-authored-by: Marko Fabo <[email protected]>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-07-17 14:12:23 +02:00
Dániel Bátyai a44d584842 Fix 'eval' checking in import/export statements. (#2978)
Fixes #2975

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-07-17 14:11:13 +02:00
Dániel Bátyai 75728980a3 Fix mbedos5 build on Travis (#2974)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-07-15 20:21:00 +02:00
Dániel Bátyai c304b9a38a Include file path in Syntax error messages (#2941)
When using ES6 modules it was not possible to identify which module
an error originates from.

This PR changes the error message to also include the file path using
the file:line:column format, and updates the source context printing for
unhandled exceptions to use the correct file.

Co-authored-by: Marko Fabo <[email protected]>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-07-11 12:33:02 +02:00
Dániel Bátyai 04d5d56a68 Fix URLs in the repository after organization switch (#2955)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-07-09 19:13:57 +02:00
Dániel Bátyai cbd41df5eb Module sources should be parsed in strict mode (#2920)
Co-authored-by: Marko Fabo <[email protected]>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-06-24 08:14:34 +02:00
Dániel Bátyai 3953fee035 Correctly propagate errors when parsing modules (#2907)
Fixes #2896.

Co-authored-by: Marko Fabo <[email protected]>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-06-14 03:29:26 -04:00
Dániel Bátyai 0ba2d17faf Fix heap limit calculation when using the system allocator. (#2872)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-05-17 11:28:00 +02:00
Dániel Bátyai 9a512c8fcf Properly release property name collection in for-in opcode handler (#2875)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-05-16 15:34:41 +02:00
Dániel Bátyai fd3e982e69 Fix ecma collection header deallocation (#2874)
Collection headers are allocated using the pool allocator, so they
should be freed by it as well.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-05-14 14:10:39 +02:00
Dániel Bátyai 4bdc3a1c46 Implement path normalization in port-default (#2861)
Updated the default port so that it now provides path normalization for
common platforms.

Co-authored-by: Marko Fabo <[email protected]>
JerryScript-DCO-1.0-Signed-off-by: Marko Fabo [email protected]
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-05-09 18:31:58 +02:00
Dániel Bátyai 57f08ee70e Add NuttX specific port implementation. (#2864)
The NuttX target has been problematic for some time, due to the fact
that NuttX apps are built with NuttX's own libc implementation, while
the default-port in JerryScript was compiled with the host libc, which
caused a mismatch between the two.

In order to work around this issue, most of the port implementation is already
duplicated in the NuttX target's jerry_main.c.

This PR adds a NuttX specific port implementation by moving the already
implemented port functions from jerry_main into a separate file, adding
implementation for the missing functions, and disabling the default-port
in JerryScript.

Co-authored-by: Marko Fabo <[email protected]>
JerryScript-DCO-1.0-Signed-off-by: Marko Fabo [email protected]
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-05-09 16:33:25 +02:00
Dániel Bátyai 3ec6b68063 Clear top module context after local variables have been imported (#2859)
This fixes an assertion failure which was caused by incorrectly importing
the same variables multiple times.

Co-authored-by: Marko Fabo <[email protected]>
JerryScript-DCO-1.0-Signed-off-by: Marko Fabo [email protected]
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-05-06 17:35:33 +02:00
Dániel Bátyai 1cdb3c6c56 Fix identifier handling inside export statements (#2843)
Fixes #2842

Co-authored-by: Marko Fabo <[email protected]>
JerryScript-DCO-1.0-Signed-off-by: Marko Fabo [email protected]
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-04-30 10:53:48 +02:00
Dániel Bátyai 01dd2f0b2a Clean up radix conversion in Number toString method (#2002)
The radix conversion code path was very messy which made it hard to understand
what was happening inside of it. The code got cleaned up, and a lot of comments
were added that explain what is happening and why.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2017-09-06 10:56:29 +02:00
Dániel Bátyai 3354da3021 Optimize ecma_string_get_array_index
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2016-07-15 10:53:20 +02:00
Dániel Bátyai 3203613b07 Add some asserts to check heap structure consistency
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2016-04-22 13:59:34 +02:00
Dániel Bátyai e191794118 Print unhandled errors in REPL mode
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2016-04-14 14:01:47 +02:00
Dániel Bátyai 1ae05eda64 Add help flag and usage to UNIX Jerry standalone.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2016-04-11 15:30:57 +02:00
Dániel Bátyai 764229b262 Fix syscall assertion when input file does not exist
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2016-04-11 14:34:08 +02:00
Dániel Bátyai d47c36f1b4 New Allocator and improved String handling.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2016-03-01 10:44:35 +01:00