12 Commits

Author SHA1 Message Date
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