Repository: jerryscript-project/jerryscript
File: jerry-core/vm/vm.c (C)

Code before:
          if (boolean_value)
          {
            byte_code_p = byte_code_start_p + branch_offset;
            if (opcode_flags & VM_OC_LOGICAL_BRANCH_FLAG)
            {
              /* "Push" the value back to the stack. */
              ++stack_top_p;
              continue;
            }
          }

          ecma_fast_free_value (value);
          continue;
        }
#if ENABLED (JERRY_ESNEXT)
        case VM_OC_BRANCH_IF_NOT_UNDEFINED_NOR_NULL:
        {
          ecma_value_t value = *(--stack_top_p);

          if (!ecma_is_value_null (value) && !ecma_is_value_undefined (value))
          {
            byte_code_p = byte_code_start_p + branch_offset;
            ++stack_top_p;
            continue;
          }
          ecma_fast_free_value (value);
          continue;
        }
#endif /* ENABLED (JERRY_ESNEXT) */
        case VM_OC_PLUS:
        case VM_OC_MINUS:
        {
          result = opfunc_unary_operation (left_value, VM_OC_GROUP_GET_INDEX (opcode_data) == VM_OC_PLUS);

          if (ECMA_IS_VALUE_ERROR (result))
          {
            goto error;
          }

          *stack_top_p++ = result;
          goto free_left_value;
        }
        case VM_OC_NOT:
        {
          *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:
        {
          JERRY_STATIC_ASSERT (ECMA_DIRECT_TYPE_MASK == ((1 << ECMA_DIRECT_SHIFT) - 1),

Review comment (suggestion):
At this point `value` is neither undefined or null, so freeing this value is unnecessary. 

Code after:
          if (boolean_value)
          {
            byte_code_p = byte_code_start_p + branch_offset;
            if (opcode_flags & VM_OC_LOGICAL_BRANCH_FLAG)
            {
              /* "Push" the value back to the stack. */
              ++stack_top_p;
              continue;
            }
          }

          ecma_fast_free_value (value);
          continue;
        }
#if ENABLED (JERRY_ESNEXT)
        case VM_OC_BRANCH_IF_NULLISH:
        {
          left_value = stack_top_p[-1];

          if (!ecma_is_value_null (left_value) && !ecma_is_value_undefined (left_value))
          {
            byte_code_p = byte_code_start_p + branch_offset;
            continue;
          }
          --stack_top_p;
          continue;
        }
#endif /* ENABLED (JERRY_ESNEXT) */
        case VM_OC_PLUS:
        case VM_OC_MINUS:
        {
          result = opfunc_unary_operation (left_value, VM_OC_GROUP_GET_INDEX (opcode_data) == VM_OC_PLUS);

          if (ECMA_IS_VALUE_ERROR (result))
          {
            goto error;
          }

          *stack_top_p++ = result;
          goto free_left_value;
        }
        case VM_OC_NOT:
        {
          *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:
        {
          JERRY_STATIC_ASSERT (ECMA_DIRECT_TYPE_MASK == ((1 << ECMA_DIRECT_SHIFT) - 1),
                               direct_type_mask_must_fill_all_bits_before_the_value_starts);