21 Commits

Author SHA1 Message Date
Zoltan Herczeg
6adf0c1a87
Support BigInt to number conversion using Number constructor (#4121)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2020-08-12 16:33:31 +02:00
Robert Fancsik
39cb67397d
Remove the usage of ecma_length_t (#4009)
Now the following conventions are applied:
 - passing the number of arguments for a function call is always uint32_t
 - string size/length/position related operation should use lit_utf8_size_t
 - Extended objects internal fields must be uint32_t

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2020-07-20 16:36:27 +02:00
Dániel Bátyai
fde0d556ac
Re-target for ES.Next (#3901)
A list of changes:
- 'es2015-subset' profile is deprecated, and an 'es.next' profile is added.
- The default profile is changed to 'es.next'
- Renamed the JERRY_ES2015 guard to JERRY_ESNEXT
- Renamed JERRY_ES2015_BUILTIN_* guards to JERRY_BUILTIN_*
- Moved es2015 specific tests to a new 'es.next' subdirectory
- Updated docs, targets, and test runners to reflect these changes

Resolves #3737.

JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-06-12 17:55:00 +02:00
Szilagyi Adam
90fd881fda
Fix TypedArray initialization with another TypedArray (#3850)
Fixes #3836

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
2020-06-08 10:28:42 +02:00
Dániel Bátyai
a78c8d4f16
Add vera rules to check consecutive and trailing empty lines (#3540)
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2020-02-03 16:39:04 +01: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
Péter Gál
40f7b1c27f Rework usages/naming of configuration macros [part 1] (#2793)
There are quite a few configuration macros in the project.
As discussed in the #2520 issue there are a few awkward constructs.

Main changes:

* Renamed all CONFIG_DISABLE_<name>_BUILTIN macro to JERRY_BUILTIN_<name> format.
* The special JERRY_BUILTINS macro specifies the basic config for all es5.1 builtins.
* Renamed all CONFIG_DISABLE_ES2015_<name> to JERRY_ES2015_<name> format.
* The special JERRY_ES2015 macro specifies the basic config for all es2015 builtins.
* Renamed UNICODE_CASE_CONVERSION to JERRY_UNICODE_CASE_CONVERSION.
* Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE.
* All options (in this change) can have a value of 0 or 1.
* Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE.
  JERRY_REGEXP_STRICT_MODE is set to 0 by default.
* Reworked CONFIG_ECMA_NUMBER_TYPE macro to JERRY_NUMBER_TYPE_FLOAT64 name and now
  it uses the value 1 for 64 bit floating point numbers and 0 for 32 bit floating point
  number.
  By default the 64-bit floating point number mode is enabled.
* All new JERRY_ defines can be used wit the `#if ENABLED (JERRY_...)` construct to
  test if the feature is enabled or not.
* Added/replaced a few config.h includes to correctly propagate the macro values.
* Added sanity checks for each macro to avoid incorrectly set values.
* Updated profile documentation.
* The CMake feature names are not updated at this point.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2019-04-09 10:14:46 +02:00
Robert Fancsik
e11c499b4b Reduce ecma_{ref, deref}_object calls while using ecma_builtin_get (#2616)
The following stucture was highly frequented in the code base:

 - Get a builtin object // This operation increases the reference count of the object
 - Use it for create a new object
 - Deref the builtin object

After a builtin has been instantiated there is always at least one reference to "keep it alive",
so increase/decrease the reference count for getting the value only is unnecessary.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
2018-11-28 20:23:21 +01: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
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
Peter Gal
4b699e997a Add ArrayBuffer with user specified buffer
New API functions:
 - jerry_create_arraybuffer_external
 - jerry_get_arraybuffer_pointer

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2018-01-25 10:14:53 +09:00
Sanggyu Lee
c1cff3f961 Fix new ArrayBuffer(length) for variaous input (#1959)
Currently new ArrayBuffer(length) does not conform to ES2017.
Major JS implementations follow ES2017 for ArrayBuffer(length).

For example, new ArrayBuffer(length) should not throw RangeError
for length = NaN, undefined, negative number, floating point, and so on.

JerryScript-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com
2017-08-16 18:20:41 +08:00
Zoltan Herczeg
13b305f716 Refactoring several array buffer and typed array functions. (#1715)
The ecma_typedarray_create_object_with_typedarray function is fully rewritten.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2017-04-07 11:20:03 +02:00
Zoltan Herczeg
750e0ca9d5 Fix several style fixes for typed arrays and optimize filter a bit. (#1697)
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2017-03-30 16:06:11 +02:00
Zidong Jiang
41c63e08b1 Combine ARRAYBUFFER and TYPEDARRAY macros together (#1699)
Change CONFIG_DISABLE_ES2015_ARRAYBUFFER_BUILTIN to
CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN
Because typedarray depends on arraybuffer and it doesn't make sense to
enable arraybuffer only.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-03-30 21:22:22 +08:00
Levente Orban
c09ba8cdb3 Rename 'CONFIG_DISABLE_ARRAYBUFFER_BUILTIN' to 'CONFIG_DISABLE_ES2015_ARRAYBUFFER_BUILTIN' (#1687)
JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
2017-03-24 11:30:23 +01:00
Zidong Jiang
c6f22a9683 Make sure the size arg of alloc will not overflow (#1618)
Also make sure the bytelength = arraylength << shift will not overflow

Fix issue #1616

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-03-07 08:37:19 +09:00
Zidong Jiang
adfe61b4ed [ES2015 profile]add TypedArray intrinsic object (#1507)
* add %TypedArray% intrinsic object
* implement Int8Array
* will implement other types and prototype functions
in the following patches.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2017-01-13 11:04:34 +01:00
Zidong Jiang
85b6e01bc2 Stop inlining the ArrayBuffer helper functions. (#1484)
Related issue #1468.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2016-12-12 20:07:51 +01:00
Zidong Jiang
551aaa58e6 Fix unchecked size number conversion in ArrayBuffer (#1479)
Free_value after ecma_op_to_number and a related test file.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2016-12-09 14:54:34 +01:00
Zidong Jiang
29d058cec4 Add ES2015 feature: ArrayBuffer (#1467)
This patch implements ArrayBuffer and ArrayBuffer.prototype built-in objects.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2016-12-07 14:04:01 +01:00