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
This commit is contained in:
Andrey Shitov
2015-11-03 19:14:19 +03:00
committed by Ruben Ayrapetyan
parent b1de93abd6
commit 50d124bfc3
51 changed files with 9044 additions and 7401 deletions
@@ -13,6 +13,7 @@
* limitations under the License.
*/
#include "bytecode-data.h"
#include "ecma-alloc.h"
#include "ecma-builtin-helpers.h"
#include "ecma-builtins.h"
@@ -255,15 +256,14 @@ ecma_op_create_function_object (ecma_collection_header_t *formal_params_collecti
bool is_no_lex_env = false;
vm_instr_counter_t instr_pos = first_instr_pos;
opcode_scope_code_flags_t scope_flags = vm_get_scope_flags (bytecode_header_p, instr_pos++);
if (scope_flags & OPCODE_SCOPE_CODE_FLAGS_STRICT)
if (bytecode_header_p->is_strict)
{
is_strict_mode_code = true;
}
if ((scope_flags & OPCODE_SCOPE_CODE_FLAGS_NOT_REF_ARGUMENTS_IDENTIFIER)
&& (scope_flags & OPCODE_SCOPE_CODE_FLAGS_NOT_REF_EVAL_IDENTIFIER))
if (!bytecode_header_p->is_ref_arguments_identifier
&& !bytecode_header_p->is_ref_eval_identifier)
{
/* the code doesn't use 'arguments' identifier
* and doesn't perform direct call to eval,
@@ -271,12 +271,12 @@ ecma_op_create_function_object (ecma_collection_header_t *formal_params_collecti
do_instantiate_arguments_object = false;
}
if (scope_flags & OPCODE_SCOPE_CODE_FLAGS_ARGUMENTS_ON_REGISTERS)
if (bytecode_header_p->is_args_moved_to_regs)
{
is_arguments_moved_to_regs = true;
}
if (scope_flags & OPCODE_SCOPE_CODE_FLAGS_NO_LEX_ENV)
if (bytecode_header_p->is_no_lex_env)
{
is_no_lex_env = true;
}