83 Commits

Author SHA1 Message Date
Zoltan Herczeg
00e3de230f Introduce debugger status flags to control the operation of the debugger. (#1596)
Two issues were fixed as well: inserting breakpoints before non-directive
prologue strings and the receive can process multiple messages.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2017-02-21 11:57:04 +01:00
Zoltan Herczeg
b02ef67cd2 Add eval support for JerryScript debugger (#1588)
The server can accept a string, execute it with eval,
and returns with the result converted to string. In
case of exception it returns with the exception message.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2017-02-17 14:31:56 +01:00
Levente Orban
025a99ccbb Initial version of JerryScript debugger (#1557)
The debugger supports setting breakpoints, execution control (step, next, continue)
and getting backtrace. The communication is WebSocket-based, so a browser can
communicate with JerryScript without any intermediate application.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Levente Orban orbanl@inf.u-szeged.hu
2017-02-14 15:03:01 +01:00
Zoltan Herczeg
bfc5bee394 Restore deleted lines. (#1574)
In a previous patch the original null count behaviour of the
property hashmap is just only partially restored. Now it is
restored fully Also another assertion was forgot to be fixed
in another patch, and we do so now.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2017-02-10 10:53:43 +01:00
Zoltan Herczeg
cba165f8e6 Fix invalid assertion in js-parser. (#1556) (#1563)
256 registers can be used so less equal must be used instead of less.

Fixes #1556.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2017-02-06 15:50:43 +01:00
Robert Sipka
e9ab1f14d3 Set js-parser feature in the build script. (#1482)
Renamed FEATURE_PARSER_DISABLE to FEATURE_JS_PARSER.
Fixed the build error that occurred in case of disabled js-parser.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-12-12 13:43:53 +01:00
Sergio Abraham Martinez Rodriguez
db05d85a9a Add feature to remove parser. (#1476)
Remove the parser so we can save space if we are
only interested in running snapshots.

Removing the parser enables the snapshot execution.

JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez sergio.martinez.rodriguez@intel.com
2016-12-09 15:38:40 +01:00
Tilmann Scheller
0511091e8a Streamline copyright notices across the codebase. (#1473)
Since the project is now hosted at the JS Foundation we can move to unified copyright notices for the project.

Starting with this commit all future contributions to the project should only carry the following copyright notice (except for third-party code which requires copyright information to be preserved):

"Copyright JS Foundation and other contributors, http://js.foundation" (without the quotes)

This avoids cluttering the codebase with contributor-specific copyright notices which have a higher maintenance overhead and tend to get outdated quickly. Also dropping the year from the copyright notices helps to avoid yearly code changes just to update the copyright notices.

Note that each contributor still retains full copyright ownership of his/her contributions and the respective authorship is tracked very accurately via Git.

JerryScript-DCO-1.0-Signed-off-by: Tilmann Scheller t.scheller@samsung.com
2016-12-08 06:39:11 +01:00
Istvan Kadar
ff6b3a9b02 Issue #1389 fixed in parser_compute_indicies by resolving local variable hiding. (#1410)
JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
2016-10-28 14:56:13 +02:00
Zidong Jiang
86ac6445e8 Fix bug in vm call_stack_size calculation (#1345)
call_stack_size should be register_count + maximum stack depth

* We don't add in the parser to save the size of snapshot header
* jerry_snapshot_version 5 -> 6

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2016-09-15 09:54:01 +02:00
László Langó
5c330d7f8e Improve error messages
* Print location on parser errors.
 * Do not print messages on parse error if FEATURE_ERROR_MESSAGES is not set.
 * Minor style fixes

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-09-08 10:20:13 +02:00
Zoltan Herczeg
27253112c2 Remove allocator functions which stores size.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-08-19 22:39:12 -07:00
Zoltan Herczeg
b6f174cce7 Gracefully throw an error when parser runs out of memory.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-08-14 23:08:26 -07:00
Akos Kiss
a2d5acb43c Follow-up refactoring of logging-related parts
This patch:
* Ensures that all calls to `jerry_port_log` in jerry-core happen
  via macros defined in jrt.h. Also, it unifies the names of those
  macros: as `JERRY_ERROR_MSG` and `JERRY_WARNING_MSG` gave a good
  pattern that was well aligned with the naming scheme of the log
  level enum, `JERRY_DLOG` and `JERRY_DDLOG` were rewritten to
  `JERRY_DEBUG_MSG` and `JERRY_TRACE_MSG`.
* Ensures that all debug logging code parts of jerry-core (i.e.,
  memory statistics, JS byte-code dumps, and RegExp byte-code
  dumps) are guarded by macros: `JMEM_STATS`,
  `PARSER_DUMP_BYTE_CODE`, and `REGEXP_DUMP_BYTE_CODE`, which in
  turn are controled by cmake build system feature flags
  `FEATURE_MEM_STATS`, `FEATURE_PARSER_DUMP`, and
  `FEATURE_REGEXP_DUMP`.
* Ensures that all debug logging functionalities can be controled
  during run time (provided that they were enabled during build
  time): the engine has `JERRY_INIT_MEM_STATS[_SEPARATE]`,
  `JERRY_INIT_SHOW_OPCODES`, `JERRY_INIT_SHOW_REGEXP_OPCODES` init
  flags, and the default unix/linux command line app has
  corresponding command line switches.`
* Drops `FEATURE_LOG`, `JERRY_ENABLE_LOG`, and
  `JERRY_INIT_ENABLE_LOG`, as their name was misleadingly general,
  even though they mostly controled the regexp engine only. The
  above-mentioned `*REGEXP*` things mostly act as their
  replacements.
* Updates build, test, and measurement tool scripts, and
  documentation.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-08-11 22:00:12 +02:00
Akos Kiss
2eb2b22c49 Rewrite parser_boolean_t to bool
And `PARSER_{TRUE,FALSE}` to `{true,false}`.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-08-08 10:53:20 +02:00
Akos Kiss
ff21777950 Integrate JS parser module better with JRT
The fact that the JS parser had been developed as a separate
component for a while is still visible from some macros that mirror
things from JRT. This patch removes those duplicates and makes the
JS parser rely on jrt.h. (The removed macros are: `PARSER_DEBUG`,
`PARSER_INLINE`, `PARSER_NOINLINE`.)

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-08-08 10:38:22 +02:00
Akos Kiss
db36e942fb Avoid (void) and use JERRY_UNUSED
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-08-05 13:16:53 +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
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
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
eed84a7dd9 Parser improvements.
The number of delete opcodes is reduced to two from six. The
range of numbers which can be included in the byte code is
doubled from (-127,127) to (-256,256).

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-06-10 01:18:17 -07:00
László Langó
824d39c2a2 Update API functions
* Rename 'jerry_api_' prefix to 'jerry_'
 * Fix minor style issues
 * Group the API functions and add comment to each group
 * Move engine behaviour related funtions to 'jerry.h'

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-06-08 12:48:47 +02:00
László Langó
92bb551d45 Change 'mem' namspace to 'jmem'
The 'mem_' prefix is too general, so it might clash with
symbols in other libraries. Renamed the directory, file,
funtion and type names.

Related issue: #1052

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-05-20 16:01:33 +02:00
Zsolt Borbély
7813801cd3 Fix wrong indentations of function parameters
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
2016-05-02 13:38:28 +02:00
Akos Kiss
3a8d3b3bcc Unifiy the comments of preprocessor conditionals
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-04-18 19:20:49 +02:00
László Langó
b78f5a55bb Fix assertion on unhandled exceptions
Follow up fix after #815 ('a187e6d'). Fixed the following
assertion on unhandled exceptions:
  * ICE: Assertion 'ecma_get_value_type_field (value) == ECMA_TYPE_OBJECT'
    failed at ecma-helpers-value.c(ecma_get_object_from_value):375.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-04-11 10:53:15 +02:00
Zoltan Herczeg
d190ca44ae Storing byte code size in the byte code header. This reduces the
memory consumption, because the new allocator uses less memory if
the size as available when a block is freed. Snapshot generation
is also simplified.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-03-16 02:58:10 -07:00
László Langó
a187e6d60c Print error messages to be more informative
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-03-07 12:02:05 +01:00
Zsolt Borbély
3f377692d9 Small refactorings
Modifications:
* eliminate unnecessary variables, functions
* use ECMA_NUMBER macros where it is possible
* simplify code
* minor style fix (comments, increase-decrease operators)

JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
2016-03-01 13:11:43 +01:00
Dániel Bátyai
d47c36f1b4 New Allocator and improved String handling.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai@inf.u-szeged.hu
2016-03-01 10:44:35 +01:00
Zoltan Herczeg
b2426a7a94 Remove 'ecma_completion_value_t'
Remove ecma_completion_value_t, and add an extra bit to
ecma_value_t to represent errors. From the long list of
completion types only normal and error remained.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-02-17 13:52:51 +00:00
Robert Sipka
80811c8332 Warning fixes.
ISO C99 doesn’t support unnamed structs/unions.
Comparison of distinct pointer types lacks a cast.
Dereferencing type-punned pointer will break strict-aliasing rules.
Type of bit-field ‘ext’ is a GCC extension.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-02-16 13:56:07 +01:00
Robert Sipka
977bfa5d2c Remove g++ support from the [C]Make files.
Move all '.cpp' files to '.c'.
Rename comments from 'cpp' to 'c'.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-02-15 12:49:12 +01:00