3525 Commits

Author SHA1 Message Date
Dániel Bátyai
359643b5b2 Reorganize ecma_gc_free_object (#3323)
This change cleans up object deallocation, and reorganizes the code so
that we are able to do object type specific operations before the
properties are freed.

Previously this would require extra conditions that would slow things
down regardless of object type. With this change however, object type
conditions are checked only once for each possible type.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-11-15 18:19:52 +01:00
Csaba Osztrogonác
8d24c70513 Make run-test-suite.py work with python3 too (#3324)
Changes:
- Use list comprehension instead of filter in get_tests
to ensure returning list instead of iterable object
- Fix unicode decoding issues with Popen call

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-11-15 18:12:13 +01:00
Robert Fancsik
8cf5f96c15 Introduce parser statement flags (#3318)
These flags makes the code more readable also makes the process of introducing a new statement type easier.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-15 15:57:42 +01:00
Robert Fancsik
fca0c94002 Fix the initialization of let/const patterns when block context is needed. (#3320)
Also some code cuplication is removed.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-15 14:38:14 +01:00
Robert Fancsik
8eda9bc1c3
Fix the usage of escaped identifiers in scanner_scope_find_let_declaration (#3317)
This patch fixes #3313.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-14 14:46:01 +01:00
Csaba Osztrogonác
12184d7922 Don't upload artifacts to AppVeyor (#3316)
Uploaded JerryScript binaries aren't useful in practice
but this step regularly fails with an error message:
"Error uploading artifact the storage: Unable to connect to the remote server"

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-11-14 13:58:37 +01:00
Robert Fancsik
be95aa33b4 Improve delete property with undefined base (#3312)
This patch finally resolves #2891 also the removes the related bytecode since it has become unnecessary.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-14 13:53:52 +01:00
Robert Fancsik
204de302aa Fix ecma_op_get_value_lex_env_base for let/const declarations (#3311)
This patch fixes #3306.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-14 13:52:12 +01:00
Robert Fancsik
213544ae47 Implement array/object destructuring (#3305)
This patch implements the core functionality of destructuring patterns.
Function argument/for in-of pattern are currently unsupported.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-14 13:49:49 +01:00
Zoltan Herczeg
b4b55a67a2 Fix for propagating arguments reference from nested blocks. (#3309)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-14 13:48:58 +01:00
Zoltan Herczeg
55c7590767 Remove PARSER_ARGUMENTS_NOT_NEEDED parser flag. (#3308)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-14 13:47:11 +01:00
Csaba Osztrogonác
84f60c19ce Fixing sudo usage for dependency installation (#3315)
Fixes #3288, the fix is same as the bug reporter suggested.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-11-14 10:20:30 +01:00
Csaba Osztrogonác
3b5224b98d Fix timezone in Date.prototype.toString() (#3310)
Timezone minutes part was always 0 instead of the proper value.
Additionally fixed minor typos in comments.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-11-14 10:13:15 +01:00
Zoltan Herczeg
c0cc5a1b08 Allow extending statements with block context. (#3296)
The block contexts bound to different statements are handled in the same way.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-13 12:37:23 +01:00
Zoltan Herczeg
419ccff611 Fix local variable declaration issues after function argument initialization. (#3304)
Fixes #3298
Fixes #3299
Fixes #3300
Fixes #3302

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-13 12:35:28 +01:00
Dániel Bátyai
b16b400d5b Fix cleanup upon error in String.prototype.replace (#3301)
Fixes #3297

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-11-12 10:54:26 +01:00
Szilagyi Adam
452c78182d Implement String.prototype.codePointAt method (#3291)
The algorithm is based on ECMA-262 v6, 21.1.3.3

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-11-11 15:54:49 +01:00
Zoltan Herczeg
da69589f05 Implement for[in/of]-let construct. (#3294)
This patch implements let/const support for all "for" statements.
It includes an algorithm for cloning declarative lexical environments.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-11 13:53:32 +01:00
Zoltan Herczeg
58f71e6ffa Implement left-hand-side expression parsing. (#3292)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-08 16:20:24 +01:00
kisbg
4996542f02 Added missing logical operator in js-parser-expr (#3293)
This fix is needed to build JerryScript 2.1 on a STM board.

JerryScript-DCO-1.0-Signed-off-by: bence gabor kis kisbg@inf.u-szeged.hu
2019-11-08 16:10:51 +01:00
Szilagyi Adam
798655a871 Implement Array.prototype's copyWithin method (#3269)
The algorithm is based on ECMA-262 v6, 22.1.3.3

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-11-08 15:41:20 +01:00
Zoltan Herczeg
dc458111ba Local functions should not be created globally. (#3290)
Fixes #3286.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-08 14:03:19 +01:00
Szilagyi Adam
35d9b1ab17 Implement String.fromCodePoint method (#3281)
The algorithm is based on ECMA-262 v6, 21.1.2.2

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-11-08 13:48:05 +01:00
Zoltan Herczeg
e1fc90db0e Delay the variable construction in the function body. (#3289)
Local variables inside the function body should be constructed after the
parameters are initialized. Furthermore arguments should be available
during parameter initialization.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-08 12:18:23 +01:00
Dániel Bátyai
923fd128b5
Refactor String.prototype.replace (#3284)
This change brings the replace operation up to date with ES6 by
implementing support for the @@replace well-known symbol, while
also improving performance and memory usage.

Also fixes #3070.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-11-08 12:15:28 +01:00
Robert Fancsik
f48f926a39 [[HasOwnProperty]] should update the lex-env binding of argument objects (#3283)
This patch fixes #3271.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-07 11:24:07 +01:00
Robert Fancsik
859954b330
Add missing parameter description for jerry_get_resource_name (#3285)
Also some typos are fixed.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-06 18:19:25 +01:00
Csaba Osztrogonác
44b1b9855d Make run-tests --jerry-tests --jerry-test-suite work on Windows too (#3260)
Changes:
* Bash based runners/run-test-suite.sh runner replaced with a python runner
* Common util functions moved to util.py
* Fixed EOL issues in tests directory

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-11-06 15:12:50 +01:00
Robert Fancsik
525c35f148 Introduce jerry_get_resource_name API function (#3236)
This new API function adds possibility to query the resource name of the currently executed script (including modules) or a function object.
This patch closes #2170.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-06 15:05:49 +01:00
Csaba Osztrogonác
55423ab82a Simplify ecma_builtin_date_parse function (#3280)
This PR is the preparation of the #2946 issue.
(Date.parse() should handle UTC date string format)

Changes:
- Handle min/max values in ecma_date_parse_date_chars function instead of code duplication
- Parse special characters in the new ecma_date_parse_special_char function
- Additionally fixed two parsing issue: invalid formats should be refused

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-11-06 14:51:17 +01:00
Robert Fancsik
3a505bda6b Increase the size of VM group opcodes to 256 (#3282)
Currently there is almost 115 group opcodes so increasing the number of bits which reprent a group opcode has become actual.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-06 14:49:57 +01:00
Dániel Bátyai
3b7d254e6a Add missing GC limit check to realloc with system allocator (#3279)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-11-06 11:02:28 +01:00
Ádám Kallai
a8b627a80c Implement Object.is routine from ES2015 specification (#3272)
Related part of the standard: ECMA-262 v6, 19.1.2.10

JerryScript-DCO-1.0-Signed-off-by: Adam Kallai kadam@inf.u-szeged.hu
2019-11-05 19:38:13 +01:00
Robert Fancsik
06135da642 Do not create temporary object during [[Get]] operation with primitive base (#3278)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-05 19:37:20 +01:00
Ádám Kallai
f2a67876eb Fix the same Symbol value detection in SameValue function (#3273)
'is_types_equal' checks was missing for Symbol values.

JerryScript-DCO-1.0-Signed-off-by: Adam Kallai kadam@inf.u-szeged.hu
2019-11-04 16:53:38 +01:00
Zoltan Herczeg
ab8fa74b86 Correctly handle variables imported or exported by modules. (#3270)
Remove var declaration workarounds and correctly create / use variables for modules.

Still missing: create lexical environment for automatic module conversion.
(Or remove this feature overall.)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-11-04 16:51:26 +01:00
Robert Fancsik
6f83da4c0b Implement the spread operator for array initialization (#3265)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-04 16:36:58 +01:00
Robert Fancsik
fc3cfc4fdc Arrow functions "prototype" property should not be lazy listed (#3268)
This patch fixes #3267.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-11-04 12:12:01 +01:00
Ádám Kallai
cbae33a689 Add '-flto' flag to pkg-config if the libraries built with lto (#3274)
If we build Jerry libraries with lto, this information should be
passed to pkg-config as well.

JerryScript-DCO-1.0-Signed-off-by: Adam Kallai kadam@inf.u-szeged.hu
2019-11-01 20:29:17 +01:00
Robert Fancsik
f93fa98a75
Add Number.{EPSILON, {MAX,MIN}_SAFE_INTEGER} to the builtin descriptor (#3258)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-10-31 15:06:19 +01:00
Robert Fancsik
eee41ec734
Support \u200C \u200D unicode characters (#3266)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-10-31 11:14:13 +01:00
Zoltan Herczeg
6a342fcdd6 Implement throwing ReferenceErrors for let/const variables. (#3264)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-10-31 11:09:02 +01:00
Robert Fancsik
d1faed7d03
Properly release callback result in ecma_builtin_typedarray_prototype_exec_routine (#3263)
This patch fixes #3262.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-10-31 11:08:16 +01:00
Szilagyi Adam
cc9a657425 Optimize array shift/unshift for fast-array cases (#3235)
Performance results:
Intel: 13m11s -> 0m10s
ARM: over 20m -> 2m27s

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-10-30 16:59:20 +01:00
Szilagyi Adam
222e774cc2 Optimize array indexOf/lastIndexOf for fast-array cases (#3233)
Performance result:
Intel: 0m27s -> 0m23,5s
ARM: 5m13s -> 4m20s

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-10-30 16:49:13 +01:00
Szilagyi Adam
6639bbc580 Optimize array reverse for fast-array cases. (#3231)
Performace result:
Intel: 5m30s -> 0m3,9s
ARM: over 15m -> 1m14s

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-10-30 16:44:29 +01:00
Szilagyi Adam
d801fc70bb Optimize array slice for fast-array cases (#3213)
Performance results:
Intel: 0m27s -> 0m7s
ARM: 5m42s -> 1m26s

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-10-30 16:43:17 +01:00
Zoltan Herczeg
1edfa81c76 Implement correct construction of let/const declarations and function statements. (#3259)
Various cbc opcodes are added to support the different instantiations.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-10-30 16:01:55 +01:00
Robert Fancsik
1c34539997
Rework array hole calculation for fast access mode arrays (#3248)
This patch gives possibility to Array.prototype builtin routine optimizations.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-10-29 10:10:25 +01:00
Robert Fancsik
42ab062441
Introduce ecma_op_object_get_length and ecma_op_object_get_by_index operations (#3245)
These two functions helps to reduce code duplication, also invokes the elimination of several ECMA_TRY_CATCH macros.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-10-29 10:07:20 +01:00