Optimize conditional jumps.
The ecma_op_to_boolean return value is changed to bool for faster evaluation, and no need to swap operandos of relational compare. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -2027,8 +2027,8 @@ ecma_builtin_array_prototype_object_every (ecma_value_t this_arg, /**< this argu
|
||||
/* 7.c.ii */
|
||||
ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, arg2, call_args, 3), ret_value);
|
||||
|
||||
/* 7.c.iii, ecma_op_to_boolean always returns a simple value, so no need to free. */
|
||||
if (ecma_is_value_false (ecma_op_to_boolean (call_value)))
|
||||
/* 7.c.iii */
|
||||
if (!ecma_op_to_boolean (call_value))
|
||||
{
|
||||
ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
|
||||
}
|
||||
@@ -2125,8 +2125,8 @@ ecma_builtin_array_prototype_object_some (ecma_value_t this_arg, /**< this argum
|
||||
/* 7.c.ii */
|
||||
ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, arg2, call_args, 3), ret_value);
|
||||
|
||||
/* 7.c.iii, ecma_op_to_boolean always returns a simple value, so no need to free. */
|
||||
if (ecma_is_value_true (ecma_op_to_boolean (call_value)))
|
||||
/* 7.c.iii */
|
||||
if (ecma_op_to_boolean (call_value))
|
||||
{
|
||||
ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
|
||||
}
|
||||
@@ -2430,8 +2430,8 @@ ecma_builtin_array_prototype_object_filter (ecma_value_t this_arg, /**< this arg
|
||||
/* 9.c.ii */
|
||||
ECMA_TRY_CATCH (call_value, ecma_op_function_call (func_object_p, arg2, call_args, 3), ret_value);
|
||||
|
||||
/* 9.c.iii, ecma_op_to_boolean always returns a simple value, so no need to free. */
|
||||
if (ecma_is_value_true (ecma_op_to_boolean (call_value)))
|
||||
/* 9.c.iii */
|
||||
if (ecma_op_to_boolean (call_value))
|
||||
{
|
||||
ecma_string_t *to_index_string_p = ecma_new_ecma_string_from_uint32 (new_array_index);
|
||||
|
||||
|
||||
@@ -66,7 +66,8 @@ ecma_builtin_boolean_dispatch_call (const ecma_value_t *arguments_list_p, /**< a
|
||||
arg_value = arguments_list_p[0];
|
||||
}
|
||||
|
||||
return ecma_op_to_boolean (arg_value);
|
||||
return ecma_make_simple_value (ecma_op_to_boolean (arg_value) ? ECMA_SIMPLE_VALUE_TRUE
|
||||
: ECMA_SIMPLE_VALUE_FALSE);
|
||||
} /* ecma_builtin_boolean_dispatch_call */
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user