678 Commits

Author SHA1 Message Date
István Kádár
afa7b78b45 New unicode character handling using array data structure.
JerryScript-DCO-1.0-Signed-off-by: István Kádár ikadar@inf.u-szeged.hu
2016-03-03 15:21:43 +01:00
Zoltan Herczeg
1200be42b4 Non-recursive vm_loop to reduce stack usage.
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
2016-03-02 01:52:55 -08: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
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
Robert Sipka
5d3aa98b3b Warning fix for ALL_IN_ONE.
Passing argument 2 of ‘lexer_same_identifiers’ discards ‘const’ qualifier from pointer target type.

JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-02-25 15:05:18 +01:00
Akos Kiss
866ef5bcf3 Add some more consts to get data moved from .data to .rodata
We already had some `const`s but it was still not enough.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-02-22 13:04:34 +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
ad6107b32b Turn some global variables static const
Generally, it helps the optimizing passes of the compiler if global
varibles are `static`, and it is good for RAM usage to have data
marked read-only `const`. Found some globals, which could benefit
from these qualifiers.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-02-17 10:55:09 +01:00
Akos Kiss
b2f3ec225e Get the alpha order of lexer keywords right
Two keywords violate the ordering. Should someone depend on the
alpha order in the future (because the `keyword_length_*` arrays
seem to be ordered)` then this issue will be a nightmare to debug.
Better get this right now.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2016-02-17 10:38:47 +01: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
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
Robert Sipka
b0bdf0ebf4 Merge the js-parser and parser files
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka rsipka.uszeged@partner.samsung.com
2016-02-10 12:35:55 +01:00
Roland Takacs
cd6ff690d0 Add missing parentheses for bit operations where type cast is used.
Fix for #853. These modifications are required by gcc 4.9 or above.

JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
2016-02-09 13:29:41 +01:00
László Langó
d132c37f0a Optimize number literals.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-02-09 13:20:22 +01:00
László Langó
e763280761 Fix Vera++ rule for switch statements.
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
2016-02-09 13:13:40 +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
Sung-Jae Lee
eda775a8ca Fix build break on OSX: Invalid type comparision.
JerryScript-DCO-1.0-Signed-off-by: Sung-Jae Lee sjlee@mail.com
2016-01-29 22:40:55 +09:00
Roland Takacs
70a67797d2 Refactor opcodes-dumper to not use C++ features.
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
2016-01-20 10:58:06 +01:00
Hanjoung Lee
f6bd5afa42 Fix linked-list removal of last element
JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com
2016-01-14 19:47:16 +09:00
Ruben Ayrapetyan
6d1bf13948 Fix incorrect assertion in bc_load_bytecode_data.
Related issue: #797

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2016-01-13 18:30:33 +03:00
Roland Takacs
21f561f8ef Refactor literal-storage to not use C++ features
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs rtakacs.u-szeged@partner.samsung.com
2016-01-13 15:19:07 +01:00
Ruben Ayrapetyan
f932b7d48c Fix handling of property accessors in loop condition expressions and in argument of with statement.
Related issue: #798

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2016-01-11 13:42:12 +03:00
Andrey Shitov
50d124bfc3 Parser optimizations.
- parser is now non-recursive (i.e. parse function is not called recursively in any case);
 - byte-code is now more compact:
    - constants are now not immediately dumped upon occurence, but later - where necessary;
    - assignments are combined with unary / binary operations;
    - binary operations are encoded more compactly in many cases;
 - byte-code arrays are now allocated separately for each scope (so, GC of the scopes now becomes possible);
 - byte-code is dumped directly into corresponding byte-code arrays:
   - linked lists of op_meta are not now used for main code of a scope.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-12-23 14:21:10 +03:00
SaeHie Park
8fbde244e9 Move log message output(fprintf, puthcar) to target code
Related issue #752

JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
2015-12-08 07:48:16 +09:00
Zidong Jiang
3d286b46d0 Fix bug in linked_list_block_size().
and Ruben Ayrapetyan fix a bug in linked_list_switch_to_next_elem

Related issue: #720

JerryScript-DCO-1.0-Signed-off-by: Zidong Jiang zidong.jiang@intel.com
2015-12-02 12:12:03 +03:00
Hanjoung Lee
ce3b785c83 Fix lexing number literal
Related issue: #745

JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com
2015-12-02 11:36:30 +09:00
Hanjoung Lee
f20db76dfb Fix parse error of parse_switch_statement
Related issue: #725

JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com
2015-11-27 12:19:09 +09:00
Hanjoung Lee
140982e900 Fix PropertyName not to be resolved as a local variable
JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com

JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com
2015-11-13 13:29:38 +09:00
Ilyong Cho
94cb6aec26 Fix prop_getters stack manipulation for assignment expression.
Related issue: #614

JerryScript-DCO-1.0-Signed-off-by: Ilyong Cho ily.cho@samsung.com
2015-11-09 11:02:57 +09:00
Ruben Ayrapetyan
8af87206c9 Fix ecma_builtin_global_object_decode_uri_helper.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-11-03 18:42:01 +03:00
Ruben Ayrapetyan
911163e787 Optimize object literal byte-code - store property names as literal arguments, instead passing them through register variables.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-11-02 17:47:18 +03:00
Ruben Ayrapetyan
1fe2817457 Introduce parser-time optimization that moves function's argument values to registers.
For functions with the optimization applied:
 - vm puts arguments values immediately to registers without putting them to variables in lexical environment;
 - number of arguments is extracted from corresponding 'reg_var_decl' instruction's argument;
 - for functions that also don't have local variables, lexical environments are not created.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-11-02 17:15:13 +03:00
Ruben Ayrapetyan
4d2ad40475 Remove var_decls_count field from scopes_tree header; getting "var_decl"s count using linked_list_get_length instead.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-11-02 17:10:45 +03:00
Ruben Ayrapetyan
0ef9c486c1 Introduce linked_list_chunk_header (header of a linked_list's chunk), add list's length field into linked_list's header; support removal of elements in linked_list.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-11-02 17:10:45 +03:00
Ruben Ayrapetyan
841c1ed61c Fix usage of array_list in parse_switch_statement.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-11-01 16:51:43 +03:00
Ruben Ayrapetyan
f2ced3d91c Fix check for 'eval' and 'arguments' functions' names / argument names in strict mode.
Related issue: #686

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-10-30 17:31:04 +03:00
Ruben Ayrapetyan
3025bd1750 Fix handling of SyntaxError in FormalParameterList during 'new Function' constructor operation.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-10-30 17:26:17 +03:00
Ruben Ayrapetyan
04ca231fa4 Fix jsp_early_error_check_for_duplication_of_prop_names.
Related issue: #689

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-10-30 16:41:16 +03:00
Ruben Ayrapetyan
f2c54fbe39 Fix serializer_remove_bytecode_data.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-10-30 16:41:16 +03:00
Ruben Ayrapetyan
4500965316 Fix handling of non-reference operands in prefix operations.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-10-30 16:41:16 +03:00
Hanjoung Lee
906558b8e9 Fix: switch statement jumps to incorrect case body
JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com
2015-10-29 19:16:12 +09:00
Hanjoung Lee
3e31931537 Fix: parse error when no expression follows after 'return', 'break', 'continue'
JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com
2015-10-29 18:06:28 +09:00
Hanjoung Lee
fcebf654cc Fix: parser bug in parse_switch_statement
JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com
2015-10-29 11:09:48 +09:00
Ruben Ayrapetyan
1e2dfc73f5 Remove of 'this_binding' opcode.
- introduce 'const' register type;
 - adding constant register for reading ThisBinding value of active interpreter context.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-10-23 15:45:28 +03:00
Ruben Ayrapetyan
f2c3e59bbe Change reg_var_decl instruction arguments to [number of registers for temporaries; number of register for local variables].
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-10-23 15:45:28 +03:00
Ilyong Cho
31ae0977f6 Fix lexing of illegal exponential.
Related issue: #339

JerryScript-DCO-1.0-Signed-off-by: Ilyong Cho ily.cho@samsung.com
2015-10-23 13:52:56 +09:00
Hanjoung Lee
448984dd74 Fix: parsing regex and div operator correctly
JerryScript-DCO-1.0-Signed-off-by: Hanjoung Lee hanjoung.lee@samsung.com
2015-10-22 14:15:18 +09:00