Age | Commit message (Collapse) | Author |
|
In the snapshot tool the files were opened
in text mode. However the snapshot files
are binary files thus it is advised to use the
binary mode when opening the files.
Specifying the binary mode is a must on Windows
platform otherwise the read/write operations
are inserting extra '\r' characters.
To make the tools consitent across OSes all
fopen are now opening files in binary mode.
Also update jerry-libc to accept the 'b'
modifier and add a test case where the JS
file uses CR-LF line endings.
JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
|
|
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: wille-io mike@wille.io
|
|
Remove TARGET_HOST defines from the jerry-libc module and replace with compiler provided macros.
JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
|
|
benchmarking (#2076)
Some benchmark suites contain test cases that have nonreproducible
behaviour. This is mostly caused by relying on "now" when dealing
with dates or timestamps, instead of using a fixed moment. (A
notorious example is the crypto-aes.js test case of the sunspider
bechmark suite, where the heap memory consumption can vary between
34K-41K heap because of using `(new Date()).getTime()`.)
This commit renames the jerry-minimal command line tool to
jerry-test (to better reflect its purpose) and adds extra code,
which intercepts some calls to libc (`gettimeofday`, `rand`) and
pins their results to some fixed values. This makes the tool
useless in a general case but ensures stable results when
benchmarking -- for which it is mostly used.
As a side effect, the commit also changes jerry-libc by making all
libc functions weak symbols to allow their override from
application code.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
Also includes the addition and styling of some doc comments (but
those are whitespace too).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
The previous implementation of srand was wrong in jerry-libc.
It set all 4 values to the seed, not modifying anything in them, causing random values to be repeated pretty often.
This approach fixes the mentioned issue.
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
|
|
By using constructors/destructors we unify the case of static linking with
that of dynamic linking, and we reuse the build flag FEATURE_INIT_FINI. Using
constructors/destructors also allows us to cover the case where library
constructor/destructor functionality is unavailable, because we can expose the
module registration/unregistration functions as global symbols, to be called
explicitly from within the application.
Fixes https://github.com/jerryscript-project/jerryscript/issues/1952
JerryScript-DCO-1.0-Signed-off-by: Gabriel Schulhof gabriel.schulhof@intel.com
|
|
As a side effect, refactor the variable types in
`print_unhandled_exception` to reduce the overuse of sized integer
types (generic `unsigned int` is better than `uint32_t` if there is
no actual requirement on integer width).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
The arrays contain the addresses of functions annotated with
constructor or destructor attributes. The support is optional,
requires FEATURE_INIT_FINI cmake option to be set. As of now, the
option is _not_ available in tools/build.py directly, only via
`--cmake-param="-DFEATURE_INIT_FINI=ON"`.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
compiled using non-GCC compilers.
This included adding an initialization to a variable that looks(!)
like it can reach a use before being initialized (b/c we turned
JERRY_UNREACHABLE into a nop) -- an example:
int foo;
switch (value_can_only_be_one_or_two)
case 1:
case 2:
foo = 5;
default:
JERRY_UNREACHABLE();
x = foo +1;
...the compiler assumes that the path can go through the default case,
which leaves the value of foo undefined.
JerryScript-DCO-1.0-Signed-off-by: Timothy Harvey t-harvey@ti.com
|
|
Extern keywords on function declarations/definitions provide no additional value since function declarations/definitions default to external linkage in C99, e.g. removing them won't change the semantics of the program.
The extern keywords were essentially a legacy from the early days of the project. This commit cleans this up across the whole codebase in one go to minimize history disruption.
The bulk of the changes in this commit were produced by a custom clang-tidy checker.
Note that variables declarations carrying the extern keyword are untouched by this commit since there the presence of the keyword actually has an impact on the semantics of the program.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
|
|
Since the project is now hosted at the JS Foundation we can move to unified copyright notices for the project.
Starting with this commit all future contributions to the project should only carry the following copyright notice (except for third-party code which requires copyright information to be preserved):
"Copyright JS Foundation and other contributors, http://js.foundation" (without the quotes)
This avoids cluttering the codebase with contributor-specific copyright notices which have a higher maintenance overhead and tend to get outdated quickly. Also dropping the year from the copyright notices helps to avoid yearly code changes just to update the copyright notices.
Note that each contributor still retains full copyright ownership of his/her contributions and the respective authorship is tracked very accurately via Git.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
|
|
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
|
|
The main implementation of unix platform hangs, if the engine was
built with jerry-libc. Open system call returns with a negative
error code if cannot open the file, but fopen must return NULL
when error happens.
Fixes #1437.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
|
|
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
Newer compilers (especially clang) warn (and fail) on
`assert (!"message");` constructs typically used to assert on
unreachable code paths (multiple occurrences in jerry-libc). A more
up-to-date approach is to use `assert (false && "message");`. This
patch applies the pattern to all relevant asserts in jerry-libc.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
With the new build system, the conventional `cmake && make` already
works. However, the last step, i.e., `make install` was still
missing (didn't work). This patch adds the `install()` commands to
CMakeLists that are required to generate the `install` target in
the Makefile.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
|
|
* Remove JERRY_CORE CMake option: the building of the core
JerryScript library should not be optional.
* Fix wording of comments, status and error messages.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
Remove "-I/home/.../jerryscript/jerry-libc/__TARGET_HOST" and
"-D__TARGET_HOST" from compiler command line, they don't add
anything useful.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
The `cmake` directory already contains several toolchain files for
various platforms (operating system + architecture). However,
`tools/build.py` does not define a toolchain file for cmake unless
explicitly specified. This patch changes the script to look into
the `cmake` directory for a file named
`toolchain_$(os)_$(arch).cmake` and, if found, pass that to cmake
by default.
OS and arch are determined by `os.uname()`. As Linux on Raspberry
Pi identifies itself as "armv7l", the legacy "armv7l-hf" arch name
is shortened to "armv7l". This way, building jerry on RPi
(natively, not cross) becomes possible by simply running
`tools/build.py` without any extra options.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
We removed that implementation where the build directory isn't set up to build with exactly one
configuration of the project but potentially several variants: the same build directory
can/must be used for debug and release builds, for full or compact profile versions, etc.
So we reworked the CMakeLists, and now one build dir deal with exactly one configuration
of the project's libraries and tools.
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
|
|
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
|
|
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@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
|
|
and 'jerry_port_get_current_time' functions.
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
|
|
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
* LICENSE needed year update.
* The asm component of the posix target of jerry-libc had no
copyright & license notice since it has been introduced in 2015.
Traced back history and added missing header with correct years.
* Three tests in jerry/fail/1 also missed header. Added.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
The two target implementations are very close clones of each other.
The only known differences are the following:
* The asm component of the linux target has `.type` and `.size`
declarations for the functions defined therein, while the darwin
target doesn't support those.
* Linux uses `__NR_xxx` mnemonics for syscall numbers, while darwin
uses `SYS_xxx` format.
* Darwin does not have `exit_group` syscall but `exit` only.
* The linux target has a commented out `jrt_set_mem_limits` fuction
declaration at the end of the C source. (Based on its name, this
function does not really belong here.)
Simple preprocessor macros can unify the first three differences.
While for the sake of legacy, we can keep the fourth commented-out
code in the code base; it might turn out to be useful elsewhere in
the future. Since it remains commented out it wont cause any
problems on any OSs.
So, this patch gets rid of a lot of duplication.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
Introducing the `assert.h` public header with the `assert(x)` macro
and already making use of it in jerry-libc sources. These newly
introduced ISO C-conforming features replace the non-conforming
`LIBC_ASSERT` and `LIBC_NDEBUG` at no cost, and they also have the
benefit that we can expose `assert` in a public header and make it
useful to jerry-libc users.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
The core functionality (i.e., the equivalent of `kill (getpid (), sig);`)
was already there in the implementation of `abort ()`. Now, it got
factored out to `raise ()` so that others (most importantly,
`__aeabi_ldiv0`) can call and link to it as well.
Also, removed `LIBC_UNREACHABLE_STUB_FOR` macro, as it is not used anymore.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
After recent changes to jerry-libc, `syscall_N` C functions became
pure trampolines to their appropriate `syscall_N_asm` counterparts
written in assembly. Removing the C functions and renaming the
assembly functions to take their place simplifies the code.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
|
|
Fixing a typo, which resulted in an undefined (but harmless) symbol
in jerry-asm.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
Use DATE_SYS_CALLS=ON for make target to enable the
date related system calls. Also fix some minor issues.
Related issue: #923
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
|
|
Fix build error on darwin and build with default libc.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
|
|
Related issue: #900
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
|
|
Refactor memory and string handling routines
* Potential code size improvements:
* Most loops don't really need a new incrementing index variable
running between 0..n-1 but can just loop `while (n--)`, and the
bodies don't need array indexing but can just use the `*p++`
idiom.
* Compare routines are not required to return -1, 0, and +1, but
any negative, zero, or positive result will do.
* `strncmp` may follow the other routines and does not have to have
defined behaviour if any of its args is NULL.
* Fix:
* `strncmp` did not work correctly if the strings were equal but
`n` was greater than their length (did not stop at the
terminating zero character).
Refactor printf
* Merging code duplications, removing dead initialization.
Refactor rand and srand
* Making sure that the type of the state variables is OK
(`uint32_t` instead of `unsigned int`).
* Getting type conversions OK.
* Fixing `srand` to write all state variables and thus indeed
generate the same random sequence.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
Related issues: #213, #691
* Fixed 'ecma_date_local_tza' and 'ecma_date_daylight_saving_ta' date builtin helper functions
* Added syscall of gettimeofday function to get the current system time and timezone.
* Fixed related regression test files.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
|
|
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
|
|
* Fix "end of file while inside a group" doxygen warnings.
* Fix "unknown command" doxygen warnings caused by incorrect
argument references. Instead of `@foo`, `@a foo` is the proper
format.
* Fix "unknown command" doxygen warnings caused by incorrect
parameter direction specifications. Instead of `@in`, `@out`,
and `@in-out`, `[in]`, `[out]`, and `[in,out]` are the proper
formats.
* Wrapping special characters in quotes to avoid doxygen
confusion. Raw pipe, semicolon, dot, backslash, etc. characters
can drive doxygen into various misinterpretations and warnings.
E.g.:
```
End of list marker found without any preceding list items
Found unknown command
```
Putting quotes around such text snipets eliminates the errors.
* Fix the documentation of `ecma_builtin_global_object_print`. Raw
<> and \ sequences confused doxygen in various ways (it tried to
interpret them as XML tags and doxygen commands).
* Fix "ignoring title that does not match old title" doxygen
warnings. At some places, the group titles were out of sync, at
others, the group names were incorrect.
* Fix "parameters are not documented" doxygen warnings. Fixing
various typos in the inline parameter documentations (`/*`,
`/**`, `/** <`, and `/**>` are all considered incorrect, the
right format is `/**<`).
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
* Removed unused or unnecessary parts from various make files
* Eliminated lots of duplications from Makefile with the help of
macros.
* Split tools/precommit.sh to its independent components:
* the part that checks the existence of the "signed off" text in
commit messages
(this on got factored out to tools/check-signed-off.sh),
* the part that uses vera++ for style checking (this one got
factored out to tools/check-vera.sh),
* the part that invokes targets in the cmake-generated build
directory, and
* the part that performs various tests (these latter two got
moved into the Makefile).
* Moved the functionality of precommit-full-testing.sh into the
Makefile, too.
* Added ninja build system support (e.g., `make NINJA=1`).
* Updated leading documentation comments (they were somewhat
stale).
* Tried to keep the target names exactly the same as they were --
almost succeeded... (some changes are intentional, and are
subject to personal preferences).
* Simplified console output of `make precommit`
* Unified test runner scripts and their output format
* Eliminated nothing-to-stdout everything-to-log-file policy:
info is printed to stdout and it is the caller's
responsibility to redirect it to a file if needed.
* Also applied some renaming and coding style unification to
the scripts.
* Merged the functionality of tools/runners/run-test-suite-jerry*.sh
into the Makefile
* Merged everything related to a test suite execution in a single
script.
* The new script also allows to specify pass and xfail tests in
a single list file, which was not possible hitherto.
* Also, the paths of the test cases given in a file are
interpreted relative to their container files.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
|
|
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
|
|
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
|
|
JerryScript-DCO-1.0-Signed-off-by: Xin Hu Xin.A.Hu@intel.com
|
|
* to make it same as 'uname -p' result
JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
|
|
* Add build target 'darwin'
* Modify compiler options to work with clang
* Support 'jerry-libc' on Mac OS X
For MPU target build, install `gcc-arm-none-eabi` tool chain using `Homebrew` as following.
````
brew tap PX4/homebrew-px4
brew update
brew install gcc-arm-none-eabi
````
https://pixhawk.org/dev/toolchain_installation_mac
JerryScript-DCO-1.0-Signed-off-by: Sung-Jae Lee sjlee@mail.com
|
|
except implementation of JSON built-in, moving the functions to JSON built-in's module.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
|
|
Related issue: #296
JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
|