2845 Commits

Author SHA1 Message Date
Robert Fancsik
e6664f6364 Fix heap buffer overflow in re_parse_char_class (#2352)
This patch fixes #2230 and fixes #2237.
Test cases are added for both issues and also adds new cases which caused the same error.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-05-28 10:13:17 +02:00
Istvan Miklos
ac9fce1d8d Merge jerry_get_value_without_error and jerry_value_clear_error_flag functions (#2350)
JerryScript-DCO-1.0-Signed-off-by: Istvan Miklos imiklos2@inf.u-szeged.hu
2018-05-25 11:40:35 +02:00
Akos Kiss
4779451284
Cleanup code around JERRY_UNREACHABLEs (#2342)
`JERRY_UNREACHABLE`s often signal code structure that could be
improved: they can usually either be rewritten to `JERRY_ASSERT`s
or eliminated by restructuring loops, `if`s or `#if`s. Roughly,
the only valid occurences are in default cases of `switch`es. And
even they can often be merged into non-default cases.

Moreover, it is dangerous to write meaningful code after
`JERRY_UNREACHABLE` because it pretends as if there was a way to
recover from an impossible situation.

This patch rewrites/eliminates `JERRY_UNREACHABLE`s where possible
and removes misleading code from after them.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-25 07:27:30 +02:00
Zoltan Herczeg
acb3e71436 Add JERRY_VLA calls to the snapshot tool. (#2357)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-05-25 10:34:55 +09:00
Akos Kiss
06910b456e Fix issues revealed by cppcheck 1.83 (#2355)
A more recent cppcheck has revealed some extra issues not detected
by the old one running on CI.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-24 15:48:34 +09:00
Robert Fancsik
9eb9fbf5f1 Fix heap buffer overflow in lit_utf_incr (#2345)
This patch fixes #2344.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-05-22 10:32:40 +02:00
Akos Kiss
43075a2ce6 Consolidate compiler-specific parts of CMakeLists (#2349)
The cmakelists contained various compiler-specific parts scattered
across the file. This patch moves them to as few conditional blocks
as possible.

Additional changes:
- `-Werror` does not depend on whether jerry-libc is enabled.
- Some stylistic fixes.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-22 17:15:40 +09:00
Akos Kiss
cc473425d3 Fix cmakelists of doctests to run generation only once (#2347)
Custom commands with outputs used in multiple targets are prone to
being executed multiple times in parallel builds (and the repeated
overwrites of the outputs may lead to various hard-to-debug
errors). The fix is to add a custom target that depends on the
custom command and make the existing targets using the outputs
depend on the new custom target.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-22 09:14:18 +02:00
Akos Kiss
299643400d Don't let doctests pollute the source tree (#2346)
The patch changes the cmakelists of the doctests to extract the
test sources from the markdown docs into the binary tree.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-20 14:37:38 +09:00
Akos Kiss
5ddbfa5953 Add AppVeyor badge to readme (#2341)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-20 14:32:52 +09:00
Akos Kiss
7424d299d8 Define JERRY_UNREACHABLE for MSVC (#2340)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-20 14:32:07 +09:00
Akos Kiss
22339e0b54 Retire the Mbed OS 3 target (#2343)
Mbed OS 3 is discontinued, long live Mbed OS 5.

resolves #2338

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-20 14:31:25 +09:00
Akos Kiss
145ab1ed79 Simplify run-time feature checks in unit tests (#2339)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-19 07:07:21 +09:00
Yonggang Luo
872825fb57 Add Windows support. (#2306)
JerryScript-DCO-1.0-Signed-off-by: PKarics karicska@gmail.com
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
2018-05-18 19:42:14 +09:00
Akos Kiss
13bd30ff54
Remove legacy jerry_get_memory_limits API function and unused configuration macros (#2329)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-18 10:43:52 +02:00
Zoltan Herczeg
5560c76b41 Convert certain push number opcodes to literals (#2328)
Binary operations are much faster with literal arguments.
The byte immediates are still kept for other cases, e.g. array declarations.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2018-05-18 17:22:53 +09:00
László Langó
64b16bf190 Update Doxygen config file and fix Doxygen warnings (#2324)
A lot of warnings remained hibben because 'EXTRACT_ALL' was previously set to YES.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2018-05-18 15:43:17 +09:00
Akos Kiss
fb6259b2ec Fix parameter constness differences in function declarations and definitions (#2337)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2018-05-18 09:39:42 +09:00
Mátyás Mustoha
0415d74a74 Reduce code duplication in the TypedArray implementations (#2319)
This patch was done in cooperation with Tamás Kéri.

JerryScript-DCO-1.0-Signed-off-by: Mátyás Mustoha mmatyas@inf.u-szeged.hu
2018-05-18 09:38:41 +09:00
Peter Gal
27dcfa51e1 Build fix after landing #2249
The old `jerry_value_has_error_flag` function was used
when the #2249 PR was merged.

Replaced with the correct `jerry_value_is_error` call.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2018-05-17 13:56:37 +02:00
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