36 Commits

Author SHA1 Message Date
Robert Sipka
0b5a49f98b Warning fixes.
Passing argument 1 of ‘strncmp’ from incompatible pointer type.
Assignments from incompatible pointer types.
Passing argument or initialization discards ‘const’ qualifier from pointer target type.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-03-09 09:41:23 +01:00
Akos Kiss
25b0750756 Fix problems arising from incorrect use of various size types
E.g.,
* `ssize_t` was used where `lit_utf8_size_t` or `jerry_api_size_t`
  would have been correct,
* `lit_utf8_size_t` was used where `ecma_length_t` would have been
  correct.

Note, the patch also includes internal and public API changes:
* `ecma_string_to_utf8_string` does not return negative value if
   output buffer is not large enough to contain the string; the
   buffer is expected to be large enough. (`ecma_string_get_size`
   can be used to retrieve the required size.)
* `jerry_api_string_to_char_buffer` adapts the same logic (and
  `jerry_api_get_string_size` can be used to determine the
  required size of the buffer).

Related issue: #942

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-03-08 15:22:07 +01:00
László Langó
2c72bb1139 RegExp refactoring and improvements
Move RegExp bytecode functions to a separate file.
Optimize bytecode lenght on character matching.
Implement a basic RegExp cache to optimize memory
usage on duplicated RegExp in JS files. Also fix
minor style issues and add missing comments. Improve
existing comments.

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-03-01 13:54:14 +01:00
László Langó
e14d0b8942 Fix the format of doxygen comments of output arguments
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-03-01 12:37:33 +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
László Langó
a7715a5d78 Fix style issues and improve vera++ rules.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-02-18 13:27:54 +00: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
Akos Kiss
0d7ea70b41 Eliminating doxygen warnings by fixing the documentation
* Fix "end of file while inside a group" doxygen warnings.

* Fix "unknown command" doxygen warnings caused by incorrect
  argument references. Instead of `@foo`, `@a foo` is the proper
  format.

* Fix "unknown command" doxygen warnings caused by incorrect
  parameter direction specifications. Instead of `@in`, `@out`,
  and `@in-out`, `[in]`, `[out]`, and `[in,out]` are the proper
  formats.

* Wrapping special characters in quotes to avoid doxygen
  confusion. Raw pipe, semicolon, dot, backslash, etc. characters
  can drive doxygen into various misinterpretations and warnings.
  E.g.:
  ```
  End of list marker found without any preceding list items
  Found unknown command
  ```
  Putting quotes around such text snipets eliminates the errors.

* Fix the documentation of `ecma_builtin_global_object_print`. Raw
  <> and \ sequences confused doxygen in various ways (it tried to
  interpret them as XML tags and doxygen commands).

* Fix "ignoring title that does not match old title" doxygen
  warnings. At some places, the group titles were out of sync, at
  others, the group names were incorrect.

* Fix "parameters are not documented" doxygen warnings. Fixing
  various typos in the inline parameter documentations (`/*`,
  `/**`, `/** <`, and `/**>` are all considered incorrect, the
  right format is `/**<`).

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-02-16 21:05:58 +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
Roland Takacs
0219f37dcc Remove template expression from jerry_ref_unused_variables.
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
2016-02-05 14:00:44 +01:00
László Langó
d038284bff Style fix: fix comments at the end of function definitions.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-02-05 13:46:51 +01:00
László Langó
b1acf1a562 Style fix: align pointer dereference operator to right
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-02-05 13:06:34 +01:00
Roland Takacs
efc994b112 Use C type casting instead of static_cast.
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
2016-02-05 12:59:14 +01:00
Zoltan Herczeg
4d2dd22ced Compact Byte Code parser and executor for Jerry.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Tamas Gergely tgergely.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-02-05 01:15:49 -08:00
Dániel Bátyai
579b1edaa5 Refactor builtins to handle CESU-8 encoded strings.
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély zsborbely.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-10-15 16:01:10 +02:00
Ruben Ayrapetyan
b7c93f170d Remove argument names in function prototypes, declared in headers; fix '*' alignment in headers.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-09-28 18:27:10 +03:00
Ruben Ayrapetyan
a26c454219 Add warn_unused_result attribute to ecma_string_to_utf8_string. Add assertions that specified buffer size is sufficient in places, where return value of ecma_string_to_utf8_string wasn't checked prior to the changes.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-08-31 12:59:43 +03:00
Dániel Bátyai
13941df8dd Implement RegExp.prototype.compile()
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-08-24 10:10:09 +02:00
Dániel Bátyai
d2ac7c320d Fix invalid control escapes during RegExp parsing.
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
2015-08-12 11:33:15 +02:00
Szilard Ledan
e22a085fc1 Implement RegExp octal support
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
2015-08-10 15:13:21 +02:00
László Langó
ab846f6fba Fix invalid control escape in RegExp.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2015-08-06 14:45:52 +02:00
László Langó
7aacb8fc01 Remove recursion limit from RegExp engine.
Related issue: #388

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2015-08-06 09:58:50 +02:00
László Langó
57336909cb Fix RegExp matching on right brackets and braces.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2015-08-04 16:52:08 +02:00
Szilard Ledan
9ab0f23e48 Fix IgnoreCase in RegExp engine
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
2015-08-04 16:29:47 +02:00
Szilard Ledan
6ec05ff07f Refactor and cleanup the RegExp parser
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
2015-08-04 14:45:37 +02:00
László Langó
3c71daaf84 Use unicode iterators in RegExp engine and implement \d, \D, \w, \W, \s, \S, \x, \u matching in RegExp.
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2015-07-24 16:07:25 +02:00
Ruben Ayrapetyan
7b3042fdc9 Remove usage of isalpha, isdigit, isxdigit, isspace in the whole engine except implementation of JSON built-in, moving the functions to JSON built-in's module.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-20 15:47:19 +03:00
Ruben Ayrapetyan
44b7b95781 Add support of ReferenceError early error to parser.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-15 17:00:45 +03:00
László Langó
cf9d54545f Style fixes for RegExp engine.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2015-07-15 11:02:11 +02:00
László Langó
122e5c47c9 Fix assertion in RegExp bytecode realloc.
Assertion '!bc_ctx_p->current_p && !bc_ctx_p->block_end_p && !bc_ctx_p->block_start_p' failed in realloc_regexp_bytecode_block

JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2015-07-10 10:23:09 +02:00
Ruben Ayrapetyan
e8659f373c Rename ECMA_CHAR_NULL to LIT_CHAR_NULL, move it to jerry-core/lit/lit-char-helpers.h.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-02 17:38:34 +03:00
Ruben Ayrapetyan
c37964f7a9 Move helpers from ecma-helpers-char.cpp to lit-char-helpers.cpp, rename them correspondingly.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-07-02 17:36:48 +03:00
Evgeny Gavrin
56e7ead9f9 Fix build for GCC 4.7.
Related issue: #1

JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com
2015-07-01 20:52:37 +03:00
Andrey Shitov
fd9ff8e3bd Add core unicode functionality.
Add utf-8 processing routines.
Change ecma_char_t from char/uint16_t to uint16_t.
Apply all utf-8 processing routines.
Change char to jerry_api_char in API functions' declarations.

JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-29 23:27:58 +03:00
Andrey Shitov
c4b0cd2196 Change ecma_length_t and jerry_api_length_t from uint16_t to uint32_t.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-29 23:27:58 +03:00
László Langó
4ffcb4d464 Add parser and compiler of regular expressions.
JerryScript-DCO-1.0-Signed-off-by: Szilard Ledan szledan.u-szeged@partner.samsung.com
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2015-06-26 13:31:03 +02:00