3525 Commits

Author SHA1 Message Date
Istvan Miklos
ea1133b210 Add tests for TypedArrays by using indexing api. (#2249)
JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
2018-05-17 10:29:52 +02:00
Akos Kiss
36f6435eb8 Revert the Mbed Travis CI job to sudo-based VM to avoid sporadic OOMs
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-16 16:34:19 +02:00
Akos Kiss
53bd845d9f Move (almost all) Travis CI jobs to container-based infrastructure (#2333)
Container-based VMs promise significantly faster boot times.

More or less related changes:
- Added a JOBNAME to all jobs.
- Added `install-noapt` target to several Makefile.travis files to
  avoid `sudo apt-get install ...` steps. Those installations are
  now handled by the apt addon of Travis. The `install` targets are
  kept anyway to keep the makefiles self-contained.
- Removed a legacy workaround from the Coverity Scan job as it
  isn't necessary anymore to fiddle with the cerificates of
  scan.coverity.com.
- Fixed the Mbed and the Zephyr jobs.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-16 19:15:15 +09:00
Akos Kiss
19451fa2d1 Use ecma_number_t instead of double where possible (#2330)
Some code paths explicitly used double instead of ecma_number_t
even though the values assigned from or compared to were of type
ecma_value_t.

Related to #2251

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-16 09:17:34 +09:00
Péter Gál
38f0dbf065 Remove 'useless' variable from function.bind (#2327)
The `args_length` variable in the `ecma_builtin_function_prototype_object_bind`
method is not needed, the `arguments_number` variable can be
directly used.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2018-05-15 09:03:40 +09:00
Peter Gal
86111acbc4 Remove usage of comma operator in array prototype
There was a typo in the `ecma_builtin_array_prototype_helper_set_length`
method as the comma operator was used to close the statement, incorrectly

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2018-05-15 00:52:30 +02:00
Akos Kiss
65ae949dc3 Add jerryscript-compiler.h public header to cover compiler incompatibilities (#2313)
In general, public headers should not have compiler-specific
constructs but both the core and the port headers have attributes,
which are non-standard. It's better to factor out such constructs
to a common place (a new header) and hide them behind macros, which
can then be defined on a per-compiler basis.

This patch moves the existing definitions of function attributes and
likely/unlikely builtins to the new header. At the same time, it
unifies the names of these attribute defines and where they are
used. Moreover, it touches on jerry-main and removes the uses of
`__attribute__((unused))` entirely and replaces them with the
elsewhere used `(void) ...` pattern.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-14 09:41:26 +09:00
László Langó
0e131da4f7 Add SonarQube badge to 'README.md' and update '.travis.yml' to fix a warning. (#2325)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-05-12 14:20:51 +09:00
László Langó
c829b307e5 Followup fix for SonarQube setup (#2322)
Fix the condition whether Travis should run the SonarQube analysis

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-05-11 09:11:20 +02:00
Akos Kiss
134845e099 Simplify code paths within PARSER_DUMP_BYTE_CODE (#2316)
Also fix an uncovered issue in the reporting of switching to strict
mode.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-10 19:37:19 +09:00
László Langó
b0120423da
Setup SonarQube analysis in Travis CI (#2321)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-05-10 10:42:40 +02:00
Mátyás Mustoha
1261cf3a54 Fix some incorrect documentation (#2320)
JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2018-05-09 17:37:27 +02:00
Akos Kiss
d6cf634239
Refactor/fix/document the default port implementation (#2317)
- Various constructs could be expressed with simpler and/or more
  readable code.
- The jerry_port_log implementation for the debugger case was prone
  to buffer overflow error.
- Some documentation was still missing (even from
  jerryscript-port.h).

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-09 11:15:45 +02:00
László Langó
a1f71f8937 Update the 'README.md' of the JerryScript profiles. (#2309)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-05-08 17:14:41 +09:00
Akos Kiss
fbb9bf31b2 Fix documentation of port API (#2312)
The patch fixes both the doc comments in the port header and the
corresponding markdown documentation.

The patch also removes an internal configuration macro guard
exposed by the public port header.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-08 15:07:05 +09:00
Akos Kiss
7981820dfb Use logging macros in jerry-core/debugger (#2315)
...instead of directly calling the logging port API function.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-08 11:41:51 +09:00
Istvan Miklos
7e4e551dd5 Fix sign-conversion warning on gcc when compiling to raspberry pi 2 (#2308)
JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
2018-05-08 11:41:05 +09:00
Akos Kiss
5f60208d1e
Tabulation/indentation fixes (#2314)
- Status messages in CMakeLists.txt files got misaligned, fixing.
- An extra space sneaked in before an `#ifdef`, fixing.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-07 15:51:55 +02:00
Gabriel "_|Nix|_" Schulhof
6dc2764a94 modules: add ability to clear cache (#2300)
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
2018-05-04 10:12:17 +09:00
Istvan Miklos
369447aa09 Rename the jerry_value_has_abort_flag function. (#2291)
Rename the function to represent it's real functionality.

JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
2018-05-03 16:50:16 +02:00
Peter Marki
51e193de57 Remove the html based debugger tools and add a readme with information about available debug tools (#2299)
JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2018-05-03 09:36:00 +02:00
Robert Sipka
b750a9e0b2 Update links and add a new one to the latest memory usage and binary footprint results for Artik053 (#2304)
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2018-05-03 08:32:16 +02:00
Istvan Miklos
ba2e49caaa Rename the jerry_value_has_error_flag function. (#2290)
Rename the function to represent it's real functionality.

JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
2018-05-03 08:24:05 +02:00
Mátyás Mustoha
d672d1e71c Reduce code duplication between Object.isFrozen and isSealed (#2296)
JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2018-04-26 13:51:27 +02:00
Peter Marki
06ada9e6b4 Remove unused tool scripts (#2298)
JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2018-04-24 17:24:00 +09:00
Mátyás Mustoha
63ce292173 Reduce code duplication between RegExp.construct and [[Call]] (#2287)
JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2018-04-20 15:27:33 +02:00
Mátyás Mustoha
a76926623a Reduce code duplication between String.match and search (#2277)
Moved the common preparation code for 'search' and 'match'
to a separate function.

JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2018-04-20 14:04:59 +02:00
Achie72
3df6ef30c0 Implement toString and join for TypedArrays. (#2255)
JerryScript-DCO-1.0-Signed-off-by: Bela Toth tbela@inf.u-szeged.hu
2018-04-19 10:14:34 +02:00
Mátyás Mustoha
c288cdad48 Reduce code duplication between Array.reduce and reduceRight (#2280)
Their code differs only in handling the array index.

JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2018-04-19 09:13:20 +09:00
Zoltan Herczeg
5e097dc354 Add line info support. (#2286)
Add line info data to byte, which allows getting a backtrace info directly
from the engine. Snapshots are not supported.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-04-19 09:12:54 +09:00
Zoltan Herczeg
095b730f9d Improve stopping at errors. (#2278)
In some cases the debugger catches (reports) the same
exception multiple times. This is confusing since these
not new errors. This patch fixes this behaviour.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-04-18 19:31:17 +09:00
Zoltan Herczeg
96b528a486
Rework jerry_parse function. (#2282)
Remove jerry_parse_named_resource, merge its arguments to jerry_parse
and change is_strict argument to an option list for possible future extensions.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-04-17 09:51:52 +02:00
Mátyás Mustoha
3f3d4a64f1 Reduce code duplication between Array.forEach, some, and every (#2275)
Their implementation only differs in the stop condition and the
final return value.

JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2018-04-13 13:32:46 +02:00
László Langó
2bfd3b75b7 Put 'Zephyr/Arduino 101 Build Test' to allowed failures temporarily. (#2279)
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-04-13 14:28:46 +09:00
Peter Marki
d86a507fdf Eliminate dead code in ecma_builtin_object_object_get_prototype_of (#2276)
JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2018-04-11 21:03:35 +09:00
Zoltan Herczeg
e91471727f
Support abort in the debugger. (#2273)
Aborts are not caught by catch/finally blocks,
so it is possible to stop a script using the debugger.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-04-11 13:59:13 +02:00
Zoltan Herczeg
5c0c21b26a Rework snapshot execution api. (#2270)
The _at functions replaces the original functions.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-04-11 10:39:58 +09:00
Tibor Dusnoki
46309b1502 Fixes return value of 'Date.now' (#2274)
'Date.now()' should return an integer value. Fixes #2272
JerryScript-DCO-1.0-Signed-off-by: Tibor Dusnoki tdusnoki@inf.u-szeged.hu
2018-04-09 13:27:16 +02:00
tdusnoki
cb40106693 Use jerry_is_feature_enabled function instead of macros where possible (#2271)
JerryScript-DCO-1.0-Signed-off-by: Tibor Dusnoki tdusnoki@inf.u-szeged.hu
2018-04-09 08:26:36 +02:00
Peter Marki
8392eef8ad Implement the ES2015 version of Object.getPrototypeOf and add a test file for it (#2256)
JerryScript-DCO-1.0-Signed-off-by: Peter Marki marpeter@inf.u-szeged.hu
2018-04-05 14:28:28 +02:00
Zoltan Herczeg
7b226f53e0
Rework snapshot generation API. (#2259)
Also remove eval context support. It provides no practical advantage.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-04-05 13:43:55 +02:00
Martijn Thé
35926f3f85 Add finalize_cb to jerry_context_data_manager_t (#2269)
This patch adds a new finalize_cb callback to jerry_context_data_manager_t.
The callback is run as the very last thing in jerry_cleanup, after the VM has been torn down entirely.
There was already the deinit_cb, which is run while the VM is still in the process of being torn down.
The reason the deinit_cb is not always sufficient is that there may still be objects alive (because they still being referenced) that have native pointers associated with the context manager that is being deinit'ed.
As a result, the free_cb's for those objects can get called *after* the associated context manager's deinit_cb is run. This makes cleanup of manager state that is depended on by the live objects impossible to do in the deinit_cb. That type of cleanup can only be done when all values have been torn down completely.

JerryScript-DCO-1.0-Signed-off-by: Martijn The martijn.the@intel.com
2018-04-05 12:57:51 +02:00
Zoltan Herczeg
27939f0884
Simplify debugger-ws.h (#2266)
Remove several macros and types from it. This change simplifies
the external debugger interface.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-04-05 11:22:44 +02:00
ZsoltRaduska
78bd11e732 Add json parse and stringify function to jerryscript c api (#2243)
JerryScript-DCO-1.0-Signed-off-by: Zsolt Raduska rzsolt@inf.u-szeged.hu
2018-04-05 09:58:07 +02:00
ZsoltRaduska
0476523f1a Improve jerry_is_feature_enabled with object availability information (#2250)
JerryScript-DCO-1.0-Signed-off-by: Zsolt Raduska rzsolt@inf.u-szeged.hu
2018-04-05 09:54:07 +02:00
Daniel Balla
f06d637238 Add ecma_free_all_enqueued_jobs function (#2265)
This function releases any remaining promise job that wasn't completed.
Also added this function to `jerry_cleanup ()`, therefore it will be automatically run.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2018-04-05 09:49:25 +02:00
Geoff Gustafson
634d9d38da Fix bug in stringToCesu8 conversion for 0x7ff (#2267)
JerryScript-DCO-1.0-Signed-off-by: Geoff Gustafson geoff@linux.intel.com
2018-04-04 10:17:16 +02:00
Istvan Miklos
ff37959195 Remove TARGET_HOST macros (#2264)
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
2018-04-03 14:58:47 +02:00
Jimmy Huang
a0e315719b Remove websocket message macros in debugger (#2262)
JERRY_DEBUGGER_INIT_SEND_MESSAGE
JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE
JERRY_DEBUGGER_SET_SEND_MESSAGE_SIZE_FROM_TYPE

JerryScript-DCO-1.0-Signed-off-by: Jimmy Huang jimmy.huang@intel.com
2018-04-03 09:06:20 +02:00
Péter Gál
708f66ad91 Fix accessing the contents of a direct string (#2261)
In the `ecma_string_get_chars` method
the contents of a direct string is accessed incorrectly.
It tries to extract the magic string id from the
string pointer but the direct string does not need
this step.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2018-03-29 20:20:59 +02:00