267 Commits

Author SHA1 Message Date
Yonggang Luo
dfa9afbf6e
Introduce JERRY_ZSTR_ARG macro to avoid jerryx_print_string, jerryx_print_byte, jerry_port_print_byte, strlen (#4982)
Replace usage of jerryx_print_byte, jerryx_print_string with jerryx_print_buffer.

As we now have JERRY_ZSTR_ARG, so we can take advantage of it

With this, the jerry_port_print_byte port api won't need any more
this reduced the port api surface

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
2024-11-25 17:28:55 +01:00
Máté Tokodi
514fa6735a
Update MbedOS, RIOT and ESP_IDF CI checkers (#5120)
Update MbedOS and RIOT CI checkers to use `gcc-arm-none-eabi` on top of
ubuntu-latest

Upgrade to mbed-tools and mbed-os 6.17

Bump xtensa version to `2021r2-patch5` and re-enable `ESP_IDF_Build_Test`

JerryScript-DCO-1.0-Signed-off-by: Máté Tokodi mate.tokodi@szteszoftver.hu
2023-12-15 12:12:59 +01:00
Gergo Csizi
baf308a7ae
Fix ESPIDF_Build_Test (#5019)
JerryScript-DCO-1.0-Signed-off-by: Gergo Csizi gergocs@inf.u-szeged.hu
2022-08-01 22:10:42 +02:00
Roland Takacs
0d49696618
Merge esp8266-rtos-sdk and esp-idf targets (#4958)
This patch bumps esp8266-rtos-sdk to the latest release. This required to
modify the directory structure and the build system to conform to ESP-IDF
Style. Since esp-idf target already supports ESP-IDF Style, the espressif
targets has been merged to eliminate code duplication.
The target application code has been modified from blinking leds to hello
world to be aligned to other targets.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs roland.takacs@h-lab.eu
2022-02-22 10:58:18 +01:00
Roland Takacs
c9e9f8e818
Add support for Mbed-OS 6.15.0 (#4909)
The default Mbed OS device (STM32F4) had been changed to FRDM-K64F that is
supported by both Mbed OS 5 and Mbed OS 6 versions. Makefile had also been
modified to have a flash recipe.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs roland.takacs@h-lab.eu
2022-02-22 10:29:07 +01:00
Szilagyi Adam
4924f9fd31
Remove ES_NEXT macro (#4915)
- remove all '#JERRY_ESNEXT' macro
- remove 5.1 build profile, update test runner accordingly (Note: all builtins are turn on by default)
- move tests from tests/jerry/esnext into tests/jerry, concatenate files with same names
- add skiplist to some snapshot tests that were supported only in 5.1
- fix doxygen issues that were hidden before (bc. of es.next macro)

Co-authored-by: Martin Negyokru negyokru@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2022-01-31 16:46:00 +01:00
Dániel Bátyai
ac1c48eeff
Update jerry-port and jerry-ext (#4907)
Notable changes:
  - Updated and the port API interface, new functions have been added
    and some have been changed. The port library is now cleaned up to
    not have any dependency on jerry-core, as it should be. The port library
    is now strictly a collection of functions that implement
    embedding/platform specific behavior.
  - The default port implementation has been split for windows and unix.
    Implemented port functions have been categorized and reorganized,
    and marked with attribute((weak)) for better reusability.
  - External context allocation has been moved to the port API instead
    of a core API callback. The iterface has also been extended with a
    function to free the allocated context. When external context is
    enabled, jerry_init now automatically calls the port implementation
    to allocate the context and jerry_cleanup automatically calls the port
    to free the context.
  - jerry_port_log has been changed to no longer require formatting to
    be implemented by the port. The reason beind this is that it was vague what
    format specifiers were used by the engine, and in what manner. The port
    function now takes a zero-terminated string, and should only implement
    how the string should be logged.
  - Logging and log message formatting is now handled by the core jerry library
    where it can be implemented as necessary. Logging can be done through a new
    core API function, which uses the port to output the final log message.
  - Log level has been moved into jerry-core, and an API function has
    been added to set the log level. It should be the library that
    filters log messages based on the requested log level, instead of
    logging everything and requiring the user to do so.
  - Module resolving logic has been moved into jerry-core. There's no
    reason to have it in the port library and requiring embedders to
    duplicate the code. It also added an unnecessary dependency on
    jerry-core to the port. Platform specific behavior is still used through
    the port API, like resolving module specifiers, and reading source file
    contents. If necessary, the resolving logic can still be overridden as
    previously.
  - The jerry-ext library has also been cleaned up, and many utility
    functions have been added that previously were implemented in
    jerry-main. This allows easier reusability for some common operations,
    like printing unhandled exceptions or providing a repl console.
  - Debugger interaction with logged/printed messages has been fixed, so
    that it's no longer the port implementations responsibility to send
    the output to the debugger, as the port should have no notion of what a
    debugger is.  The printing and logging functions will now pass the
    result message to the debugger, if connected.
  - Cleaned up TZA handling in the date port implementation, and simplified
    the API function prototype.
  - Moved property access helper functions that use ASCII strings as
    keys from jerry-ext to the core API.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2022-01-20 13:53:47 +01:00
Csaba Osztrogonác
5467ac4608
Fix RIOT CI job (#4962)
Use https instead of the unsupported git protocol.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác csaba.osztrogonac@h-lab.eu
2022-01-11 11:03:44 +01:00
Roland Takacs
69f30977d9
Remove curie-bsp target (#4960)
Intel Corporation has announced the timeline for End of Life status for
Intel Curie Module (Intel Quark SE SoC) products.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs roland.takacs@h-lab.eu
2022-01-10 14:31:23 +01:00
mnegyokru
077eaeb4e7
Update build profile to es.next on esp8266 (#4913)
- fix amalgam build issue with es.next profile
  - update esp linker script according to: Table 4-1. in
    https://www.espressif.com/sites/default/files/documentation/2a-esp8266-sdk_getting_started_guide_en.pdf

JerryScript-DCO-1.0-Signed-off-by: Martin Negyokru negyokru@inf.u-szeged.hu
2021-12-23 11:30:19 +01:00
Roland Takacs
c51b268276
Minimize mbedos5 target (#4905)
* Removed hardware specific implementations
  * Added simple 'hello world' demo code to be aligned to other targets
  * Added ability to use external resources from outside JerryScript folder

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs roland.takacs@h-lab.eu
2021-12-15 12:52:40 +01:00
Roland Takacs
af297bc578
Separate targets into os and baremetal-sdk parts (#4842)
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs roland.takacs@h-lab.eu
2021-12-06 11:02:52 +01:00
Dániel Bátyai
9860d66a56
Rework the public API (#4829)
Related to #4186.

Some notable changes:
  - The term 'Error' now strictly refers to native Error objects defined in
    the ECMA standard, which are ordinary objects. All other uses of
    'error' or 'error reference' where the term refers to a thrown value is
    now called 'exception'.

  - Simplified the naming scheme of many String API functions. These functions
    will now also take an 'encoding' argument to specify the desired
    encoding in which to operate.

  - Removed the substring-copy-to-buffer functions. These functions
    behaved awkwardly, as they use character index to specify the
    start/end positions, and were mostly used incorrectly with byte
    offsets instead. The functionality can still be replicated with
    other functions if necessary.

  - String-to-buffer functions will no longer fail if the buffer is not
    sufficiently large, the string will instead be cropped.

  - Fixed the usage of the '_sz' prefix in many API functions. The term
    'sz' means zero-terminated string in hungarian notation, this was
    used incorrectly in many cases.

  - Renamed most of the public API functions to have shorter, more on-point
    names, rather than the often too long descriptive names. Functions are now
    also grouped by the type of value they operate on, where this makes
    sense.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2021-12-06 10:20:09 +01:00
Roland Takacs
a1c1d42710
Update Zephyr target to 2.7.0 (#4838)
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs roland.takacs@h-lab.eu
2021-12-02 15:33:29 +01:00
Roland Takacs
3737a28eaf
Update NuttX target to releases/10.2 (#4822)
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs roland.takacs@h-lab.eu
2021-11-23 13:21:24 +01:00
Roland Takacs
2899582080
Update RIOT target to 2021.10 (#4826)
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs roland.takacs@h-lab.eu
2021-11-23 13:17:46 +01:00
Jacques Germishuys
06b4c02204
Restore esp-idf port (#4828)
This also cleans up all the files, moving them into a single file for
the port itself and module support respectively.

JerryScript-DCO-1.0-Signed-off-by: Jacques Germishuys jacques@beakbooklimited.com
2021-11-23 13:13:50 +01:00
Robert Fancsik
badfdf4dba
Replace vera++ with clang-format (#4518)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
2021-11-05 14:15:47 +01:00
Zsolt Borbély
6a995e2887
Fix typos in the documentation and related files (#4809)
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
2021-11-02 11:37:05 +01:00
ChrisPei
2a4fb19157
Add missing "jerryscript.h" include to esp-idf target (#4759)
JerryScript-DCO-1.0-Signed-off-by: ChrisPei spoppig5@gmail.com
2021-10-21 12:15:44 +02:00
Paul Sokolovsky
be910b9867
targets: zephyr: Update for Zephyr 2.x (#4731)
targets: zephyr: Update for Zephyr 2.2

Zephyr 2.2 removed some deprecated compatibility headers, use the new
location.

targets: zephyr: Update for Zephyr 2.3

Rename CONFIG_FLOAT -> CONFIG_FPU based on the change done in Zephyr 2.3.

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org

targets: zephyr: Update CI and docs for Zephyr 2.6

And to the latest Zephyr SDK 0.13.0. arduino_101 board is no longer
supported by Zephyr 2.x, so replace it with qemu_x86 (i.e. QEMU
emulation target) in CI and with frdm_k64f in docs.

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
2021-08-26 14:55:30 +02:00
Zoltan Herczeg
951044c036
Change resource name to a string. (#4724)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-07-27 13:40:19 +02:00
Gergo Csizi
8f71871a39
Remove jerry_get_boolean_value (#4685)
JerryScript-DCO-1.0-Signed-off-by: Gergo Csizi csgergo92@gmail.com
2021-06-24 15:40:14 +02:00
Jiawen Geng
7be339ad61
Fix typo in property hashmap define (#4664)
Fixes jerryscript-project/jerryscript#4648

JerryScript-DCO-1.0-Signed-off-by: Jiawen Geng technicalcute@gmail.com
2021-05-26 12:26:11 +02:00
Zoltan Herczeg
053389de80
Add info to external pointer free callback. (#4642)
Furthermore reduce memory consumption when only
one external pointer is assigned to an object.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-04-13 09:51:39 +02:00
Zoltan Herczeg
6c484f3529
Rework module linking (#4632)
The module linking process from jerry_parse is moved out into
a new jerry_module_link function, and jerry_parse is limited to
create unlinked modules.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-03-30 15:40:09 +02:00
Zoltan Herczeg
edd2f20397
Remove jerry_port_track_promise_rejection (#4613)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-03-11 19:58:44 +01:00
Zoltan Herczeg
546422161e
Add custom configuration to jerry_parse and its variants (#4620)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-03-10 09:56:48 +01:00
Zoltan Herczeg
112ad83aaa
Rework external function handlers (#4599)
Instead of a fixed number of arguments, a call info structure is passed
to the handlers, which can be extended in the future without breaknig the
API. This structure holds new.target value, so its getter function is removed.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2021-02-17 17:52:19 +01:00
Robert Fancsik
c4676a21fe
Introduce jerry_port_track_promise_rejection (#4451)
This patch resolves #2931.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-18 14:59:42 +01:00
Akos Kiss
fdaacde667
Officially introduce amalgamated builds (#4416)
Remove redundancy between all-in-one and all-in-one-source builds
by keeping only the second, and adopt the more established term
"amalgamated" build for it. This change includes the following:

- Replace `ENABLE_ALL_IN_ONE` and `ENABLE_ALL_IN_ONE_SOURCE` cmake
  options with `ENABLE_AMALGAM` top-level option.
- Replace `--all-in-one` option of `build.py` helper with
  `--amalgam`.
- Merge the `srcmerger.py` and `srcgenerator.py` tool scripts into
  `amalgam.py` (with improvements).
- Update documentation.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2021-01-11 13:07:40 +01:00
Robert Fancsik
b7b2e0360e
Move ARM and target checks to Github Actions from Travis (#4430)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2021-01-08 20:08:03 +01:00
Akos Kiss
d161e2d9ed
Disable libjerry-math by default (#4428)
Normally, it is more usual and safe to use a toolchain's native
math library. Especially, if multiple components of a project use
math functions, in which case all components should be linked
against the same libm.

The libjerry-math can be used, of course, but as it needs extra
care and consideration, it should be opt-in.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2021-01-08 11:37:46 +01:00
Akos Kiss
257814d063
Rename jerry-libm to jerry-math (#4410)
That "libm" in the name of the library resulted in awkward naming
on *nix systems (`libjerry-libm.*`, "lib" occurring twice). And the
name of the corresponding header is `math.h` anyway.

Note that this is a breaking change in some sense. The commit
contains no API change, but the build system does change for users
of the math library.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2021-01-05 12:50:07 +01:00
Akos Kiss
81702ff5ea
Drop the minimal variant of the default port implementation (#4331)
The minimal variant became quite meaningless lately. There were two
port APIs originally that had extra functions in the default port
in addition to the core-mandated implementations: the I/O and
Termination port APIs. However, the extra Termination API code was
removed a year ago, leaving some minimal extension in the I/O port
only. As the overhead of the extension is negligible, it is not
worth maintaining two library variants.

Therefore
- this commit removes the minimal variant of the default port lib,
- rewrites uses of the minimal variant to use the variant with the
  I/O extension, and
- updates targets where I/O port code was copy-n-pasted.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2020-11-16 11:54:01 +01:00
Philippe
f303017542
espressif's ESP-IDF port (#4270)
JerryScript-DCO-1.0-Signed-off-by: Philippe pgu-swir@users.noreply.github.com


Co-authored-by: Philippe <pgu-swir@users.noreply.github.com>
2020-10-21 19:56:59 +02:00
Dániel Bátyai
f4af997935
Update NuttX repository URLs (#4201)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai daniel.batyai@h-lab.eu
2020-09-17 18:15:40 +02:00
Mátyás Mustoha
fdb5d893bf
Update Mbed OS target to 5.15.4 (#4035)
JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha matyas.mustoha@h-lab.eu
2020-07-23 13:35:54 +02:00
Mátyás Mustoha
870a3d3ffb
Update the NuttX-STM32 documentation (#3986)
Fixed and updated some of the repository locations and the
relevant build commands.

- Updating `stlink` fixes a CMake build error on the 1.5.1 branch
- Updating the `kconfig` build command allows creating `kconfig-tweak`,
  which fixes a warning during the NuttX configuration

JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2020-07-10 16:09:13 +02:00
Mátyás Mustoha
3e866258db
Update NuttX to 9.0 on Travis (#3958)
Update the Travis builds to use NuttX 9.0, which was
released on April 26, 2020.

JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2020-06-30 15:53:29 +02:00
Dániel Bátyai
fde0d556ac
Re-target for ES.Next (#3901)
A list of changes:
- 'es2015-subset' profile is deprecated, and an 'es.next' profile is added.
- The default profile is changed to 'es.next'
- Renamed the JERRY_ES2015 guard to JERRY_ESNEXT
- Renamed JERRY_ES2015_BUILTIN_* guards to JERRY_BUILTIN_*
- Moved es2015 specific tests to a new 'es.next' subdirectory
- Updated docs, targets, and test runners to reflect these changes

Resolves #3737.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-06-12 17:55:00 +02:00
Rafal Walczyna
876622a061
Fix vera++ rule to find expressions without space after parentheses (#3776)
Regex didn't include some characters that may occur after ')'

JerryScript-DCO-1.0-Signed-off-by: Rafal Walczyna r.walczyna@samsung.com
2020-05-22 14:37:59 +02:00
Akos Kiss
f29e6f9020
Fix undefined overflow behavior when converting double to integer (#3629)
Overflows in conversions from floating-point to integer are
undefined behavior in the C99 standard. (Clause 6.3.1.4: "If the
value of the integral part cannot be represented by the integer
type, the behavior is undefined.")

When UBSAN is enabled, this gets reported at `srand()` calls. (The
random seed is usually initialized using the date port API, which
represents dates as `double`s. But `srand` takes an `unsigned int`.
A simple cast from `double` to `unsigned` becomes undefined
behavior if the value is too large. And "now" is too large
nowadays. So, effectively, all executions start with an undefined
behavior.)

This patch fixes this by casting the floating-point value of the
date to an integer through a union.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2020-03-27 11:03:28 +01:00
Roland Takacs
420643d645 Use Python 3.6 in case of Zephyr target (#3493)
PyYAML requires Python 2.7 or Python 3.4+.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs r.takacs2@partner.samsung.com
2020-01-07 12:53:53 +01:00
Csaba Osztrogonác
e8bc7a2b93 Update API version to 2.1.0. (#3220)
Closes #3104.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-10-16 15:14:56 +02:00
Roland Takacs
6f515f079e Remove ARTIK 053 from the targets. (#3206)
ARTIK devices are no longer supported by the manufacturer.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs r.takacs2@partner.samsung.com
2019-10-08 16:50:32 +02:00
Dániel Bátyai
f1883b9e7d
Provide support for native modules with ES6 imports (#3090)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-10-02 12:20:43 +02:00
Robert Fancsik
9ab4872244 Temporary fix for ESP8266 target on Travis (#3160)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-24 18:39:33 +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 dbatyai@inf.u-szeged.hu
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 dbatyai@inf.u-szeged.hu
2019-08-13 15:50:10 +02:00