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:
@@ -164,8 +164,12 @@ typedef enum : vm_idx_t
|
||||
OPCODE_SCOPE_CODE_FLAGS_STRICT = (1u << 0), /**< code is strict mode code */
|
||||
OPCODE_SCOPE_CODE_FLAGS_NOT_REF_ARGUMENTS_IDENTIFIER = (1u << 1), /**< code doesn't reference
|
||||
* 'arguments' identifier */
|
||||
OPCODE_SCOPE_CODE_FLAGS_NOT_REF_EVAL_IDENTIFIER = (1u << 2) /**< code doesn't reference
|
||||
OPCODE_SCOPE_CODE_FLAGS_NOT_REF_EVAL_IDENTIFIER = (1u << 2), /**< code doesn't reference
|
||||
* 'eval' identifier */
|
||||
OPCODE_SCOPE_CODE_FLAGS_ARGUMENTS_ON_REGISTERS = (1u << 3), /**< function's arguments are moved to registers,
|
||||
* so should be initialized in vm registers,
|
||||
* and not in lexical environment */
|
||||
OPCODE_SCOPE_CODE_FLAGS_NO_LEX_ENV = (1u << 4) /**< no lex. env. is necessary for the function */
|
||||
} opcode_scope_code_flags_t;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user