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 -1
View File
@@ -27,10 +27,11 @@ extern ecma_completion_value_t vm_run_eval (const bytecode_data_header_t *, bool
extern ecma_completion_value_t vm_loop (vm_frame_ctx_t *, vm_run_scope_t *);
extern ecma_completion_value_t vm_run_from_pos (const bytecode_data_header_t *, vm_instr_counter_t,
ecma_value_t, ecma_object_t *, bool, bool);
ecma_value_t, ecma_object_t *, bool, bool, ecma_collection_header_t *);
extern vm_instr_t vm_get_instr (const vm_instr_t *, vm_instr_counter_t);
extern opcode_scope_code_flags_t vm_get_scope_flags (const bytecode_data_header_t *, vm_instr_counter_t);
extern uint8_t vm_get_scope_args_num (const bytecode_data_header_t *, vm_instr_counter_t);
extern bool vm_is_strict_mode (void);
extern bool vm_is_direct_eval_form_call (void);