Ubuntu 14.04 reached its end of life on April 30m 2019.
Let's bump the reference to the latest LTS, which is 18.04.
Ubuntu 18.04 has newer Pylint and Cppcheck, the necessary
fixes and suppresses are also included in this PR.
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
Changes:
- Typo fixed in cmake build system and appveyor config
- Added a new buildoption test
JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
This new API function adds possibility to query the resource name of the currently executed script (including modules) or a function object.
This patch closes#2170.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@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
In the jerry-ext there is a native 'assert' handler implemented.
This change adds extra backtrace information if an 'assert' call fails.
To print out the backtrace the library should be built with `JERRY_LINE_INFO` enabled.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
New methods
* jerryx_set_properties: Allows multiple property registration for via a single call
* jerryx_set_property_str: Allows property registration without the need to
create the property name JS value. The property name can be directly passed
as a `const char*` value and must be zero terminated.
* jerryx_get_property_str: Allows getting a property value on a given object.
The property name can be directly passed as a `const char*` value.
* jerryx_has_property_str: Allows checking if a property exists on a given object.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
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 <mfabo@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
Currently JS objects can only have one native pointer data which could be a limitation in special cases.
This patch allows to register multiple native infos, which can be accessed/associated with the corresponding `jerry_object_native_info_t`.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
In the previous approach `jerryx_port_handler_print_char` was implemented
in by the jerry-default-port. This implementation however required the
jerry-ext handler header file which created a requirement in the
jerry-default-port for the jerry-ext headers.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
New functions:
- ecma_create_symbol
- ecma_value_is_symbol
- jerry_get_symbol_descriptive_string
Also improve the jerryx_handler_print to be able to print symbol values via using the jerry_get_symbol_descriptive_string API function for symbol values.
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
Should core, ext, libm, and/or port libraries be properly installed
on some system, help compilation and linking against them by
providing standard `.pc` files, which can be picked up by
pkg-config.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This fixes potential out-of-bounds reads in jerry-ext when dealing
with integer argument mappings.
Fixes#2713
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Changed the debugger-tcp.c file to include Windows specific
socket handling code and mode user all components are compilable
for Windows.
Added appveyor configuration to build with and without debugger.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
Added a unit test for the jerryx_arg_js_iterator_restore function.
Added the specification to the documentation.
JerryScript-DCO-1.0-Signed-off-by: Timothy Harvey t-harvey@ti.com
The peek of the socket does not work on other platforms,
beacause the errno is not set correctly. The code path
added by #2427 Linux specific, so it has been guarded
to solve connection lost issues during debugging sessions
when the client does not send data but still connected.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
In certain platforms the explicit include of 'sys/socket.h' is needed,
e.g.: TizenRT.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
There was an issue not checking if recv() set the error value to EWOULDBLOCK or EAGAIN (both equals 11).
If recv() returns 0 that means the connection was gracefully closed from the other side. However, if you are using non-blocking sockets, and recv() returns 0, but sets the errno to EWOULDBLOCK or EAGAIN it means the socket operation would block.
This patch fixes#2537
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
Allow developers to choose whether they want a hard or a soft
implementation behind `assert`, i.e., whether they want to kill
the whole engine in case of an assertion failure in the executed
script or just throw a JS error.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
... not from the print handler extension. The sending of logs is
already in the port implementation.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Their length (size) is known at compile time. Therefore `sizeof`
is more efficient for them.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Under the cover of the debugger transport layer, allocation on the
engine's heap has been made available to the public. As there are
actually no restrictions on what the allocated memory can be used
for, the memory management functions better fit in the core part
of the API.
Closes#1805
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
- Properly handle logging during transport close
- Properly display data during parse
Furthermore hide global functions of the debugger.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Since the removal of jerry-libc, only jerry-ext uses the
`FEATURE_INIT_FINI` optional feature. Thus, it's better to move it
from the global cmakelists to that of jerry-ext.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The patch also ensures that all components access only the public
headers of other components (except for unit tests, which are
allowed to use private headers, too).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This helps to avoid the use of non-public headers and
protocol-internal constants in external code (e.g., in jerry-port
and jerry-ext).
The patch also cleans up the necessary includes in jerry-core public
headers, and the include order in jerry-port/default public headers.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The distinction between public and private include directories was
not maintained and the install paths got confusing.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Clang 6 is more picky about implicit conversions and complains
about loss of presicion and/or change of signedness.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The renamed header doesn't contain any declarations related to
debugger-ws.c but contains the declaration of a function from
debugger-sha1.c.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Remove automatic conversion of errors. Errors are
primary values, just like numbers or strings.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This adds the ability to remove a single module from the cache, or to
clear the entire module cache.
JerryScript-DCO-1.0-Signed-off-by: Gabriel Schulhof gabriel.schulhof@intel.com