409 Commits

Author SHA1 Message Date
Péter Gál
eebbed143d Introduce new Promise API methods (#3186)
The new API methods make it possible to get a Promise object's
result and it's state.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2019-10-28 14:07:37 +01:00
Robert Fancsik
351b88184c
Arrow functions prototype property should not be lazy instantiated (#3251)
This patch fixes #3250

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-10-28 10:33:28 +01:00
Szilagyi Adam
4b352758c1 Refactor ecma_op_to_string (#3171)
Similar to the ecma_op_to_object rework, in this new method we
return directly with the pointer to the ecma string, and we don't
wrap the result into an ecma_value_t

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-10-25 15:58:47 +02:00
Robert Fancsik
b7aa21ebc7
Fix lazy instantiation of external functions 'prototype' property (#3246)
This patch resolves #2302.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-10-25 15:56:37 +02:00
Robert Fancsik
100a012931
Fix integer overflow during byteLength calculation for %TypedArray%s (#3244)
This patch fixes #3243.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-10-25 12:36:23 +02:00
Daniel Vince
9e83032ada Fix error type when creating TypedArray with detached ArrayBuffer (#3230)
Based on the ES2015 standard TypeError should be returned
when a TypedArray is created for a detached ArrayBuffer.

JerryScript-DCO-1.0-Signed-off-by: Dániel Vince vinced@inf.u-szeged.hu
2019-10-24 15:04:38 +02:00
Robert Fancsik
3b73562fa5 Revise ES2015 feature guards (#3240)
All the basic language element guards are merged into JERRY_ES2015 macro guard.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-10-24 14:44:51 +02:00
Daniella Barsony
7b589d1381 Refactor code to use ToLength (#3210)
JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2019-10-21 14:08:13 +02:00
Virag Orkenyi
3fb6f15730 Implement Reflect object (#3036)
JerryScript-DCO-1.0-Signed-off-by: Virag Orkenyi orkvi@inf.u-szeged.hu
2019-10-21 13:46:29 +02:00
legendecas
2e86bdae6f Add ArrayBuffer detach operations (#3208)
JerryScript-DCO-1.0-Signed-off-by: legendecas legendecas@gmail.com
2019-10-16 16:41:27 +02:00
Szilagyi Adam
09c5d98e25 Optimize array push/pop for fast-array cases (#3187)
Performance results:
ARM: 1m19s -> 0m57s
Intel: 0m7,5s -> 0m5s

Binary size increase: 168 bytes

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-10-16 16:41:01 +02:00
Robert Fancsik
9e323cdcd6
Improve ecma_typedarray_info_t (#3205)
- The structure members have been renamed and the members got more detailed description.
- Updated the usage of the typedarray info structure in all occurrences to use absolute addressing from the underlying arraybuffer pointer.

This patch also fixes #3204.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-10-09 14:10:54 +02:00
Daniel Balla
7dc2d1dcd7 Fix delete operation in Set objects (#3203)
Delete should return false if an element doesn't exist in a set.
ECMA_VALUE_EMPTY wasn't checked in case of a deleted property.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-10-07 16:27:34 +02:00
Daniella Barsony
466dc903fb Add toLength and toInteger operations (#3146)
JerryScript-DCO-1.0-Signed-off-by: Daniella Barsony bella@inf.u-szeged.hu
2019-10-03 14:05:23 +02:00
Daniel Balla
64774d30ae Fix typos "enumberable" -> "enumerable" (#3189)
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-10-03 09:28:36 +02:00
Dániel Bátyai
c3bb516e4a Refactor RegExp builtin (#3136)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-10-02 16:55:16 +02:00
Szilagyi Adam
c3510fc03d Improve typedArray get, set (#3023)
Here are the following changes:
  - The getter and setter methods are callback based now, and we can use
    them with the proper typedArray id
  - The typedArray set_element and get_element methods are using memcpy now.
  - There is a new struct which contains basic informations from typedArray,
    and we are using this in most of the prototype methods.
  - Eliminated ecma_op_typedarray_set_index_prop and
    ecma_op_typedarray_get_index_prop, because these methods
    also calculated the same informations which are in the new
    struct, so we use the new method instead.

Co-authored-by: Robert Fancsik frobert@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2019-10-02 16:39:26 +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
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
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
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
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
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
Robert Fancsik
1088273bc3 Prevent fast access mode arrays from low-level property management methods (#3047)
This patch fixes #3043 and fixes #3045 and fixes #3046.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-04 10:41:29 +02:00
Daniel Balla
14e4476084 Don't use ecma_create_named_data_property in fast mode arrays (#3042)
Remove invalid use of named data properties in fast mode arrays.
Fixes #3040

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-09-03 19:43:41 +02:00
Daniel Balla
e79059c94b Fix an issue when shrinking arrays (#3041)
There was an issue with fast arrays not correctly inserting "holes" when shrinking them.

Fixes #3039

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-09-03 17:47:45 +02:00
Robert Fancsik
952fb23e0e Skip fast access arrays during hashmap frees (#3033)
Also this patch fixes some small issues during the fast array construct process.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-09-03 17:45:55 +02:00
Daniel Balla
29758101a3 Add symbol support to same_value function (#3030)
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
2019-09-02 13:52:53 +02:00
Robert Fancsik
2f1908f894
Implement fast access mode arrays (#3028)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-08-30 15:18:15 +02:00
Robert Fancsik
c6a4a86257
Improve ecma_string_t descriptor (#3016)
This patch introduces several changes conntect to ecma-strings:
 - Extend the size of the reference counter to 28 bytes from 13
 - Extend the size of the string hash to 32 bytes from 16 to use the extact FNV-1a hash
 - Introduce ECMA_STATIC_STRING_FLAG to reduce the number of string ref/derefs for static strings.
 - Introduce ECMA_STRING_CONTAINER_ASCII_STRING to store run-time allocated ASCII strings more efficiently
 - Remove ECMA_STRING_CONTAINER_LIT_NUMBER to half the storage size of the parsing time allocated floating point numbers
 - Rework the global number storage, to store only the floating point numbers
 - Optimize the lookup in the global number/string/symbol tables via reduce the number of NULL checks during decompressing the next element pointers
 - Reduce the code duplication in ecma_concat_ecma_strings and ecma_append_chars_to_string
 - Improve ecma_string_get_char with optional arguments to make it more reusable.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-08-30 15:16:27 +02:00
Robert Fancsik
ee1da14577 Optimize ecma_builtin_helper_def_prop. (#3007)
This patch removes the ecma_property_descriptor_t structure bitfields and substitutes it with an uint16_t flag field
to reduce the cost of the transformation from/into the ecma_property_flags_t.
Also the is_throw last arguments is embedded to the property descriptor structure during the property defining process to reduce the number of arguments of the function.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-08-27 18:28:03 +02:00
Robert Fancsik
47f2f0ea8b General optimizations around compressed pointer management (#3019)
ECMA_GET_POINTER is removed from:
 - property list iteration
 - lexical environment chain iteration
 - prototype chain iteration

For all these iteration the compressed pointer can be used to get the elements and only decompressed them if it is necessary.

- Properly guard ecma property hashmap routines
- Remove the redundant NULL pointer check from ecma_create_property
- Remove ecma_gc_get_object_next since it became unnecessary
- Substitute ECMA_{GET,SET}_POINTER with ECMA_{GET,SET}_NON_NULL pointer when we can assume the pointer is not NULL
- Remove ecma_get_object_prototype and ecma_get_lex_env_outer_reference helper function the reduce the number of NULL pointer checks during decompressing the pointers
- Remove ecma_get_named_accessor_property_{getter,setter} helper functions for also reduce the number of NULL pointer check/decompressions
- Remove ECMA_PROPERTY_SEARCH_DEPTH_LIMIT since in ES5 there is no way to create circular prototype chain, and the ES2015 setPrototypeOf method can resolve this error so this check during the property lookup can be eliminated.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-08-26 17:42:02 +02:00
Robert Fancsik
b47c36ad18 Eliminate ECMA_TRY_CATCH macros part I. (#3006)
Also this patch introduces several helper function to find/put/delete properties by indexed property names to reduce code duplications.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-08-26 17:20:00 +02:00
Robert Fancsik
dec9dbc926
Reduce the size of the jerry_context_t structure (#2981)
This patch substitutes several global pointer with compressed pointers to reduce the size of the structure.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-08-06 13:18:44 +02:00
Dániel Bátyai
d3c78d8c6a Improve lastIndex calculation in RegExp match (#2982)
Co-authored-by: Marko Fabo <mfabo@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-07-25 18:20:51 +02:00
Robert Fancsik
4a9e185840
Rework the engine's internal recursion limit (#2969)
This patch unifies the recursion limit checking for RegExp, function call and JSON as well.
Until now the limit was only a counter which was increased/decreased at certain points.
This counter has been substituted with a numeric limit which allows to restrict the stack usage.

This patch fixes #2963 and resolves the closed #2258 issue.

Co-authored-by: Gabor Loki loki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-07-23 15:31:37 +02:00
Dániel Bátyai
a44d584842
Fix 'eval' checking in import/export statements. (#2978)
Fixes #2975

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-07-17 14:11:13 +02:00
Dániel Bátyai
c304b9a38a
Include file path in Syntax error messages (#2941)
When using ES6 modules it was not possible to identify which module
an error originates from.

This PR changes the error message to also include the file path using
the file:line:column format, and updates the source context printing for
unhandled exceptions to use the correct file.

Co-authored-by: Marko Fabo <mfabo@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2019-07-11 12:33:02 +02:00
Robert Fancsik
3f47e1b0aa Container object's internal object must be allocated firstly (#2961)
This patch slightly reworks the container objects internal objects allocation.
This rework allows the same lifetime of the objects without the manual allocation/deallocation of the internal object.

This patch also fixes #2951.

Co-authored-by: Dániel Bátyai <dbatyai@inf.u-szeged.hu>
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-07-11 12:32:17 +02:00
Robert Fancsik
a3cd2d7ff6 This argument must be pseudo-array in {Map/Set}Iterator.prototype.next routine (#2960)
This patch fixes #2950.

Co-authored-by: Gabor Loki loki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-07-11 11:33:17 +02:00
Robert Fancsik
e902b870aa
Limit the call stack size for native/builtin functions as well (#2935)
VM_RECURSION_LIMIT only prevented the recursion of interpreted codeblocks but
native/builtin function calls can also create stack overflow due to the too deep recursion.

This patch fixes #2905.

Co-authored-by: Gabor Loki loki@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-07-05 12:21:48 +02:00
Péter Gál
eef1efa394 Rework usages/naming of configuration macros [part 3] (#2927)
Reworked the JERRY_DEBUGGER macro to be a 0/1 switch.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2019-07-01 13:12:19 +02:00
Akos Kiss
de71fe4f71
Fix implicit integer conversion reported by Clang 8 (#2928)
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2019-06-27 09:53:00 +02:00
Robert Fancsik
9d4c2315f3 Implement the Map/Set iterator operations (#2882)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2019-06-24 11:18:37 +02:00
Szilagyi Adam
03202995a0 Add missing release to ecma_op_container_foreach (#2912)
The result of the callback function was not freed
Fixes #2910

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-06-21 19:02:06 +02:00