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
This commit is contained in:
Ruben Ayrapetyan
2015-10-26 16:23:06 +03:00
parent 46c65985e5
commit 1fe2817457
16 changed files with 604 additions and 194 deletions
+2
View File
@@ -90,8 +90,10 @@ void scopes_tree_set_op_meta (scopes_tree, vm_instr_counter_t, op_meta);
void scopes_tree_set_instrs_num (scopes_tree, vm_instr_counter_t);
op_meta scopes_tree_op_meta (scopes_tree, vm_instr_counter_t);
op_meta scopes_tree_var_decl (scopes_tree, vm_instr_counter_t);
void scopes_tree_remove_op_meta (scopes_tree tree, vm_instr_counter_t oc);
size_t scopes_tree_count_literals_in_blocks (scopes_tree);
vm_instr_counter_t scopes_tree_count_instructions (scopes_tree);
bool scopes_tree_variable_declaration_exists (scopes_tree, lit_cpointer_t);
vm_instr_t *scopes_tree_raw_data (scopes_tree, uint8_t *, size_t, lit_id_hash_table *);
void scopes_tree_set_strict_mode (scopes_tree, bool);
void scopes_tree_set_arguments_used (scopes_tree);