Non-recursive vm_loop to reduce stack usage.

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2016-03-01 01:25:13 -08:00
parent 2c72bb1139
commit 1200be42b4
6 changed files with 210 additions and 165 deletions
-68
View File
@@ -35,74 +35,6 @@
* @{
*/
/**
* 'Function call' opcode handler.
*
* See also: ECMA-262 v5, 11.2.3
*
* @return ecma value
* Returned value must be freed with ecma_free_value.
*/
ecma_value_t
opfunc_call_n (ecma_value_t this_value, /**< this object value */
ecma_value_t func_value, /**< function object value */
const ecma_value_t *arguments_list_p, /**< stack pointer */
ecma_length_t arguments_list_len) /**< number of arguments */
{
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
if (!ecma_op_is_callable (func_value))
{
return ecma_raise_type_error ("");
}
ecma_object_t *func_obj_p = ecma_get_object_from_value (func_value);
ret_value = ecma_op_function_call (func_obj_p,
this_value,
arguments_list_p,
arguments_list_len);
return ret_value;
} /* opfunc_call_n */
/**
* 'Constructor call' opcode handler.
*
* See also: ECMA-262 v5, 11.2.2
*
* @return ecma value
* Returned value must be freed with ecma_free_value.
*/
ecma_value_t
opfunc_construct_n (ecma_value_t constructor_value, /**< constructor object value */
const ecma_value_t *arguments_list_p, /**< stack pointer */
ecma_length_t arguments_list_len) /**< number of arguments */
{
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
if (!ecma_is_constructor (constructor_value))
{
ret_value = ecma_raise_type_error ("");
}
else
{
ecma_object_t *constructor_obj_p = ecma_get_object_from_value (constructor_value);
ECMA_TRY_CATCH (construction_ret_value,
ecma_op_function_construct (constructor_obj_p,
arguments_list_p,
arguments_list_len),
ret_value);
ret_value = ecma_copy_value (construction_ret_value, true);
ECMA_FINALIZE (construction_ret_value);
}
return ret_value;
} /* opfunc_construct_n */
/**
* 'Variable declaration' opcode handler.
*