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:
@@ -334,15 +334,12 @@ ecma_op_abstract_relational_compare (ecma_value_t x, /**< first operand */
|
||||
{
|
||||
ecma_value_t ret_value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_EMPTY);
|
||||
|
||||
ecma_value_t first_converted_value = left_first ? x : y;
|
||||
ecma_value_t second_converted_value = left_first ? y : x;
|
||||
|
||||
// 1., 2.
|
||||
ECMA_TRY_CATCH (prim_first_converted_value,
|
||||
ecma_op_to_primitive (first_converted_value, ECMA_PREFERRED_TYPE_NUMBER),
|
||||
ecma_op_to_primitive (x, ECMA_PREFERRED_TYPE_NUMBER),
|
||||
ret_value);
|
||||
ECMA_TRY_CATCH (prim_second_converted_value,
|
||||
ecma_op_to_primitive (second_converted_value, ECMA_PREFERRED_TYPE_NUMBER),
|
||||
ecma_op_to_primitive (y, ECMA_PREFERRED_TYPE_NUMBER),
|
||||
ret_value);
|
||||
|
||||
const ecma_value_t px = left_first ? prim_first_converted_value : prim_second_converted_value;
|
||||
|
||||
Reference in New Issue
Block a user