Remove the ENABLED/DISABLED macros (#4515)
The removal of these macros enabled cppcheck to reveal new errors. These errors are also fixed by the patch. JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
@@ -26,9 +26,9 @@
|
||||
#include "re-compiler.h"
|
||||
#include "ecma-builtins.h"
|
||||
|
||||
#if ENABLED (JERRY_DEBUGGER)
|
||||
#if JERRY_DEBUGGER
|
||||
#include "debugger.h"
|
||||
#endif /* ENABLED (JERRY_DEBUGGER) */
|
||||
#endif /* JERRY_DEBUGGER */
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@@ -136,12 +136,12 @@ ecma_create_object_lex_env (ecma_object_t *outer_lexical_environment_p, /**< out
|
||||
ecma_object_t *binding_obj_p, /**< binding object */
|
||||
ecma_lexical_environment_type_t type) /**< type of the new lexical environment */
|
||||
{
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
JERRY_ASSERT (type == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND
|
||||
|| type == ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND);
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
#else /* !JERRY_ESNEXT */
|
||||
JERRY_ASSERT (type == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
JERRY_ASSERT (binding_obj_p != NULL
|
||||
&& !ecma_is_lexical_environment (binding_obj_p));
|
||||
@@ -284,12 +284,12 @@ ecma_get_lex_env_binding_object (const ecma_object_t *object_p) /**< object-boun
|
||||
{
|
||||
JERRY_ASSERT (object_p != NULL);
|
||||
JERRY_ASSERT (ecma_is_lexical_environment (object_p));
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
JERRY_ASSERT (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND
|
||||
|| ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_HOME_OBJECT_BOUND);
|
||||
#else /* !ENABLED (JERRY_ESNEXT) */
|
||||
#else /* !JERRY_ESNEXT */
|
||||
JERRY_ASSERT (ecma_get_lex_env_type (object_p) == ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND);
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
return ECMA_GET_NON_NULL_POINTER (ecma_object_t, object_p->u1.bound_object_cp);
|
||||
} /* ecma_get_lex_env_binding_object */
|
||||
@@ -390,7 +390,7 @@ ecma_create_property (ecma_object_t *object_p, /**< the object */
|
||||
ecma_property_header_t *first_property_p = ECMA_GET_NON_NULL_POINTER (ecma_property_header_t,
|
||||
*property_list_head_p);
|
||||
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
bool has_hashmap = false;
|
||||
|
||||
if (first_property_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
|
||||
@@ -400,7 +400,7 @@ ecma_create_property (ecma_object_t *object_p, /**< the object */
|
||||
*property_list_head_p);
|
||||
has_hashmap = true;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
|
||||
JERRY_ASSERT (ECMA_PROPERTY_IS_PROPERTY_PAIR (first_property_p));
|
||||
|
||||
@@ -424,7 +424,7 @@ ecma_create_property (ecma_object_t *object_p, /**< the object */
|
||||
|
||||
first_property_pair_p->values[0] = value;
|
||||
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
/* The property must be fully initialized before ecma_property_hashmap_insert
|
||||
* is called, because the insert operation may reallocate the hashmap, and
|
||||
* that triggers garbage collection which scans all properties of all objects.
|
||||
@@ -437,7 +437,7 @@ ecma_create_property (ecma_object_t *object_p, /**< the object */
|
||||
first_property_pair_p,
|
||||
0);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
|
||||
return first_property_pair_p->values + 0;
|
||||
}
|
||||
@@ -449,7 +449,7 @@ ecma_create_property (ecma_object_t *object_p, /**< the object */
|
||||
/* Need to query property_list_head_p again and recheck the existennce
|
||||
* of property hasmap, because ecma_alloc_property_pair may delete them. */
|
||||
property_list_head_p = &object_p->u1.property_list_cp;
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
bool has_hashmap = false;
|
||||
|
||||
if (*property_list_head_p != ECMA_NULL_POINTER)
|
||||
@@ -463,7 +463,7 @@ ecma_create_property (ecma_object_t *object_p, /**< the object */
|
||||
has_hashmap = true;
|
||||
}
|
||||
}
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
|
||||
/* Just copy the previous value (no need to decompress, compress). */
|
||||
first_property_pair_p->header.next_property_cp = *property_list_head_p;
|
||||
@@ -489,7 +489,7 @@ ecma_create_property (ecma_object_t *object_p, /**< the object */
|
||||
|
||||
first_property_pair_p->values[1] = value;
|
||||
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
/* See the comment before the other ecma_property_hashmap_insert above. */
|
||||
|
||||
if (has_hashmap)
|
||||
@@ -499,7 +499,7 @@ ecma_create_property (ecma_object_t *object_p, /**< the object */
|
||||
first_property_pair_p,
|
||||
1);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
|
||||
return first_property_pair_p->values + 1;
|
||||
} /* ecma_create_property */
|
||||
@@ -554,16 +554,16 @@ ecma_create_named_accessor_property (ecma_object_t *object_p, /**< object */
|
||||
uint8_t type_and_flags = prop_attributes;
|
||||
|
||||
ecma_property_value_t value;
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
#if JERRY_CPOINTER_32_BIT
|
||||
ecma_getter_setter_pointers_t *getter_setter_pair_p;
|
||||
getter_setter_pair_p = jmem_pools_alloc (sizeof (ecma_getter_setter_pointers_t));
|
||||
ECMA_SET_POINTER (getter_setter_pair_p->getter_cp, get_p);
|
||||
ECMA_SET_POINTER (getter_setter_pair_p->setter_cp, set_p);
|
||||
ECMA_SET_NON_NULL_POINTER (value.getter_setter_pair_cp, getter_setter_pair_p);
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
ECMA_SET_POINTER (value.getter_setter_pair.getter_cp, get_p);
|
||||
ECMA_SET_POINTER (value.getter_setter_pair.setter_cp, set_p);
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
|
||||
return ecma_create_property (object_p, name_p, type_and_flags, value, out_prop_p);
|
||||
} /* ecma_create_named_accessor_property */
|
||||
@@ -583,19 +583,19 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
|
||||
JERRY_ASSERT (ecma_is_lexical_environment (obj_p)
|
||||
|| !ecma_op_object_is_fast_array (obj_p));
|
||||
|
||||
ecma_property_t *property_p = NULL;
|
||||
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
property_p = ecma_lcache_lookup (obj_p, name_p);
|
||||
#if JERRY_LCACHE
|
||||
ecma_property_t *property_p = ecma_lcache_lookup (obj_p, name_p);
|
||||
if (property_p != NULL)
|
||||
{
|
||||
return property_p;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
#else /* !JERRY_LCACHE */
|
||||
ecma_property_t *property_p = NULL;
|
||||
#endif /* JERRY_LCACHE */
|
||||
|
||||
jmem_cpointer_t prop_iter_cp = obj_p->u1.property_list_cp;
|
||||
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
if (prop_iter_cp != JMEM_CP_NULL)
|
||||
{
|
||||
ecma_property_header_t *prop_iter_p = ECMA_GET_NON_NULL_POINTER (ecma_property_header_t,
|
||||
@@ -606,21 +606,21 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
|
||||
property_p = ecma_property_hashmap_find ((ecma_property_hashmap_t *) prop_iter_p,
|
||||
name_p,
|
||||
&property_real_name_cp);
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
#if JERRY_LCACHE
|
||||
if (property_p != NULL
|
||||
&& !ecma_is_property_lcached (property_p))
|
||||
{
|
||||
ecma_lcache_insert (obj_p, property_real_name_cp, property_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
#endif /* JERRY_LCACHE */
|
||||
return property_p;
|
||||
}
|
||||
}
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
uint32_t steps = 0;
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
jmem_cpointer_t property_name_cp = ECMA_NULL_POINTER;
|
||||
|
||||
if (ECMA_IS_DIRECT_STRING (name_p))
|
||||
@@ -657,9 +657,9 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
|
||||
break;
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
steps++;
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
prop_iter_cp = prop_iter_p->next_property_cp;
|
||||
}
|
||||
}
|
||||
@@ -698,27 +698,27 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
steps++;
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
prop_iter_cp = prop_iter_p->next_property_cp;
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
if (steps >= (ECMA_PROPERTY_HASMAP_MINIMUM_SIZE / 2))
|
||||
{
|
||||
ecma_property_hashmap_create (obj_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
#if JERRY_LCACHE
|
||||
if (property_p != NULL
|
||||
&& !ecma_is_property_lcached (property_p))
|
||||
{
|
||||
ecma_lcache_insert (obj_p, property_name_cp, property_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
#endif /* JERRY_LCACHE */
|
||||
|
||||
return property_p;
|
||||
} /* ecma_find_named_property */
|
||||
@@ -768,20 +768,20 @@ ecma_free_property (ecma_object_t *object_p, /**< object the property belongs to
|
||||
}
|
||||
else
|
||||
{
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
#if JERRY_CPOINTER_32_BIT
|
||||
ecma_getter_setter_pointers_t *getter_setter_pair_p;
|
||||
getter_setter_pair_p = ECMA_GET_NON_NULL_POINTER (ecma_getter_setter_pointers_t,
|
||||
ECMA_PROPERTY_VALUE_PTR (property_p)->getter_setter_pair_cp);
|
||||
jmem_pools_free (getter_setter_pair_p, sizeof (ecma_getter_setter_pointers_t));
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
#if JERRY_LCACHE
|
||||
if (ecma_is_property_lcached (property_p))
|
||||
{
|
||||
ecma_lcache_invalidate (object_p, name_cp, property_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
#endif /* JERRY_LCACHE */
|
||||
|
||||
if (ECMA_PROPERTY_GET_NAME_TYPE (*property_p) == ECMA_DIRECT_STRING_PTR)
|
||||
{
|
||||
@@ -803,7 +803,7 @@ ecma_delete_property (ecma_object_t *object_p, /**< object */
|
||||
|
||||
ecma_property_header_t *prev_prop_p = NULL;
|
||||
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
ecma_property_hashmap_delete_status hashmap_status = ECMA_PROPERTY_HASHMAP_DELETE_NO_HASHMAP;
|
||||
|
||||
if (cur_prop_cp != JMEM_CP_NULL)
|
||||
@@ -818,7 +818,7 @@ ecma_delete_property (ecma_object_t *object_p, /**< object */
|
||||
hashmap_status = ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP;
|
||||
}
|
||||
}
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
|
||||
while (cur_prop_cp != JMEM_CP_NULL)
|
||||
{
|
||||
@@ -835,14 +835,14 @@ ecma_delete_property (ecma_object_t *object_p, /**< object */
|
||||
{
|
||||
JERRY_ASSERT (ECMA_PROPERTY_IS_NAMED_PROPERTY (cur_prop_p->types[i]));
|
||||
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
if (hashmap_status == ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP)
|
||||
{
|
||||
hashmap_status = ecma_property_hashmap_delete (object_p,
|
||||
prop_pair_p->names_cp[i],
|
||||
cur_prop_p->types + i);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
|
||||
ecma_free_property (object_p, prop_pair_p->names_cp[i], cur_prop_p->types + i);
|
||||
cur_prop_p->types[i] = ECMA_PROPERTY_TYPE_DELETED;
|
||||
@@ -852,14 +852,14 @@ ecma_delete_property (ecma_object_t *object_p, /**< object */
|
||||
|
||||
if (cur_prop_p->types[1 - i] != ECMA_PROPERTY_TYPE_DELETED)
|
||||
{
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
/* The other property is still valid. */
|
||||
if (hashmap_status == ECMA_PROPERTY_HASHMAP_DELETE_RECREATE_HASHMAP)
|
||||
{
|
||||
ecma_property_hashmap_free (object_p);
|
||||
ecma_property_hashmap_create (object_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -876,13 +876,13 @@ ecma_delete_property (ecma_object_t *object_p, /**< object */
|
||||
|
||||
ecma_dealloc_property_pair ((ecma_property_pair_t *) cur_prop_p);
|
||||
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
#if JERRY_PROPRETY_HASHMAP
|
||||
if (hashmap_status == ECMA_PROPERTY_HASHMAP_DELETE_RECREATE_HASHMAP)
|
||||
{
|
||||
ecma_property_hashmap_free (object_p);
|
||||
ecma_property_hashmap_create (object_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
#endif /* JERRY_PROPRETY_HASHMAP */
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -961,11 +961,11 @@ ecma_named_data_property_assign_value (ecma_object_t *obj_p, /**< object */
|
||||
ecma_getter_setter_pointers_t *
|
||||
ecma_get_named_accessor_property (const ecma_property_value_t *prop_value_p) /**< property value reference */
|
||||
{
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
#if JERRY_CPOINTER_32_BIT
|
||||
return ECMA_GET_NON_NULL_POINTER (ecma_getter_setter_pointers_t, prop_value_p->getter_setter_pair_cp);
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
return (ecma_getter_setter_pointers_t *) &prop_value_p->getter_setter_pair;
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
} /* ecma_get_named_accessor_property */
|
||||
|
||||
/**
|
||||
@@ -978,14 +978,14 @@ ecma_set_named_accessor_property_getter (ecma_object_t *object_p, /**< the prope
|
||||
{
|
||||
ecma_assert_object_contains_the_property (object_p, prop_value_p, false);
|
||||
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
#if JERRY_CPOINTER_32_BIT
|
||||
ecma_getter_setter_pointers_t *getter_setter_pair_p;
|
||||
getter_setter_pair_p = ECMA_GET_NON_NULL_POINTER (ecma_getter_setter_pointers_t,
|
||||
prop_value_p->getter_setter_pair_cp);
|
||||
ECMA_SET_POINTER (getter_setter_pair_p->getter_cp, getter_p);
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
ECMA_SET_POINTER (prop_value_p->getter_setter_pair.getter_cp, getter_p);
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
} /* ecma_set_named_accessor_property_getter */
|
||||
|
||||
/**
|
||||
@@ -998,14 +998,14 @@ ecma_set_named_accessor_property_setter (ecma_object_t *object_p, /**< the prope
|
||||
{
|
||||
ecma_assert_object_contains_the_property (object_p, prop_value_p, false);
|
||||
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
#if JERRY_CPOINTER_32_BIT
|
||||
ecma_getter_setter_pointers_t *getter_setter_pair_p;
|
||||
getter_setter_pair_p = ECMA_GET_NON_NULL_POINTER (ecma_getter_setter_pointers_t,
|
||||
prop_value_p->getter_setter_pair_cp);
|
||||
ECMA_SET_POINTER (getter_setter_pair_p->setter_cp, setter_p);
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
ECMA_SET_POINTER (prop_value_p->getter_setter_pair.setter_cp, setter_p);
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
} /* ecma_set_named_accessor_property_setter */
|
||||
|
||||
/**
|
||||
@@ -1107,7 +1107,7 @@ ecma_set_property_configurable_attr (ecma_property_t *property_p, /**< [in,out]
|
||||
}
|
||||
} /* ecma_set_property_configurable_attr */
|
||||
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
#if JERRY_LCACHE
|
||||
|
||||
/**
|
||||
* Check whether the property is registered in LCache
|
||||
@@ -1141,7 +1141,7 @@ ecma_set_property_lcached (ecma_property_t *property_p, /**< property */
|
||||
}
|
||||
} /* ecma_set_property_lcached */
|
||||
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
#endif /* JERRY_LCACHE */
|
||||
|
||||
/**
|
||||
* Construct empty property descriptor, i.e.:
|
||||
@@ -1228,7 +1228,7 @@ ecma_deref_error_reference (ecma_extended_primitive_t *error_ref_p) /**< error r
|
||||
}
|
||||
} /* ecma_deref_error_reference */
|
||||
|
||||
#if ENABLED (JERRY_BUILTIN_BIGINT)
|
||||
#if JERRY_BUILTIN_BIGINT
|
||||
|
||||
/**
|
||||
* Decrease ref count of a bigint value.
|
||||
@@ -1253,7 +1253,7 @@ ecma_deref_bigint (ecma_extended_primitive_t *bigint_p) /**< bigint value */
|
||||
jmem_heap_free_block (bigint_p, mem_size);
|
||||
} /* ecma_deref_bigint */
|
||||
|
||||
#endif /* ENABLED (JERRY_BUILTIN_BIGINT) */
|
||||
#endif /* JERRY_BUILTIN_BIGINT */
|
||||
|
||||
/**
|
||||
* Create an error reference from a given value.
|
||||
@@ -1410,7 +1410,7 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
|
||||
}
|
||||
}
|
||||
|
||||
#if ENABLED (JERRY_DEBUGGER)
|
||||
#if JERRY_DEBUGGER
|
||||
if ((JERRY_CONTEXT (debugger_flags) & JERRY_DEBUGGER_CONNECTED)
|
||||
&& !(bytecode_p->status_flags & CBC_CODE_FLAGS_DEBUGGER_IGNORE)
|
||||
&& jerry_debugger_send_function_cp (JERRY_DEBUGGER_RELEASE_BYTE_CODE_CP, bytecode_p))
|
||||
@@ -1442,9 +1442,9 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
|
||||
JERRY_CONTEXT (debugger_byte_code_free_head) = byte_code_free_cp;
|
||||
return;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_DEBUGGER) */
|
||||
#endif /* JERRY_DEBUGGER */
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
if (bytecode_p->status_flags & CBC_CODE_FLAGS_HAS_TAGGED_LITERALS)
|
||||
{
|
||||
ecma_collection_t *collection_p = ecma_compiled_code_get_tagged_template_collection (bytecode_p);
|
||||
@@ -1454,19 +1454,19 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
|
||||
JERRY_CONTEXT (ecma_gc_new_objects) += collection_p->item_count * 2;
|
||||
ecma_collection_free_template_literal (collection_p);
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
#if JERRY_MEM_STATS
|
||||
jmem_stats_free_byte_code_bytes (((size_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG);
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
#endif /* JERRY_MEM_STATS */
|
||||
}
|
||||
else
|
||||
{
|
||||
#if ENABLED (JERRY_BUILTIN_REGEXP)
|
||||
#if JERRY_BUILTIN_REGEXP
|
||||
re_compiled_code_t *re_bytecode_p = (re_compiled_code_t *) bytecode_p;
|
||||
|
||||
ecma_deref_ecma_string (ecma_get_string_from_value (re_bytecode_p->source));
|
||||
#endif /* ENABLED (JERRY_BUILTIN_REGEXP) */
|
||||
#endif /* JERRY_BUILTIN_REGEXP */
|
||||
}
|
||||
|
||||
jmem_heap_free_block (bytecode_p,
|
||||
@@ -1499,7 +1499,7 @@ ecma_compiled_code_resolve_arguments_start (const ecma_compiled_code_t *bytecode
|
||||
return ((ecma_value_t *) byte_p) - ((cbc_uint16_arguments_t *) bytecode_header_p)->argument_end;
|
||||
} /* ecma_compiled_code_resolve_arguments_start */
|
||||
|
||||
#if ENABLED (JERRY_ESNEXT)
|
||||
#if JERRY_ESNEXT
|
||||
|
||||
/**
|
||||
* Resolve the position of the function name of the compiled code
|
||||
@@ -1552,7 +1552,7 @@ ecma_compiled_code_get_tagged_template_collection (const ecma_compiled_code_t *b
|
||||
return ECMA_GET_INTERNAL_VALUE_POINTER (ecma_collection_t, base_p[offset]);
|
||||
} /* ecma_compiled_code_get_tagged_template_collection */
|
||||
|
||||
#endif /* ENABLED (JERRY_ESNEXT) */
|
||||
#endif /* JERRY_ESNEXT */
|
||||
|
||||
/**
|
||||
* Get the resource name of a compiled code.
|
||||
@@ -1562,7 +1562,7 @@ ecma_compiled_code_get_tagged_template_collection (const ecma_compiled_code_t *b
|
||||
ecma_value_t
|
||||
ecma_get_resource_name (const ecma_compiled_code_t *bytecode_p) /**< compiled code */
|
||||
{
|
||||
#if ENABLED (JERRY_RESOURCE_NAME)
|
||||
#if JERRY_RESOURCE_NAME
|
||||
if (bytecode_p->status_flags & CBC_CODE_FLAGS_UINT16_ARGUMENTS)
|
||||
{
|
||||
cbc_uint16_arguments_t *args_p = (cbc_uint16_arguments_t *) bytecode_p;
|
||||
@@ -1573,10 +1573,10 @@ ecma_get_resource_name (const ecma_compiled_code_t *bytecode_p) /**< compiled co
|
||||
cbc_uint8_arguments_t *args_p = (cbc_uint8_arguments_t *) bytecode_p;
|
||||
ecma_value_t *lit_pool_p = (ecma_value_t *) ((uint8_t *) bytecode_p + sizeof (cbc_uint8_arguments_t));
|
||||
return lit_pool_p[args_p->const_literal_end - args_p->register_end - 1];
|
||||
#else /* !ENABLED (JERRY_RESOURCE_NAME) */
|
||||
#else /* !JERRY_RESOURCE_NAME */
|
||||
JERRY_UNUSED (bytecode_p);
|
||||
return ecma_make_magic_string_value (LIT_MAGIC_STRING_RESOURCE_ANON);
|
||||
#endif /* !ENABLED (JERRY_RESOURCE_NAME) */
|
||||
#endif /* !JERRY_RESOURCE_NAME */
|
||||
} /* ecma_get_resource_name */
|
||||
|
||||
#if (JERRY_STACK_LIMIT != 0)
|
||||
|
||||
Reference in New Issue
Block a user