Commit Graph
40 Commits
Author SHA1 Message Date
Dániel Bátyai f7391a94ae Cleanup Valgrind macros (#3180)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-10-01 14:26:56 +02:00
Dániel Bátyai 6221b670d1 Keep GC object list in the order of traversal (#3087)
By appending to the end of the black object list during garbage
collection, the resulting object list will be sorted in the order of
traversal. This allows subsequent gc runs to mark surviving sub-trees in
a single iteration.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-09-11 10:54:03 +02:00
Dániel Bátyai 115ad9a41c Fix JSON.stringify for non-serializable properties (#3083)
Fixes #3082.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-09-08 23:49:27 +02:00
Dániel Bátyai 8bccbbf08f Refactor JSON builtin methods (#3031)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-09-05 01:25:19 +02:00
Dániel Bátyai e3c1451d42 Add missing Valgrind macros to jmem (#3025)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-08-28 14:59:06 +02:00
Dániel Bátyai 5fa0a690eb Look up the previous block again after a GC in jmem_heap_realloc_block (#3021)
Garbage collection can create new free blocks in the heap structure as
it releases memory, so the previous block needs to be looked up again
if a GC happens during a realloc.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-08-28 14:58:35 +02:00
Dániel Bátyai 996459714c Add string builder helper (#2999)
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 [email protected]
2019-08-26 15:57:03 +02:00
Dániel Bátyai ddd48b30f0 Don't run Coverity as the last task on Travis (#3017)
Follow-up after #3008

Having Coverity as the last task is fine for pull requests, but on the
master branch, where the task actually performs the scans, it can have a
large delay on the builds.

This change moves the Coverity task back to the middle ground, and puts
the ESP8266 build as the last, which seems to always run fast. This saves a
few extra minutes of build time on the master branch.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-08-17 08:47:29 +02:00
Dániel Bátyai d29364c34e Update Zephyr build on Travis (#3018)
Follow-up after #3015

The fix backport has landed, and the branch has been deleted. Revert back to
the the v1.14 branch.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-08-16 19:05:40 +02:00
Dániel Bátyai 3c69dfab2c Fix Zephyr build on Travis (#3015)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-08-13 15:50:10 +02:00
Dániel Bátyai a834288096 Speed-up Travis builds (#3008)
This PR reduces the time it takes for Travis to complete the checks.
The following changes are made:
  - Disabled LTO for test builds
  - Merged Debugger tests into x86-64 Conformance tests
  - Moved the INIT_FINI unittests into the regular unittests
  - Merged SonarQube and Coverity Scan tasks
  - Re-arranged some of the tasks

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-08-07 18:34:45 +02:00
Dániel Bátyai 566e81451e Add realloc function to jmem (#2998)
This patch extends jmem functionality by adding a realloc function.
This opens up other paths of optimization which can result in smaller
peak memory usage and faster execution times, due to not having to
duplicate memory when we need to extend blocks.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-08-06 17:59:49 +02:00
Dániel Bátyai 3b7475b01d Add build option for changing the heap limit (#3005)
This change adds a build option that allows adjusting the garbage
collection heap usage limit, which can be used to fine-tune how often
garbage collection should be triggered.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-08-06 13:35:26 +02:00
Dániel Bátyai dfafb1aa6b Fix unhandled exceptions with unicode error messages (#2994)
Fixes #2993

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-07-30 19:48:56 +02:00
Dániel Bátyai a2d242eab9 Use python3 for mbedOS build on Travis (#2995)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai [email protected]
2019-07-30 16:46:16 +02:00
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