1836 Commits

Author SHA1 Message Date
Dániel Bátyai
f7391a94ae Cleanup Valgrind macros (#3180)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-10-01 14:26:56 +02:00
Robert Fancsik
26626947c0
Inline ecma_gc_set_object_visited for performance critical code paths (#3154)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-30 16:46:31 +02:00
Robert Fancsik
57abd26c33
Optimize lcache insert (#3155)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-30 16:46:18 +02:00
Zoltan Herczeg
a8fb4eee1e Fix three minor issues. (#3165)
1) Remove an unnecessary check.
 2) Check that comma is not allowed between question mark and colon
 3) Create a hex decoding variant which does not throw error.

These are quality improvements, they have no negative impact.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-27 17:38:02 +02:00
Szilagyi Adam
711b06d018 Add new check for a special corner case to typedarray lastIndexOf (#3156)
Fixes #3129
We need to check if we use the lastIndexOf method  and if the second
argument is a number, negative, and its absolute value is bigger
than the length, then  we should return with -1.

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-09-27 16:56:24 +02:00
Zoltan Herczeg
0121b2bbcf Fix object initializers for get and set properties. (#3164)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-27 10:28:53 +02:00
Csaba Osztrogonác
4eae760180 Fix undefined references build error on Windows (x64) (#3168)
We should emit function symbols for these jerry-core functions:
- ecma_compare_ecma_strings is used by test-stringbuilder.c
- ecma_is_value_number is used by test-literal-storage.c
- ecma_date_time_within_day is used by test-date-helpers.c
- jmem_heap_alloc_block is used by test-jmem.c
- jmem_heap_free_block is used by test-jmem.c
- jmem_pools_alloc is used by test-poolman.c
- jmem_pools_free is used by test-poolman.c

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-09-26 23:13:24 +02:00
Zoltan Herczeg
97a0febaff Fix comma after an arrow function. (#3153)
Fixes #3152.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-24 12:34:24 +02:00
Zoltan Herczeg
8f7565db5f Colon tokens are not optional. (#3150)
Colon tokens must be present before the next statement is executed.

Fixes #3145

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-24 12:33:06 +02:00
Zoltan Herczeg
35a3df3f28 Fix scanning of do-while statement. (#3149)
The newline before the while part is misinterpreted.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-23 15:38:15 +02:00
Zoltan Herczeg
f2013fcb1a Free scanner info even if for statement parsing is failed. (#3141)
Fixes #3140.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-23 15:27:59 +02:00
Zoltan Herczeg
5c7df1cb2d Rework simple arrow function scanning. (#3148)
The resulting code unifies the scanning of the two
different argument definition of arrow functions.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-23 15:25:37 +02:00
Zoltan Herczeg
25b81c106c Implement statement parsing in the scanner. (#3137)
To implement let/const, the code affected by for statements needs to be identified,
and this patch implements the basic infrastructure for that. The short term benefit
is that scanner info blocks are not generated for do-while blocks.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-20 12:15:16 +02:00
Zoltan Herczeg
a7c654617d There is no need to update the scanner info chain after a for/while statement. (#3138)
Fixes #3131.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-20 02:27:05 -07:00
Csaba Osztrogonác
6c03e0f0af Fix undefined references build error on Windows (#3134)
We should emit function symbols for ecma_get_magic_string
function, because it is used by unit-test-stringbuilder.c.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-09-20 11:05:43 +02:00
Csaba Osztrogonác
c05686b668 Fix jerry_get_context_data() API function (#3127)
If manager_p->bytes_needed == 0, jerry_get_context_data() should return
NULL pointer. Additionally init_cb, deinit_cb and finalize_cb should be
called with NULL pointer in this case.

JerryScript-DCO-1.0-Signed-off-by: Csaba Osztrogonác oszi@inf.u-szeged.hu
2019-09-17 17:31:46 +02:00
Zoltan Herczeg
40e63d1207 Implement seeking in the pre-scanner info. (#3126)
After changing the lexing position, the current
position of the scanner info must be moved as well.

Fixes #3101
Fixes #3102

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-17 17:28:11 +02:00
Szilagyi Adam
0eae2f6207 Add new check to typedarray copyWithin (#3108)
We should check if the start index is equal or greater than the end index,
if thats the case, we should return with the original typedArray.

Fixes #3107

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-09-17 17:24:47 +02:00
Robert Fancsik
4452e79204 Class expression scanning must be continued with post primary expression scanning. (#3120)
This patch fixes #3117 and fixes #3119.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-16 12:58:14 +02:00
Robert Fancsik
8d9788d1b5 Fix incorrect assertion while decoding the literal argument index (#3118)
This patch fixes #3114.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-16 12:56:48 +02:00
Daniel Balla
aa8832a985 Fix string size calculation in builtin string repeat (#3116)
Fixes #3105

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-09-16 12:55:33 +02:00
Robert Fancsik
436fcbb4b7 Fix [[Delete]] operation for fast arrays. (#3115)
When popping the last element from a fast array the underlying buffer must be released.
This patch fixes #3106.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-16 12:54:16 +02:00
Zoltan Herczeg
62025cfa41 Support new Function parsing in the pre-scanner. (#3110)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-16 11:58:15 +02:00
Daniel Balla
87441635e1 Add error check to VM_OC_CLASS_INHERITANCE (#3122)
ecma_op_object_get_by_magic_id can throw an exception

Fixes #3121

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-09-16 11:32:56 +02:00
Robert Fancsik
83c44d20b3 Fix skipping empty statements during class literal scanning (#3124)
This patch fixes #3123

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-16 11:26:08 +02:00
Daniel Balla
17e63e892a Fix overflow in ecma_op_dataview_create (#3111)
Fixes #3109

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-09-13 07:19:49 -07:00
Daniel Balla
9f85d21578 Add string iterator to ecma_object_check_class_name_is_object function (#3113)
Fixes #3112

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-09-13 07:15:33 -07:00
Zoltan Herczeg
951d7e6842 Implement var statement pre-scanning. (#3103)
The patch also checks whether pre-scanning is successful when scanning is,
so no need for explicit pre-scanner checks anymore.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-13 06:36:41 -07:00
Szilagyi Adam
6e79bb148e Add toLocaleString for TypedArrays (#2987)
The algorithm is based on ECMA-262 v6, 22.2.3.27

Co-authored-by: Tibor Dusnoki tdusnoki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-09-13 13:40:56 +02:00
Zoltan Herczeg
376cfea47e Parse rest function arguments in the pre-scanner. (#3099)
Fixes #3097.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-12 09:04:00 -07:00
Zoltan Herczeg
57de923770 Support get/set function declarations in classes in the pre-scanner. (#3098)
Fixes #3094
Fixes #3095
Fixes #3096

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-12 16:09:13 +02:00
Robert Fancsik
fc30f003ba Rework ecma collection (#3086)
After this patch the ecma value collection is a resizable buffer of ecma-values where the adjacent elements are allocated next to each other.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-12 13:05:24 +02:00
Zoltan Herczeg
f3d3c34c30 Fix pre-scanner function name parsing. (#3093)
The function names of classes were incorrectly parsed.
Also made the parsing more strict (more issues were captured by the pre-scanner).

Fixes #3088
Fixes #3089

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-11 16:55:58 +02:00
Zoltan Herczeg
fbde788d1f Scanner rework. (#3038)
The scanner was an on-demand tool of the parser, which was triggered by certain
statements. After the rework, the scanner runs only once, and collects all information.
This information is passed to the parser.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-11 11:15:46 +02:00
Dániel Bátyai
6221b670d1 Keep GC object list in the order of traversal (#3087)
By appending to the end of the black object list during garbage
collection, the resulting object list will be sorted in the order of
traversal. This allows subsequent gc runs to mark surviving sub-trees in
a single iteration.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-09-11 10:54:03 +02:00
Robert Fancsik
83459c1fac Fix String.prototype.repeat for empty strings (#3085)
This patch fixes #3084.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-10 15:03:53 +02:00
Robert Fancsik
c04fe24253
Ensure that Map/Set object keys can always have MAP_KEY_STRING internal property (#3065)
This patch fixes #3062.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-09 10:38:22 +02:00
Robert Fancsik
9fbd0cce6c
Fix fast access mode arrays delete property operation (#3073)
The old last element should be released before reallocating the underlying buffer

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-09 10:37:17 +02:00
Robert Fancsik
e04bbdfff4
Fix byteLength validation in DataView constructor (#3074)
This patch fixes #3072.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-09 10:37:01 +02:00
Robert Fancsik
c79659d3b2
Fix array initialization with array holes (#3076)
Fast mode access arrays must be converted back to normal if the array hole count reaches the limit during the initializtaion.
This patch fixes #3075.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-09 10:36:48 +02:00
Robert Fancsik
3111d0e0f2
Fix the internal object reference count in Map/Set.prototype.forEach (#3081)
This patch fixes #3079.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-09 10:36:33 +02:00
Dániel Bátyai
115ad9a41c
Fix JSON.stringify for non-serializable properties (#3083)
Fixes #3082.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-09-08 23:49:27 +02:00
Robert Fancsik
2933947534 Properly decode literal index before CBC_MOV_IDENT (#3056)
This patch fixes #3055.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-07 12:23:49 +02:00
Péter Gál
5d51fe8f27 Fix TypedArray.slice with external array buffer (#3080)
In case of TypedArrays which were constructed with an ArrayBuffer
the `slice` method incorrectly added the `byteOffset` value of
when the elements were copied.

There is no need to add the `byteOffset` value for the ArrayBuffer's
contents pointer as it is already added by the `ecma_typedarray_get_buffer`
call.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2019-09-07 12:22:20 +02:00
Robert Fancsik
91818bea93 Limit the constructed string size in String.prototype.repeat (#3066)
This patch fixes #3063.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-07 12:20:57 +02:00
Péter Gál
1b84a17dc7 Correctly propagate super prop ref when parsing expressions (#3077)
The "super prop ref" flag is incorrectly used at multiple expressions
as it was only cleared if there was an assignment operation.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2019-09-06 16:56:04 +02:00
Zoltan Herczeg
96edec1a62 Improve expected identifier checks. (#3064)
Checks for "of" or "from" does not accept quoted strings.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2019-09-05 11:42:17 +02:00
Robert Fancsik
086c4ebf13
Fix array hole calculation for fast access mode arrays (#3061)
This patch fixes #3060.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-05 10:16:27 +02:00
Robert Fancsik
142f79ce05
Properly handle CBC_PUSH_THIS_LITERAL for unary lvalue operations (#3054)
This patch fixes #3048.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-05 09:52:58 +02:00
Robert Fancsik
4afcc709b8
Add fast array support for property name enumeration (#3053)
Since fast access mode arrays can be part of the prototype chain these objects must be handed separately.
This patch fixes #3050.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-05 09:49:56 +02:00