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:
@@ -121,7 +121,7 @@ main (int __attr_unused___ argc,
|
||||
OPCODE_SCOPE_CODE_FLAGS_NOT_REF_ARGUMENTS_IDENTIFIER
|
||||
| OPCODE_SCOPE_CODE_FLAGS_NOT_REF_EVAL_IDENTIFIER,
|
||||
VM_IDX_EMPTY),
|
||||
getop_reg_var_decl (1u, 0u),
|
||||
getop_reg_var_decl (1u, 0u, 0u),
|
||||
getop_var_decl (0), // var a;
|
||||
getop_assignment (VM_REG_GENERAL_FIRST, 1, 1), // $tmp0 = 1;
|
||||
getop_assignment (0, 6, VM_REG_GENERAL_FIRST), // a = $tmp0;
|
||||
|
||||
Reference in New Issue
Block a user