Repository: jerryscript-project/jerryscript
File: jerry-core/ecma/base/ecma-gc.c (C)

Code before:
        {
          if (object_p->u1.property_list_cp != JMEM_CP_NULL)
          {
            ecma_value_t *values_p = ECMA_GET_NON_NULL_POINTER (ecma_value_t, object_p->u1.property_list_cp);

            for (uint32_t i = 0; i < ext_object_p->u.array.length; i++)
            {
              if (ecma_is_value_object (values_p[i]))
              {
                ecma_gc_set_object_visited (ecma_get_object_from_value (values_p[i]));
              }
            }
          }

          return;
        }
        break;
      }
#if ENABLED (JERRY_BUILTIN_PROXY)
      case ECMA_OBJECT_TYPE_PROXY:
      {
        ecma_gc_mark_proxy_object (object_p);
        /* No need to free the properties of a proxy (there should be none) */
        JERRY_ASSERT ((object_p->u1.property_list_cp == JMEM_CP_NULL)
                      || (ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (object_p->u1.property_list_cp) != 0)
                      || (ECMA_GET_SECOND_BIT_FROM_POINTER_TAG (object_p->u1.property_list_cp) != 0));
        return;
      }
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
      case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
      {
        ecma_gc_mark_bound_function_object (object_p);
        break;
      }
      case ECMA_OBJECT_TYPE_FUNCTION:
      {
        if (!ecma_get_object_is_builtin (object_p))
        {
          ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
          ecma_gc_set_object_visited (ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t,
                                                                                  ext_func_p->u.function.scope_cp));

#if ENABLED (JERRY_ESNEXT)
          const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code (ext_func_p);

          if (CBC_FUNCTION_IS_ARROW (byte_code_p->status_flags))
          {
            ecma_arrow_function_t *arrow_func_p = (ecma_arrow_function_t *) object_p;

            if (ecma_is_value_object (arrow_func_p->this_binding))
            {

Review comment (suggestion):
The `(ECMA_GET_FIRST_BIT_FROM_POINTER_TAG (object_p->u1.property_list_cp) != 0` condition invalidates the whole point of `(object_p->u1.property_list_cp == JMEM_CP_NULL)`, doesn't it?

The condition should look like: `(object_p->u1.property_list_cp & ~0x3) == JMEM_CP_NULL` (of course with some macros)

Code after:
        {
          if (object_p->u1.property_list_cp != JMEM_CP_NULL)
          {
            ecma_value_t *values_p = ECMA_GET_NON_NULL_POINTER (ecma_value_t, object_p->u1.property_list_cp);

            for (uint32_t i = 0; i < ext_object_p->u.array.length; i++)
            {
              if (ecma_is_value_object (values_p[i]))
              {
                ecma_gc_set_object_visited (ecma_get_object_from_value (values_p[i]));
              }
            }
          }

          return;
        }
        break;
      }
#if ENABLED (JERRY_BUILTIN_PROXY)
      case ECMA_OBJECT_TYPE_PROXY:
      {
        ecma_gc_mark_proxy_object (object_p);
        /* No need to free the properties of a proxy (there should be none).
         * Aside from the tag bits every other bit should be zero,
         */
        JERRY_ASSERT ((object_p->u1.property_list_cp & ~JMEM_TAG_MASK) == 0);
        return;
      }
#endif /* ENABLED (JERRY_BUILTIN_PROXY) */
      case ECMA_OBJECT_TYPE_BOUND_FUNCTION:
      {
        ecma_gc_mark_bound_function_object (object_p);
        break;
      }
      case ECMA_OBJECT_TYPE_FUNCTION:
      {
        if (!ecma_get_object_is_builtin (object_p))
        {
          ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
          ecma_gc_set_object_visited (ECMA_GET_NON_NULL_POINTER_FROM_POINTER_TAG (ecma_object_t,
                                                                                  ext_func_p->u.function.scope_cp));

#if ENABLED (JERRY_ESNEXT)
          const ecma_compiled_code_t *byte_code_p = ecma_op_function_get_compiled_code (ext_func_p);

          if (CBC_FUNCTION_IS_ARROW (byte_code_p->status_flags))
          {
            ecma_arrow_function_t *arrow_func_p = (ecma_arrow_function_t *) object_p;

            if (ecma_is_value_object (arrow_func_p->this_binding))
            {