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:
@@ -34,18 +34,6 @@ serializer_get_op_meta (vm_instr_counter_t oc)
|
||||
return scopes_tree_op_meta (current_scope, oc);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get variable declaration of the current scope
|
||||
*
|
||||
* @return variable declaration instruction
|
||||
*/
|
||||
op_meta
|
||||
serializer_get_var_decl (vm_instr_counter_t oc) /**< index of variable declaration */
|
||||
{
|
||||
JERRY_ASSERT (current_scope);
|
||||
return scopes_tree_var_decl (current_scope, oc);
|
||||
} /* serializer_get_var_decl */
|
||||
|
||||
/**
|
||||
* Get byte-code instruction from current scope, or specified byte-code array
|
||||
*
|
||||
@@ -231,17 +219,6 @@ serializer_get_current_instr_counter (void)
|
||||
return scopes_tree_instrs_num (current_scope);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get number of variable declarations in the current scope
|
||||
*
|
||||
* @return count of variable declarations
|
||||
*/
|
||||
vm_instr_counter_t
|
||||
serializer_get_current_var_decls_counter (void)
|
||||
{
|
||||
return scopes_tree_var_decls_num (current_scope);
|
||||
} /* serializer_get_current_var_decls_counter */
|
||||
|
||||
vm_instr_counter_t
|
||||
serializer_count_instrs_in_subscopes (void)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user