the three boolean arguments of ecma_create_named_data_property and the
two boolean arguments of ecma_create_named_accessor_property are combined
into one uint8_t argument. On ARM-32 it is preferred to have less than
four arguments, since these arguments can be passed in registers.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Create new ecma-string from positive integers without cast it to ecma_number
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
function is removed and incorporated into ecma_op_general_object_put. Also most
properties are directly created / updated instead of using ecma_builtin_helper_def_prop.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
- Branch argument information is encoded in the vm byte
code data, so CBC flags are not loaded anymore
- The free_flags variable is removed from the vm_loop
- Two cases are removed from "get arguments", argument
processing is simplified
- The two opcode tables are merged to one
- The VM_OC_POP opcode has no result, so the break is changed to continue.
- The VM_OC_PUSH_NUMBER can use ecma_make_integer_value.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
counter is one, dereferencing the value frees its allocated memory.
In this case we return early.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
When running multiple test suites in parallel -- e.g., as it
happens on the CI --, the names of the executed commands and the
results of the executions can/do get printed far from each other,
interrupted by other prints. This can make the reading of the
output hard. This patch prints each line with one echo command,
which makes the interruption of the line less likely.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Unnecessary checks are removed, new checks are added to skip
unneeded code paths.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
Set the correct defines in CMakeLists.txt and update another occurrences in scripts.
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
The 'mem_' prefix is too general, so it might clash with
symbols in other libraries. Renamed the directory, file,
funtion and type names.
Related issue: #1052
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
String, Boolean) to use ecma-values. When the value of a Number object is
a small integer number, this change reduces the memory consumption, since no
double is allocated.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This modificiation affects those conditions which check that
a value can be represented with a smaller type.
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
Jerry (the command line tool) has been supporting the execution of
multiple script files for long. However, until now, it simply
concatenated all sources into a single source buffer and
parsed/executed them as one unit. Other JS execution tools (e.g.,
jsc, v8) load and execute separate files as separate units -- but
still in the same execution environment. The most significant
effect of this approach is that the `"use strict;"` directive (or
the absence of it) at the beginning of each JS script file takes
effect as expected (i.e., as if the script was executed alone).
Contrarily, the concatenation-based approach forces the strictness
of the first script on all the rest (i.e., if the first script
starts with `"use strict";` the rest is also executed in a strict
environment even if they did not contain the directive, and vice
versa).
This patch makes the jerry command line tool to load/parse/run one
unit at a time.
Side effects:
- As there is no need for separate file read routines that load one
file (a snapshot) or concat multiple (JS sources) anymore, those
routines got merged.
- Both previous read routines used multiple stdio functions
(`fseek`, `ftell`, and `rewind`). This has been simplified to
rely on `fread` only to find out the length of the input.
- This simplification made the above mentioned functions
superfluous in jerry-libc.
- As some error messages had to be touched in this patch, several
more have been beautified to make them more consistent.
- One small change was needed in `jerry_parse` in jerry-core to
allow subsequent parsing of multiple sources (without that, an
assertion was triggered).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Both JS test suite and unit test logs can grow large as Makefile
invokes run-test-suite.sh and run-unittests.sh with absolute paths
to engines and test directories, which get then printed quite
often. This patch adds code to the runner scripts to determine the
longest directory path common to the current working directory, the
invoked script, the test directory, and the engine (in case of JS
tests). Then, when a path is to be printed, this common path
component is skipped.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
and comments. Space consumed by opcode triplets are reduced to 16 bits
down from 32 bits. This reduces the opcode triplet tables by 220 bytes.
New symbolic constants and defines were also added to describe common
operations.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
When performing `make precommit`, instead of running only a subset of
the Jerry Test Suite on full profile builds, run the whole suite, and
also run the compact subset of the suite on compact builds. Also, make
CI perform the same tests.
Related issue: #879
Related PR: #912
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
names were replaced by empty strings before that. The snapshot form
of tests/jerry/arguments.js fails because of this issue.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
When merging PRs via the GitHub web interface, CR characters can
sporadically appear in the commit message. This can also cause
signed-off-by message mismatch in check-signed-off.sh (even if
everything else is OK). To be on the safe side, this patch removes
any CR characters from the output of git show when performing the
check.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
Separate the utf-8 and ascii strings.
In case of ascii strings the size is equal to the length, so we able to store this information
in the string descriptor instead of using the string header to store it.
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
Fixed the return value to return false when the field does
not exist as the documentation says.
Related issue: #1041
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Added errol implementation. Fixed '3d-raytrace.js', because
the new algorithm has better precision and also reduce the
code size.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
Merged the mbed releated targets into one source.
Available targets: FRDM-K64f, Discovery-STM32F4, Discovery-STM32F429ZI, NUCLEO-STM32F4
JerryScript-DCO-1.0-Signed-off-by: Imre Kiss kissi@inf.u-szeged.hu
Those internal properties which have a primitive value field or where the property value type
is an ecma_object_t ptr were checked earlier.
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
This change affects only those internal properties which have a primitive value field.
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
Recent changes eliminate the need for `jerry_port_putchar`. As port
API discussions don't make it likely that it will ever be needed
again, this patch removes its declaration from jerry-port.h and its
implementations from the port(s).
The related code in jerry-libc is not needed either: whatever `putc`
(and `puts`) can do, `printf` can do as well.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
The internals have surprisingly large number of unused functions at
surprising places. This patch cleans them out to make maintenance
easier and to prevent dead code having effect on future decisions.
The patch intentionally does not try to clean up public API but
focuses on internal modules only that are/should not be reachable
from "outside".
However, unit tests do access private API, thus tests of literal
storage had to be adjusted.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
This changes affects those internal properties where the property value type is an ecma_object_t ptr.
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
Replaced `gettimeofday`-related code with `jerry_port_get_current_time`
and `jerry_port_get_time_zone` function calls. Moved old code to
default port implementation.
Removed `ENABLE_DATE_SYS_CALLS` as date syscalls should "just work".
Fix DST adjustments: even if `gettimeofday` returns meaningful data in
`tz_dsttime`, the value is just a flag (or, according to some sources,
a tri-state value: >0 if DST applies, ==0 if DST does not apply, <0 if
unknown). Hitherto, the field was simply added to/subtracted from a
time value in milliseconds. To use it approximately correctly, the
field's value should be multiplied by "millisecs/hour".
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
* Moved the error codes to jerry-port.h and declared port function
`jerry_port_fatal`.
* Moved "exit or abort on fail" functionality to the newly added
jerry-port-default-fatal.c.
* This implied that a default port-specific API had to be introduced:
functions `jerry_port_default_set_abort_on_fail` and
`jerry_port_default_is_abort_on_fail` declared in jerry-port-default.h
control the fatal exit behaviour.
* For the sake of clarity, renamed jerry-port.c to
jerry-port-default-io.c.
* Adapted CMakeLists to deal with port implementations consisting of
more then one source file and exposing headers. This also required
the renaming of `EXTERNAL_PORT_FILE` cmake option to
`EXTERNAL_PORT_DIR`.
* Adapted main sources to use the default port header for the
abort-on-fail functionality, as that is not part of the core jerry
API anymore.
* Added default port implementation to the static source code checker
tools.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu