- Enable recursive GC marking with a limited recursion count (this option is configurable)
- No need to decrease the reference count of the gray objects anymore
- Bound function object marking is seperated into a helper function
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Previously the #line macro directives were always included in the
generated single source output. However, this adds quite a lot of
size to the source file (not to the binary) and it is only useful
for the library developers. Hence, it is now disabled by default.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
Changes:
- Implemented jerry_port_get_local_time_zone_adjustment on Windows
- Implemented jerry_port_get_current_time on Windows
- Run test262 tests on Windows in PST/PDT timezone
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
subprocess.Popen needs universal_newlines=True parameter
to open the file in text mode instead of binary mode.
With this fix readline() returns str instead of bytes.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
MSVC doesn't support library constructor/destructor, let's disable
the related unittest and clarify the documentation and error messages.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
Changes:
* Bash based unittest runner replaced with a python runner
* Typo fixed in doctest cmake build system (python executable)
* run-tests.py prints error message if build fails
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
Changes:
- gen-doctest.py: Use slashes in paths to make cmake happy.
- unit-doc/CMakeLists.txt: Don't add invalid arguments to MSVC and call gen-doctest.py properly.
- build.py: Build and install with cmake calls on Windows.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@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
- Added pylint and python-serial to apt-get-install-deps.sh.
- Make Jerry debugger import python serial module only if needed.
- Check-pylint.sh warns if pylint isn't installed.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
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 dbatyai@inf.u-szeged.hu
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 dbatyai@inf.u-szeged.hu
Detected and fixed minor issues with the single-source generation:
* On Windows the line info generation now correctly escapes the path separators.
* Fixed an incorrect C file include order. Now the global object C file is
force included to get all common headers at the start in the generated source
file.
* Added a missing colon which fixed the correct removal of the config.h include.
* Fix the command line help.
* Small typo fix.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
* Migration Guide
Migration guide from JerryScript 1.0 to 2.0.
Co-authored-by: László Langó llango.u-szeged@partner.samsung.com
Co-authored-by: Peter Gal pgal.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
* Add version information for API methods
For each API method/type the documentation now includes
the version it was introduced or a change occured.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
Changes done:
* Added usage/configuration info for this mode.
* Created `tools/srcgenerator.py` to allow source/header generation
without using CMake.
* Adapted CMake to use the `srcgenerator.py` script.
* Added jerry-libm single-source build.
* Improved the `srcmerger.py` script to correctly handle the line numbering.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This patch unifies the recursion limit checking for RegExp, function call and JSON as well.
Until now the limit was only a counter which was increased/decreased at certain points.
This counter has been substituted with a numeric limit which allows to restrict the stack usage.
This patch fixes#2963 and resolves the closed#2258 issue.
Co-authored-by: Gabor Loki loki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
VM_RECURSION_LIMIT only prevented the recursion of interpreted codeblocks but
native/builtin function calls can also create stack overflow due to the too deep recursion.
This patch fixes#2905.
Co-authored-by: Gabor Loki loki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This reduces the noise when a user asks for help via `--help`, as
libfuzzer support is very developer-only.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@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:
* The following macros are now 0/1 switches:
** Renamed CONFIG_ECMA_LCACHE_DISABLE to JERRY_LCACHE.
** Renamed CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE to JERRY_PROPERTY_HASHMAP.
** Renamed CONFIG_DISABLE_UNICODE_CASE_CONVERSION to JERRY_UNICODE_CASE_CONVERSION.
** Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE.
** Renamed JERRY_DISABLE_JS_PARSER to JERRY_PARSER.
** Renamed JERRY_ENABLE_ERROR_MESSAGES to JERRY_ERROR_MESSAGES.
** Renamed JERRY_ENABLE_EXTERNAL_CONTEXT to JERRY_EXTERNAL_CONTEXT.
** Renamed JERRY_ENABLE_LINE_INFO to JERRY_LINE_INFO.
** Renamed JERRY_ENABLE_LOGGING to JERRY_LOGGING.
** Renamed JERRY_ENABLE_SNAPSHOT_EXEC to JERRY_SNAPSHOT_EXEC.
** Renamed JERRY_ENABLE_SNAPSHOT_SAVE to JERRY_SNAPSHOT_SAVE.
** Renamed JERRY_SYSTEM_ALLOCATOR to JERRY_SYSTEM_ALLOCATOR.
** Renamed JERRY_VM_EXEC_STOP to JERRY_VM_EXEC_STOP.
** Renamed JMEM_GC_BEFORE_EACH_ALLOC to JERRY_MEM_GC_BEFORE_EACH_ALLOC.
** Renamed JMEM_STATS to JERRY_MEM_STATS.
** Renamed PARSER_DUMP_BYTE_CODE to JERRY_PARSER_DUMP_BYTE_CODE.
** Renamed REGEXP_DUMP_BYTE_CODE to JERRY_REGEXP_DUMP_BYTE_CODE.
* Recursion check changes:
** Renamed REGEXP_RECURSION_LIMIT to JERRY_REGEXP_RECURSION_LIMIT.
** Renamed VM_RECURSION_LIMIT to JERRY_VM_RECURSION_LIMIT.
* Attribute macro changes:
** Renamed JERRY_CONST_DATA to JERRY_ATTR_CONST_DATA.
** Renamed JERRY_HEAP_SECTION_ATTR to JERRY_ATTR_GLOBAL_HEAP.
Now the macro can specify any attribute for the global heap object.
* Other macro changes:
** Renamed CONFIG_MEM_HEAP_AREA_SIZE to JERRY_GLOBAL_HEAP_SIZE.
Then new macro now specify the global heap size in kilobytes.
* Updated documentations to reflect the new macro names.
For more deatils please see jerry-core/config.h.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
* Fixed wrong file name indexes in the docs folder.
* Added description of the logging options into the getting started guide
* Added missing files to the 'update-webpage.sh' script
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
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
The CI ran test262 test suite in release mode only to save time.
This patch enables the debug testing on the test suite, which means
the runtime of the "Conformance Tests" job will increase by a few
minutes.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Introduce a new way of building: before any file is compiled
all source files are combined into a single C file and all
header files into a single H file (per subdir).
This new approach makes it possible to quickly integrate JerryScript
into other projects:
```
$ gcc -o demo demo.c jerryscript.c jerryscript-port-default.c -lm
```
To use the source generator run:
```
$ cmake -Bbuild_dir -H. -DENABLE_ALL_IN_ONE_SOURCE=ON
$ make -C build_dir generate-single-source
```
This will create the following files in the `build_dir`:
* jerryscript.c
* jerryscript.h
* jerryscript-config.h
* jerryscript-port-default.c
* jerryscript-port-default.h
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This patch adds posibility to supervise the VM call stack to avoid aborts/crashes due to the recursion calls.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
The regexp engine does not have any recursion depth check, thus it can cause problems with various regexps. Added a new build option `--regexp-recursion-limit N` whose
default value is 0, which is for unlimited recursion depth. Also added a build-option-test.
Fixes#2448Fixes#2190
JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
The test runner used `&>>` to channel stderr to stdout and append
all that to a file. However, that's Bash 4 syntax, which is not
available everywhere, e.g., on MacOS. Bash pre-4 syntax requires
the classic `>>file 2>&1` notation.
This commit rewrites the test runner to use the portable syntax.
Moreover, it also rewrites `&>` to `>file 2>&1` for the sake of
consistency.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Because these feature guards don't have their counterpart options in cmake, they
seem to be less tested. This commit makes them build-tested at least.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The `-m32/64` compiler flags are x86/64-specific (mostly; at least in the
context of JerryScript-supported architectures) and macOS has deprecated 32-bit
support, so it's better to keep the build-testing of `-m32` to x86[-64]/Linux
only.
JerryScript-DCO-1.0-Signed-off-by: Renata Hodovan reni@inf.u-szeged.hu
The previous jerry_port interface did not allow timezones to be handled correctly,
even if the host system was up to the task. This PR changes the jerry_port interface
to allow a completely correct implementation to exist, and provides one (for Linux/BSD
systems) in default-date.c.
Fixes#1661
JerryScript-DCO-1.0-Signed-off-by: crazy2be crazy1be@gmail.com
Previously, these would run for several minutes without printing
any progress. Now, at least print the number of tests executed.
JerryScript-DCO-1.0-Signed-off-by: crazy2be crazy1be@gmail.com
The America/Los_Angeles time zone is already enforced for test262
Travis CI jobs but that doesn't guarantee the correctness of
locally executed tests. So, this patch moves the setting of the
`TZ` environment variable from `.travis.yml` to `run-tests.py`.
The date-related tests in the jerry test suite also rely on a time
zone (UTC). Thus, `TZ` is forced for those tests, too.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The only such test was a legacy of the long removed compact
profile, which is also removed.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Running `tools/run_tests.py --check-magic-strings` causes an IndexError,
but the script exits with 0, indicating error-less run.
Added error checking to the file, to indicate errors in the future.
Fixes#2522
JerryScript-DCO-1.0-Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
In their past form, they could not recognize preprocessor directives,
if they didn't start on column 0. Updated them to fix this problem.
JerryScript-DCO-1.0-Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
Rationale:
- There is no port under targets/ that would use it. All of them
turn it off when building.
- That's no surprise, as jerry-libc supports no barebone MCUs but
posix targets with syscalls only. Actually, that's Linux only,
because macOS builds have turned off the use of jerry-libc a
while ago.
- And there is no point in maintaining a highly restricted set of
libc functions: as soon as someone wants to use JerryScript in a
scenario that needs more functions than jerry-main, they have to
choose a different libc (most problably the compiler's default
one).
I think that we should not keep supporting an otherwise unused
library for the purposes of jerry-main on arm/x86/x64-linux only.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu