184 Commits

Author SHA1 Message Date
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
Ilyong Cho
0c058747f1 Implemented jerry_api_create_error()
JerryScript-DCO-1.0-Signed-off-by: Ilyong Cho ily.cho@samsung.com
2015-05-20 19:59:46 +09:00
Ruben Ayrapetyan
584149112d Recordset dynamic storage.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-05-15 18:31:18 +03:00
Ruben Ayrapetyan
82f9afcde9 Speeding up procedure for getting start of a heap block's data space for one-chunked blocks, removing general blocks support from the procedure.
- heap area is aligned on heap chunk size;
 - mem_heap_get_block_start is renamed to mem_heap_get_chunked_block_start,
   now this interface is applicable only to one-chunked blocks,
   and is significantly faster - instead of iterating list of heap blocks
   to find block header, it just aligns value of pointer to heap chunk size.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-05-15 14:45:19 +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
Ruben Ayrapetyan
51ddb25344 Adding missing long-term allocation requests to heap unit test.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-05-13 22:38:51 +03:00
SaeHie Park
da86a52fe9 Fix object free callback.
- remove jerry_set_object_free_callback()
- change jerry_api_set_object_native_handle() with object_free_callback
- related issue: https://github.com/Samsung/jerryscript/issues/17

JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
2015-05-10 17:55:26 +09:00
SaeHie Park
5ec3e2f59a Native callback in embedding jerry when object is to be freed.
JerryScript-DCO-1.0-Signed-off-by: SaeHie Park saehie.park@samsung.com
2015-05-04 19:59:58 +09:00
Ruben Ayrapetyan
9a7a644f50 Removing mem_heap_try_to_resize_block interface.
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
2015-04-30 18:54:51 +03:00
Ruben Ayrapetyan
18079fb4d3 Implementing API for invocation of a function object as a constructor. 2015-04-10 09:55:04 +03:00
Ruben Ayrapetyan
36424c0fd2 Removing contexts arguments from Jerry API; introducing jerry_push_ctx and jerry_pop_ctx interfaces; putting context-related API part under #ifdef CONFIG_JERRY_ENABLE_CONTEXTS (supposed to be implemented later, when becomes necessary). 2015-04-08 15:37:23 +03:00
Andrey Shitov
7c67606b00 Parser refactoring. Remove deserializer notion. 2015-04-07 13:05:19 +03:00
Ruben Ayrapetyan
469ef4e622 Implementing API for associating native handle (uintptr_t) values with JS objects. 2015-04-07 13:01:01 +03:00
Ruben Ayrapetyan
fc2dbf3b0b Introducing mem_heap_get_block_start routine for determining beginning of data space in a heap-allocated block. 2015-04-07 12:58:15 +03:00
Ruben Ayrapetyan
4dbc6a9d1a Implementing [[Construct]] for external function objects. 2015-04-06 12:31:29 +03:00
Ruben Ayrapetyan
83730cd6bb Implementing dispatcher for calling native handlers associated with external function objects; implementing interface for unified storage of native pointers in ecma objects. 2015-04-03 23:38:52 +03:00
Ilyong Cho
23ade8f4ff wip: Implementing external function api 2015-04-03 18:11:21 +09:00
Ruben Ayrapetyan
eb3686a49d Adding jerry_api_is_constructor interface that check if specified object is a function object that implement [[Construct]] method; changing jerry_api_is_function to recognize bound and built-in functions; optimizing jerry_api_call_function. 2015-04-01 12:39:29 +03:00
Ilyong Cho
3c2009d331 Adding Jerry api for calling function with specific this binding. 2015-04-01 11:06:20 +09:00
Ruben Ayrapetyan
33cfaa73b3 Implementation of unimplemented Jerry API parts; adding Jerry API unit test based on test prepared by Ilyong. 2015-03-30 20:54:55 +03:00
Ruben Ayrapetyan
f42faabe89 Fixing style according to rules defined in vera++ scripts. 2015-02-17 19:47:00 +03:00
Ruben Ayrapetyan
03c81e96e9 Turning on unit tests build and run during precommit. 2015-02-16 19:35:15 +03:00
Ruben Ayrapetyan
43ea53b1d7 Jerry is now split to several components: core, libc, plugins.
The components are build independently and then are linked with main module corresponding to target platform.
Core is supposed to be platform-independent, while libc and plugins are dependent on specific architecture / platform.

The commit disables unit tests building and running during precommit.
That is supposed to be fixed in a subsequent commit.

Also, the commit disables building and running valgrind targets during precommit.
Build is supposed to be turned on by an option that should be introduced later.
Valgrind-checked runs are supposed to be performed in asynchronous mode.
2015-02-13 21:54:27 +03:00
Ruben Ayrapetyan
7e4c16e4e6 Rename Jerry's libc functions: __function_name -> function_name. 2015-02-12 20:15:56 +03:00
Ruben Ayrapetyan
718bbe26f9 Refinement of project structure.
- components renaming and moving:
   - liballocator -> mem;
   - libcoreint -> vm;
   - libecmaobjects -> ecma/base;
   - libecmaoperations -> ecma/operations;
   - libecmabuiltins -> ecma/builtins;
   - libjsparser -> parser/js;
   - libintstructs -> parser/collections;
   - liboptimizer -> parser/js;
   - libperipherals -> ../plugins/lib_device_stm;
   - libruntime -> jrt;
 - generated.h now is created as intermediate during build;
 - benchmarks -> tests/benchmarks;
 - docs -> documentation;
 - demo-applications removed (loop_demo.js -> tests/blinky.js).
2015-02-10 19:00:32 +03:00
Ruben Ayrapetyan
fa6402334f Renaming sources *.c -> *.cpp. 2015-02-09 18:21:44 +03:00
Ruben Ayrapetyan
005b5370fc Switching to g++ and corresponding changes according to C++ requirements. 2015-01-16 17:27:02 +03:00
Ruben Ayrapetyan
6bb39bb8ea Introducing 'try to give memory back' callback for heap allocator to use upon allocation request that can not be satisfied by the allocator. 2014-12-18 22:25:22 +03:00
Ilmir Usmanov
dc8ab27900 Split parser into parser itself, opcodes dumper and syntax errors checker.
Add internal hash map of literal indexes:
  In this hash map key is pair of block number and literal's unique identifier in the block, and the value is a literal index that unique in the whole program.
  Block is a continues array of opcodes. So, bytecode is splitted into blocks.
  Each block has its own uid counter. To get literal index the interpreter looks up it in the hash map.
  Thus, now JS program is able to have more than 255 identifiers/string literals.
  The first 128 (0-127) uids are reserved for block's uid counter, the other 128 (128-255) are reserved for tmp variables.
2014-12-10 18:31:59 +03:00
Ilmir Usmanov
fc9e83d290 Remove obsolete unit tests. 2014-12-10 18:29:43 +03:00
Ruben Ayrapetyan
c21e186f2c Static definition of pool's area size and number of chunks in a pool; alignment of mem_block_header_t and mem_pool_state_t to MEM_ALIGNMENT. 2014-11-26 19:23:26 +03:00
Ruben Ayrapetyan
bd60d1874b Implementing resize of heap blocks.
- adding mem_heap_try_resize_block routine that tries to resize
   block using free space that is located right after the resized block;
 - placing long-term blocks from start of heap space and short-term - from end
   of the space to increase probability of success of resizing just allocated
   long-term block;
 - adding mem_heap_try_resize_block invocation to 'test_heap' unit test.
2014-11-11 15:44:31 +03:00
Ilmir Usmanov
8c7dc08d93 Add literals - replacements of strings and numbers in parser. 2014-10-31 21:22:52 +04:00
Ruben Ayrapetyan
e4629cca51 Improving precision of number to zt-string conversion, adding search for the shortest representation of number during the conversion. 2014-10-24 19:15:31 +04:00
Ilmir Usmanov
62a42fa087 Add fail tests. Fix parser. 2014-10-21 20:35:07 +04:00
Ruben Ayrapetyan
47ed774232 Fixing obj_decl opcode handler to handle property name argument as index of register variable containing a declared property's name. 2014-10-15 17:33:58 +04:00
Ilmir Usmanov
18618c6501 Freaking FINALLY: postparser 2014-10-12 20:34:23 +04:00
Ilmir Usmanov
29ffa6f777 Pretty-printer refactoring. Add pretty-printing of metas. 2014-10-09 13:19:36 +04:00
Ilmir Usmanov
3d3da5d481 Preparser: new pass to order var_decls prior to parser 2014-10-07 20:14:41 +04:00
Ilmir Usmanov
8a5b956e38 Simplify serializer/deserializer. Reduce memory usage in lexer. Create HashTable data structure. Finish preparations for introducing new strings addressation. 2014-09-23 16:45:10 +04:00
Ilmir Usmanov
d4cd8be349 Fix asserts in opfunc_*jmp_down functions. 2014-09-16 22:36:26 +04:00
Ilmir Usmanov
e77bd4f4e5 Add try-catch-finally support: parse and generate opcodes for this construct
Fix varg generation: generate *_n opcodes with parameters in following meta opcodes
Add stack internal structure: dimanically allocated stack.
Use dynamically allocated memory in parser: every local and global variables are stored in dinamically allocated stacks.
Use dynamically allocated memory in serializer: opcodes are also stored in stack.
Change is_true_jmp and is_false_jmp opcodes to relative.
Change *jmp* opcodes to be able to store opcode_counter_t instead of idx_t.
2014-09-16 21:32:59 +04:00
Ruben Ayrapetyan
cd41b236d9 Statistics of memory usage during interpretation. 2014-09-16 21:19:07 +04:00
Ruben Ayrapetyan
4d34bab9a0 Adding memory leak checks to unit tests. 2014-09-05 20:35:33 +04:00
Ruben Ayrapetyan
c5dd81cf76 Fixing memory leak in opfunc_throw. 2014-09-05 20:28:02 +04:00
Ruben Ayrapetyan
b9fd80ce36 Fixing object declaration and function expression opcode handlers; adding unit test that declares object and operates on the object's properties. 2014-09-04 21:02:29 +04:00
Ruben Ayrapetyan
50371ddf20 Implementing Array construction routine; adding unit test on array operations. 2014-09-03 17:30:03 +04:00
Ruben Ayrapetyan
76de0e9a06 Improving precision of ecma_number_to_string in case number can be represented as UInt32. 2014-09-03 15:05:58 +04:00
Ruben Ayrapetyan
813831a23b Decimal conversion of Number to zt-string (still not precise enough). Zt-string copy and length calculation helpers. 2014-09-01 21:12:02 +04:00