45 Commits

Author SHA1 Message Date
Ruben Ayrapetyan
dc095bb902 Enhancement of argument list parsing loop: removing break / continue operators, so that every iteration passes start and end of loop body.
The change makes possible simple notification of byte-code generator about start / end of byte-code generation for an argument.
As register values are not passed between byte-code sequences that prepare different arguments, the change would make possible for byte-code generator to reuse registers allocated for the code sequences.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-29 17:23:51 +03:00
Ruben Ayrapetyan
06dffdec8f Remove exit completion value type.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-29 10:24:18 +03:00
Ruben Ayrapetyan
447358cd4a Remove intrinsics support from parser.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-29 10:24:18 +03:00
Ruben Ayrapetyan
507411f0a0 Implement parse of for-in statement.
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-26 20:21:59 +03:00
Ruben Ayrapetyan
9b414deb8d Introduce explicit description of registers (temporary variables) ranges.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-26 20:10:31 +03:00
László Langó
e027b4d65d Enable regular expressions.
- add regular expressions support to JS parser and interpreter;
- add tests for 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:10 +02:00
László Langó
1f9add4735 Add ecma_char_is_word_char helper (part of IsWordChar abstract operation, ECMA-262 v5, 15.10.2.6); move hex_to_int from lexer to jerry-core/ecma/base/ecma-helpers-char.cpp, renaming it to ecma_char_hex_to_int.
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:00 +02:00
Ruben Ayrapetyan
f849cc6283 Fix parse of simple for statement.
Related issue: #156

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-25 20:29:36 +03:00
Ruben Ayrapetyan
601f1eea58 Introduce jsp_skip_braces function for skiping blocks, surrounded with braces.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-25 20:29:36 +03:00
Ruben Ayrapetyan
5f174cf8bf Remove 'process_keyword_names' stage, as keyword literals now can be registered during main parse stage.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-25 20:29:36 +03:00
Ruben Ayrapetyan
d7ecd4a467 Fix raise of syntax errors for unmatched braces.
Related issue: #43, #183

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-25 16:47:45 +03:00
Ruben Ayrapetyan
4ff9e79b02 Generate anonymous function expressions for getters / setters of an object literal.
Related issue: #234

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-24 15:37:42 +03:00
Peter Gal
77b01a6473 Provide assert as an external method.
Removed the internal assert implementation from the engine
and provide externally an assert function via api calls.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2015-06-23 18:08:51 +02:00
Ruben Ayrapetyan
ab2abfa8b3 Fix receiving of byte-code instructions from serializer.
Related issue: #203

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-23 13:49:46 +03:00
Ruben Ayrapetyan
a536073da4 Add literal registration in parse_member_expression (TOK_KEYWORD case).
Related issue: #116

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-23 12:39:45 +03:00
Ruben Ayrapetyan
a4e54e736e Support syntax error feedback in parser.
Now, parser correctly finishes parse procedure if syntax of source code is incorrect (syntax correctness is indicated using return value):
 - parser-internal memory management is performed using jsp_mm_alloc / jsp_mm_free;
 - upon detection of incorrect syntax, all parser-allocated memory regions are deallocated using jsp_mm_free_all and parse finishes with corresponding return value.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-19 17:05:15 +03:00
Ruben Ayrapetyan
85f12de139 Introduce parser-specific managed memory allocator with interface jsp_mm_free_all that, upon call, frees all memory allocated with the allocator.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-19 16:25:34 +03:00
Ruben Ayrapetyan
9b0f5d439d Introduce jsp_label_remove_all_labels interface that removes all jump labels registered at the moment of call for usage upon raise of SyntaxError during parse.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-19 16:25:34 +03:00
Ruben Ayrapetyan
bd9d1d4afd Improve allocation of memory for byte-code array and literal identifiers hash table.
- literal identifiers hash table and byte-code array are now allocated in one heap block instead of four blocks;
 - memory regions with the hash tables and arrays are now linked into linked list using headers at start of the regions instead of using array_list.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-19 16:25:34 +03:00
Ruben Ayrapetyan
4e563932f1 Remove parser_init / parser_free interfaces (corresponding actions are now performed in parser_parse_program); introduce boolean return value in parser invocation interfaces that would indicate whether SyntaxError was raised during parse.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-19 16:25:34 +03:00
Ruben Ayrapetyan
2bf25f10eb Move jerry-core/parser/collections to jerry-core/parser/js/collections.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-19 16:25:34 +03:00
Ruben Ayrapetyan
446e8bf989 Replacing 'this_arg' meta opcode with more general 'call site additional information' meta opcode with flags describing the call site features, and, optionally, 'this' argument.
Introducing opcode_call_flags_t for argument of the new meta opcode, currently with two flags: 'have this argument' and '"direct call to eval" form'.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-13 18:17:23 +03:00
Andrey Shitov
3577261261 Add support for eval in parser.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-13 18:01:30 +03:00
Andrey Shitov
53801e3b41 Replace array of literals with literal storage.
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-06-10 21:40:10 +03:00
SaeHie Park
723924f36f New External Magic String API to save heap memory
JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
2015-06-09 07:50:43 +09:00
Ruben Ayrapetyan
2270db9414 Removing 'nestings' from parser.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-05 20:18:29 +03:00
Ruben Ayrapetyan
d99d779486 Support labelled statements.
Related issue: #52

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-05 19:02:08 +03:00
Ruben Ayrapetyan
2de49cdba7 Fix of 'case' / 'default' statements skip during parse of SwitchStatement.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-05 18:52:09 +03:00
Ruben Ayrapetyan
ac87616f05 Fixing break / continue, nested into 'try', 'with' blocks.
Related issue: #128

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-04 17:39:48 +03:00
Ruben Ayrapetyan
8433df3097 Introducing interpreter run scopes.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-04 17:39:48 +03:00
Ruben Ayrapetyan
712f8b0c9a Introducing 'try' and 'with' nestings in parser.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-04 17:39:48 +03:00
Ruben Ayrapetyan
3ec6948bae Fix parsing of 'default' switch-case label in 'parse_switch_statement'.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-04 17:34:44 +03:00
Ruben Ayrapetyan
4c10a6d057 Restoring lost review fixes for pull request #102 (instantiation of Arguments object).
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-06-03 15:58:07 +03:00
Ruben Ayrapetyan
8b28cac99e Implementing escape sequences support with the exception of "\0" ("<NUL>") character and cases that depend on Unicode support.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-05-29 14:03:11 +03:00
Ruben Ayrapetyan
7025f97fdd Adding routine for conversion of any character sequence (not only strings contained in source code buffer) to lexer token.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-05-29 13:46:07 +03:00
Ruben Ayrapetyan
b1a31c8144 Adding scope's code flags indicating whether the scope's code reference 'arguments' and 'eval' identifiers.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-05-28 19:12:54 +03:00
Ruben Ayrapetyan
cb600da269 Introducing 'scope flags' opcode containing set of flags that indicate various properties of a scope; replacing 'strict mode' meta opcode with a flag in the flags set.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-05-28 19:12:54 +03:00
Andrey Shitov
9763a93df3 Add new coding style rules and fix appeared issues.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-05-14 14:44:57 +03:00
Andrey Shitov
b496e68d27 Fix missing var_decl.
JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
2015-04-30 20:49:25 +03:00
Ruben Ayrapetyan
bb258ad1e2 Supporting build with gcc/g++ version 4.7.
Build was tested on arm-linux-gnueabi-gcc/g++ 4.7.3.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-04-30 18:54:50 +03:00
Andrey Shitov
0c7d358157 Fix invalid processing of keyword literals. 2015-04-14 14:28:39 +03:00
Andrey Shitov
7c67606b00 Parser refactoring. Remove deserializer notion. 2015-04-07 13:05:19 +03:00
Andrey Shitov
e459ab7d64 Optimize parser memory consumption. Remove 'prev' and 'block_size' fields form the linked list structure. Remove 'magic' field from structures used in parser. 2015-04-01 11:48:23 +03:00
Ruben Ayrapetyan
f42faabe89 Fixing style according to rules defined in vera++ scripts. 2015-02-17 19:47:00 +03:00
Ruben Ayrapetyan
88353e93cf Renaming core -> jerry-core. 2015-02-17 19:08:55 +03:00