2382 Commits

Author SHA1 Message Date
Robert Sipka
15ba287b9e Change the CONFIG_ECMA_NUMBER_TYPE default value to FLOAT64 to ensure compliance with ECMAScript 5.1
which requires numbers to be represented in double precision floating-point format.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-07-29 09:51:18 +02:00
Robert Sipka
ddab1d8152 Re-thinking the build system to bring it more into line with the conventions.
We removed that implementation where the build directory isn't set up to build with exactly one
configuration of the project but potentially several variants: the same build directory
can/must be used for debug and release builds, for full or compact profile versions, etc.
So we reworked the CMakeLists, and now one build dir deal with exactly one configuration
of the project's libraries and tools.

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-07-28 12:29:55 +02:00
Tilmann Scheller
778f3c001e Remove CNAME file from the master branch.
Turns out that you need to add the CNAME file to the gh-pages branch rather than the master branch, thus removing it with this commit.

Related to #1218.

JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
2016-07-28 08:01:28 +02:00
Slavey Karadzhov
23db8b5544 Refactoring of the ESP8266 target code to match the latest API.
Fixes issue #1211.

JerryScript-DCO-1.0-Signed-off-by: Slavey Karadzhov slaff@attachix.com
2016-07-27 13:35:30 +02:00
Zoltan Herczeg
76d42b5e8e Move GC, lcache, literal storage, lexical env global variables to jerry context.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-07-21 01:36:58 -07:00
István Kádár
e7ec053362 More gc-friendly property hashmap allocation.
- New allocator is added that returns null on out of memory, property hasmap create uses this allocator for now.
- Property hashmaps of objects are removed durring a high severity gc.

Follow up patch is in progress.

JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
2016-07-20 17:31:24 +02:00
Paul Sokolovsky
80dc523ad3 targets/zephyr: REPL: Print expression result, or exception value.
With this change, REPL works almost the same as a standard JS REPL does
(browser console, Node.js, etc.). A result of each expression is
printed, e.g. "2+2" will print "4". Result is printed even if its
value is "undefined", e.g. "print(1)" will print "1", and on the next
line "undefined" (which is again how "normal" JS console work, except
a normal JS way to print to console is console.log()).

If an exception occured, a message "Error executing statement:", followed
by external representation of exception object, is printed. Note that
distinctive exception objects are supported only in "cp" (compact profile),
not in "cp_minimal". In the latter case, there's only exception hierarchy
top-level prototype, so any error message will look like:

    Error executing statement: [object Function]

(That's the reason why there's error message prefix - so it weren't too
confusing even if used in cp_minimal config. Unfortunately, compile-time
JerryScript configuration isn't available to Zephyr's main.c, so there's
no easy way to implement cp vs cp_minimal distinction).

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
2016-07-20 17:39:20 +03:00
László Langó
1cdc66060f Fix RIOT port after API update
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-20 13:00:47 +02:00
László Langó
a004375e1d Remove printf calls from jerry core
Related issue: #964

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-20 12:43:14 +02:00
Zoltan Herczeg
12916c6c55 Fix minor implementation issues found in the JerryScript API.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-07-20 01:54:00 -07:00
Tilmann Scheller
8d69e26e75 Enable custom domain.
This enables the jerryscript.net domain for the GitHub project. This configuration file is necessary to enable the redirection from http://jerryscript.net to http://samsung.github.io/jerryscript.

JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
2016-07-19 17:16:37 +02:00
István Kádár
9fcf6597f6 Memory leak is fixed in ecma_builtin_regexp_prototype_exec.
Issue fixed: #1079

JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
2016-07-19 15:07:38 +02:00
Zoltan Herczeg
3a78d30897 Introducing global context.
Currently the static variables of the allocator are moved into a
global structure.

The future plan is supporting multiple context models with different
advantages and disadvantages. Users can select the most appropriate
context model for their own use case. This context model must be
selected at compile time using compiler defines.

Currently only one model is implemented, which will be the default
context model: the context is stored in global variables, so only
a single context is available which always exists.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-07-19 05:25:34 -07:00
Zidong Jiang
ca39875690 fix bug of "deref bytecode twice" in jerry_exec_snapshot
Enable the snapshot related test code in test-api.c

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2016-07-19 18:56:06 +08:00
Zsolt Borbély
dd3f801ae0 Update a link in README.md
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
2016-07-18 09:57:32 +02:00
Zoltan Herczeg
3828f08796 Remove arbitrary case conversion tests.
Since upper/lower case conversions are unspecified by the standard,
we convert ASCII characters only, and a few other characters for
testing purposes. Because these are just random cases, it is better
to remove them before the release. At some point we could add a
unicode compatible case conversion which can be enabled at compile
time.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-07-15 06:38:13 -07:00
Zidong Jiang
6084f0845c Fix bug in jerry_string_to_char_buffer.
str_len can smaller than buffer_size.

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2016-07-15 21:06:47 +08:00
Dániel Bátyai
3354da3021 Optimize ecma_string_get_array_index
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2016-07-15 10:53:20 +02:00
László Langó
f0fd939d87 Move log level to default port
Setting the log level should be specified by the actual port.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-15 09:13:16 +02:00
László Langó
fa94c67ee7 Implement IO port API
Related issue: #964

Implemented the IO API of Jerry ports. Removed log file from API level.
The port implementation should define the destination of log messages.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-14 13:15:30 +02:00
Zoltan Herczeg
35c0869ef5 Improve resolve reference.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-07-14 02:24:00 -07:00
László Langó
1e4531c7b5 Minor fixes in API reference
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-14 09:01:27 +02:00
Zoltan Herczeg
6f1ce8d6bb Improve the construction of "length" built-in strings.
The "length" property name is the most frequently used built-in string
and also frequently created by various hot-paths. New functions are
added to improve the speed of the "length" string creation.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-07-13 23:36:27 -07:00
László Langó
b4bba2ef70 Update API reference to the new API
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-12 14:08:59 +02:00
Paul Sokolovsky
6b60e22e30 targets/zephyr: Update to new Jerry API and improve REPL interaction.
Various calls updated to use API from jerry-api.h (to-be JerryScript 1.0
API).

Use jerry_eval() instead of jerry_run_simple(), as it allow to store (and
then access) variables in a global environment. E.g. following now works
(entered and executed as two separate lines):

    a = 1
    print(a)

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
2016-07-12 14:33:07 +03:00
Dave Methvin
1ac1c09b25 Fix links to docs in README.md
JerryScript-DCO-1.0-Signed-off-by: Dave Methvin dave.methvin@gmail.com
2016-07-11 15:23:15 -04:00
László Langó
9bce5b09a9 Update Jerry API
* Removed jerry_string_t and jerry_object_t
* Updated function names
* Updated return values
* Updated function descriptions
* Added new functions
* Added new unittests

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-07-11 09:01:29 +02:00
István Kádár
cea3a142ac Regression tests are added for the recently closed fuzzer bugs.
Related issues: #380, #1065, #1073, #1074, #1075, #1080, #1081, #1082, #1083

JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
2016-07-08 14:50:09 +02:00
Zoltan Herczeg
97be8bfbc8 Simplify string management.
Allocate a single memory block for strings, rather than a separate string header
and string characters block. In the past strings were split into 8 byte chunks,
and large amount of legacy code is designed for that representation. However the
current allocator allows block allocation so we don't need those complicated
algorithms anymore. This patch is a cleanup rather than an optimization.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-07-06 03:47:48 -07:00
Zoltan Herczeg
41337dbd59 Small performance optimizations of the interpreter.
Short summary of the changes:
 - The ecma_reference_t is removed, and its helper functions are deleted.
 - The delete operation does not depend on ecma_reference_t anymore.
 - A new resolve function is added which returns the current value
   of a named binding in the context chain.
 - The vm_op_set_value does not perform type conversions when its arguments
   has the appropriate types.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-07-06 00:00:03 -07:00
Tilmann Scheller
fb9b4dd807 Fix signed left shift in vm_loop().
Signed left shift operations are undefined in C. Add constants for the minimum/maximum integer value which are already shifted. Technically, the constant for the shifted maximum value is not required, adding it for consistency/increased readability.

The bug was detected by -Wshift-negative-value both with GCC 6.x and Clang.

This fixes #1174.

JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
2016-07-05 22:01:00 +02:00
István Kádár
5f7997d2d0 Documentation converter script.
JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
2016-07-05 13:58:04 +02:00
Paul Sokolovsky
0898bf4835 targets/zephyr: Add support for NXP FRDM-K64F board.
Tested to boot and run "test" one-liner.

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
2016-07-04 17:38:13 +03:00
Zoltan Herczeg
5ed6582141 Optimize comparison in VM.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-07-04 00:01:09 -07:00
Zoltan Herczeg
d882709ed2 Optimize arithmetic in VM.
Add, substract, mul, mod, and increment/decrement operators are optimized.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-07-03 23:52:27 -07:00
István Kádár
a81c7c83d7 ecma_make_boolean_value(bool) function is added in order to make ecma_value form a raw bool.
JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
2016-07-01 16:00:56 +02:00
Sergio Martinez
c8db27c4af Fix issue when you don't flash the ARC and the x86 waits
- Fixed problem when the x86 hangs waiting for the ARC to
be initialized. If you flash as arduino_101 instead of
arduino_101_factory this will happen and you will not get
a command line.

- Changed default build to arduino_101_factory which is
the current recommended method of flashing the arduino_101

- Updated documentation to explain a few bits on how to flash
the board and conform to the v1.4.0 way of flashing the device.

- Added a helper to run the dfu-util command directly on make.

JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez sergio.martinez.rodriguez@intel.com
2016-07-01 13:40:22 +01:00
Tilmann Scheller
4921a030b3 Update README with the current binary size.
JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
2016-07-01 10:52:19 +02:00
István Kádár
1b40af729b Documentation is moved to docs.
- DEVELOPMENT.md is extended with bash utilites.
 - Internals doc added and DEVELOPMENT is renamed to GETTING-STARTED.
 - modified image links in Internals
 - links are fixed in README.md

JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
2016-06-30 14:35:23 +02:00
Sakari Poussa
88db00ae4b [zephyr] rename SOURCE_DIR to ZEPHYR_TARGET_SRC_DIR in Makefile.zephyr
In Makefile.zephyr the SOURCE_DIR variable was introduced recently.

However, the SOURCE_DIR variable is heavily used in zephyr. If you try to build
the jerryscript zephyr port from a zephyr project using the makefiles, the
SOURCE_DIR gets set by the zephyr build system and points to wrong place here.

This patch creates unique name to avoid the name clash.

JerryScript-DCO-1.0-Signed-off-by: Sakari Poussa sakari.poussa@intel.com
2016-06-30 14:48:47 +03:00
László Langó
c3541c3ab7 Check error values in API functions
Internal functions cannot handle error values, so it must be avoided to
pass error values to the engine.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-29 14:26:55 +02:00
Sakari Poussa
130be84ad1 [zephyr] Makefile tuning
Read the zephyr crosscompile settings earlier so correct values are used.

Currently, the crosscompilation does not work on OSX. With this fix it does.

JerryScript-DCO-1.0-Signed-off-by: Sakari Poussa sakari.poussa@intel.com
2016-06-28 14:28:20 +03:00
Zoltan Herczeg
e9a47aff95 Sixteen bit hash for strings.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-06-27 03:04:50 -07:00
Zoltan Herczeg
0a32c97755 Rework literal storage.
The new literal storage keeps ecma strings rather than having a
custom string implementation which duplicates the string management
routines. Conversions between string implementations are eliminated
which improved the performance by 4%.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-06-27 00:25:09 -07:00
Zoltan Herczeg
0940be57f6 Fix memcpy return value.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-06-26 23:45:58 -07:00
László Langó
388b442d10 Update API reference
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-24 13:54:23 +02:00
Zoltan Herczeg
ea0176764e Remove ECMA_OBJECT_TYPE_BUILT_IN_FUNCTION to free an object type.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-06-24 02:14:35 -07:00
László Langó
cfa0c94697 Add new API function
Implemented 'jerry_is_array' and 'jerry_get_array_length' API functions.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-24 10:08:17 +02:00
Paul Sokolovsky
4091444016 targets/zephyr: Rename from arduino_101, with more targets supported.
- Add preliminary support for ARC architecture.

Using "em_starterkit" board supported by Zephyr. Only build for this board
is tested, not booted on a real device due to lack of access. There's no
QEMU emulation support for ARC in Zephyr (yet) either.

- Update README to cover different Zephyr architectures/boards.

- Changed the arduino_101 paths to something more generic and adaptable
- Made sure it compiles and runs on Arduino 101

JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez sergio.martinez.rodriguez@intel.com
JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
2016-06-23 13:02:20 +03:00
Zoltan Herczeg
64f49385ae Four byte optimized memcpy.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-06-22 03:15:04 -07:00