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
@@ -28,7 +28,6 @@
void serializer_init ();
void serializer_set_show_instrs (bool);
op_meta serializer_get_op_meta (vm_instr_counter_t);
op_meta serializer_get_var_decl (vm_instr_counter_t);
vm_instr_t serializer_get_instr (const bytecode_data_header_t *, vm_instr_counter_t);
lit_cpointer_t serializer_get_literal_cp_by_uid (uint8_t, const bytecode_data_header_t *, vm_instr_counter_t);
void serializer_set_scope (scopes_tree);
@@ -37,7 +36,6 @@ const bytecode_data_header_t *serializer_merge_scopes_into_bytecode (void);
void serializer_dump_op_meta (op_meta);
void serializer_dump_var_decl (op_meta);
vm_instr_counter_t serializer_get_current_instr_counter (void);
vm_instr_counter_t serializer_get_current_var_decls_counter (void);
vm_instr_counter_t serializer_count_instrs_in_subscopes (void);
void serializer_set_writing_position (vm_instr_counter_t);
void serializer_rewrite_op_meta (vm_instr_counter_t, op_meta);