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:
@@ -292,9 +292,10 @@ VM_OP_3 (is_false_jmp_down, IS_FALSE_JMP_DOWN,
|
||||
VM_OP_1 (var_decl, VAR_DECL,
|
||||
variable_name, VM_OP_ARG_TYPE_STRING)
|
||||
|
||||
VM_OP_2 (reg_var_decl, REG_VAR_DECL,
|
||||
VM_OP_3 (reg_var_decl, REG_VAR_DECL,
|
||||
tmp_regs_num, VM_OP_ARG_TYPE_INTEGER_CONST,
|
||||
local_var_regs_num, VM_OP_ARG_TYPE_INTEGER_CONST)
|
||||
local_var_regs_num, VM_OP_ARG_TYPE_INTEGER_CONST,
|
||||
arg_regs_num, VM_OP_ARG_TYPE_INTEGER_CONST)
|
||||
|
||||
VM_OP_3 (meta, META,
|
||||
type, VM_OP_ARG_TYPE_INTEGER_CONST,
|
||||
|
||||
Reference in New Issue
Block a user