Remove unnecessary check from VM_OC_NOT (#2622)

This patch removes the ECMA_IS_VALUE_ERROR check from VM_OC_NOT, since the general toBoolean operation cannot throw an exception.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik 2018-11-30 07:45:48 +01:00 committed by László Langó
parent 24817b27f9
commit 6dfa4efbfb
3 changed files with 2 additions and 25 deletions

View File

@ -67,20 +67,6 @@ vm_var_decl (vm_frame_ctx_t *frame_ctx_p, /**< interpreter context */
return ECMA_VALUE_EMPTY;
} /* vm_var_decl */
/**
* 'Logical NOT Operator' opcode handler.
*
* See also: ECMA-262 v5, 11.4.9
*
* @return ecma value
* Returned value must be freed with ecma_free_value
*/
ecma_value_t
opfunc_logical_not (ecma_value_t left_value) /**< left value */
{
return ecma_make_boolean_value (!ecma_op_to_boolean (left_value));
} /* opfunc_logical_not */
/**
* 'typeof' opcode handler.
*

View File

@ -78,9 +78,6 @@ opfunc_in (ecma_value_t left_value, ecma_value_t right_value);
ecma_value_t
opfunc_instanceof (ecma_value_t left_value, ecma_value_t right_value);
ecma_value_t
opfunc_logical_not (ecma_value_t left_value);
ecma_value_t
opfunc_typeof (ecma_value_t left_value);

View File

@ -2080,14 +2080,8 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
}
case VM_OC_NOT:
{
result = opfunc_logical_not (left_value);
if (ECMA_IS_VALUE_ERROR (result))
{
goto error;
}
*stack_top_p++ = result;
*stack_top_p++ = ecma_make_boolean_value (!ecma_op_to_boolean (left_value));
JERRY_ASSERT (ecma_is_value_boolean (stack_top_p[-1]));
goto free_left_value;
}
case VM_OC_BIT_NOT: