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:
Zoltan Herczeg
2016-05-30 05:56:22 -07:00
parent 08c312bc55
commit f24be95f89
12 changed files with 149 additions and 193 deletions
+1 -2
View File
@@ -80,9 +80,8 @@ ecma_value_t
opfunc_logical_not (ecma_value_t left_value) /**< left value */
{
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_TRUE);
ecma_value_t to_bool_value = ecma_op_to_boolean (left_value);
if (ecma_is_value_true (to_bool_value))
if (ecma_op_to_boolean (left_value))
{
ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_FALSE);
}