Rework usages/naming of configuration macros [part 2] (#2903)
There are quite a few configuration macros in the project. As discussed in the #2520 issue there are a few awkward constructs. Main changes: * The following macros are now 0/1 switches: ** Renamed CONFIG_ECMA_LCACHE_DISABLE to JERRY_LCACHE. ** Renamed CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE to JERRY_PROPERTY_HASHMAP. ** Renamed CONFIG_DISABLE_UNICODE_CASE_CONVERSION to JERRY_UNICODE_CASE_CONVERSION. ** Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE. ** Renamed JERRY_DISABLE_JS_PARSER to JERRY_PARSER. ** Renamed JERRY_ENABLE_ERROR_MESSAGES to JERRY_ERROR_MESSAGES. ** Renamed JERRY_ENABLE_EXTERNAL_CONTEXT to JERRY_EXTERNAL_CONTEXT. ** Renamed JERRY_ENABLE_LINE_INFO to JERRY_LINE_INFO. ** Renamed JERRY_ENABLE_LOGGING to JERRY_LOGGING. ** Renamed JERRY_ENABLE_SNAPSHOT_EXEC to JERRY_SNAPSHOT_EXEC. ** Renamed JERRY_ENABLE_SNAPSHOT_SAVE to JERRY_SNAPSHOT_SAVE. ** Renamed JERRY_SYSTEM_ALLOCATOR to JERRY_SYSTEM_ALLOCATOR. ** Renamed JERRY_VM_EXEC_STOP to JERRY_VM_EXEC_STOP. ** Renamed JMEM_GC_BEFORE_EACH_ALLOC to JERRY_MEM_GC_BEFORE_EACH_ALLOC. ** Renamed JMEM_STATS to JERRY_MEM_STATS. ** Renamed PARSER_DUMP_BYTE_CODE to JERRY_PARSER_DUMP_BYTE_CODE. ** Renamed REGEXP_DUMP_BYTE_CODE to JERRY_REGEXP_DUMP_BYTE_CODE. * Recursion check changes: ** Renamed REGEXP_RECURSION_LIMIT to JERRY_REGEXP_RECURSION_LIMIT. ** Renamed VM_RECURSION_LIMIT to JERRY_VM_RECURSION_LIMIT. * Attribute macro changes: ** Renamed JERRY_CONST_DATA to JERRY_ATTR_CONST_DATA. ** Renamed JERRY_HEAP_SECTION_ATTR to JERRY_ATTR_GLOBAL_HEAP. Now the macro can specify any attribute for the global heap object. * Other macro changes: ** Renamed CONFIG_MEM_HEAP_AREA_SIZE to JERRY_GLOBAL_HEAP_SIZE. Then new macro now specify the global heap size in kilobytes. * Updated documentations to reflect the new macro names. For more deatils please see jerry-core/config.h. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
@@ -77,9 +77,9 @@ ecma_dealloc_number (ecma_number_t *number_p) /**< number to be freed */
|
||||
inline ecma_object_t * JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_alloc_object (void)
|
||||
{
|
||||
#ifdef JMEM_STATS
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_allocate_object_bytes (sizeof (ecma_object_t));
|
||||
#endif /* JMEM_STATS */
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
|
||||
return (ecma_object_t *) jmem_pools_alloc (sizeof (ecma_object_t));
|
||||
} /* ecma_alloc_object */
|
||||
@@ -90,9 +90,9 @@ ecma_alloc_object (void)
|
||||
inline void JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_dealloc_object (ecma_object_t *object_p) /**< object to be freed */
|
||||
{
|
||||
#ifdef JMEM_STATS
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_free_object_bytes (sizeof (ecma_object_t));
|
||||
#endif /* JMEM_STATS */
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
|
||||
jmem_pools_free (object_p, sizeof (ecma_object_t));
|
||||
} /* ecma_dealloc_object */
|
||||
@@ -105,9 +105,9 @@ ecma_dealloc_object (ecma_object_t *object_p) /**< object to be freed */
|
||||
inline ecma_extended_object_t * JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_alloc_extended_object (size_t size) /**< size of object */
|
||||
{
|
||||
#ifdef JMEM_STATS
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_allocate_object_bytes (size);
|
||||
#endif /* JMEM_STATS */
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
|
||||
return jmem_heap_alloc_block (size);
|
||||
} /* ecma_alloc_extended_object */
|
||||
@@ -119,9 +119,9 @@ inline void JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_dealloc_extended_object (ecma_object_t *object_p, /**< extended object */
|
||||
size_t size) /**< size of object */
|
||||
{
|
||||
#ifdef JMEM_STATS
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_free_object_bytes (size);
|
||||
#endif /* JMEM_STATS */
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
|
||||
jmem_heap_free_block (object_p, size);
|
||||
} /* ecma_dealloc_extended_object */
|
||||
@@ -134,9 +134,9 @@ ecma_dealloc_extended_object (ecma_object_t *object_p, /**< extended object */
|
||||
inline ecma_string_t * JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_alloc_string (void)
|
||||
{
|
||||
#ifdef JMEM_STATS
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_allocate_string_bytes (sizeof (ecma_string_t));
|
||||
#endif /* JMEM_STATS */
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
|
||||
return (ecma_string_t *) jmem_pools_alloc (sizeof (ecma_string_t));
|
||||
} /* ecma_alloc_string */
|
||||
@@ -147,9 +147,9 @@ ecma_alloc_string (void)
|
||||
inline void JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_dealloc_string (ecma_string_t *string_p) /**< string to be freed */
|
||||
{
|
||||
#ifdef JMEM_STATS
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_free_string_bytes (sizeof (ecma_string_t));
|
||||
#endif /* JMEM_STATS */
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
|
||||
jmem_pools_free (string_p, sizeof (ecma_string_t));
|
||||
} /* ecma_dealloc_string */
|
||||
@@ -162,9 +162,9 @@ ecma_dealloc_string (ecma_string_t *string_p) /**< string to be freed */
|
||||
inline ecma_string_t * JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_alloc_string_buffer (size_t size) /**< size of string */
|
||||
{
|
||||
#ifdef JMEM_STATS
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_allocate_string_bytes (size);
|
||||
#endif /* JMEM_STATS */
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
|
||||
return jmem_heap_alloc_block (size);
|
||||
} /* ecma_alloc_string_buffer */
|
||||
@@ -176,9 +176,9 @@ inline void JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_dealloc_string_buffer (ecma_string_t *string_p, /**< string with data */
|
||||
size_t size) /**< size of string */
|
||||
{
|
||||
#ifdef JMEM_STATS
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_free_string_bytes (size);
|
||||
#endif /* JMEM_STATS */
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
|
||||
jmem_heap_free_block (string_p, size);
|
||||
} /* ecma_dealloc_string_buffer */
|
||||
@@ -191,9 +191,9 @@ ecma_dealloc_string_buffer (ecma_string_t *string_p, /**< string with data */
|
||||
inline ecma_property_pair_t * JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_alloc_property_pair (void)
|
||||
{
|
||||
#ifdef JMEM_STATS
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_allocate_property_bytes (sizeof (ecma_property_pair_t));
|
||||
#endif /* JMEM_STATS */
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
|
||||
return jmem_heap_alloc_block (sizeof (ecma_property_pair_t));
|
||||
} /* ecma_alloc_property_pair */
|
||||
@@ -204,9 +204,9 @@ ecma_alloc_property_pair (void)
|
||||
inline void JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_dealloc_property_pair (ecma_property_pair_t *property_pair_p) /**< property pair to be freed */
|
||||
{
|
||||
#ifdef JMEM_STATS
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_free_property_bytes (sizeof (ecma_property_pair_t));
|
||||
#endif /* JMEM_STATS */
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
|
||||
jmem_heap_free_block (property_pair_p, sizeof (ecma_property_pair_t));
|
||||
} /* ecma_dealloc_property_pair */
|
||||
|
||||
@@ -687,7 +687,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
/* Function with byte-code (not a built-in function). */
|
||||
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
|
||||
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
if (ext_func_p->u.function.bytecode_cp != ECMA_NULL_POINTER)
|
||||
{
|
||||
ecma_bytecode_deref (ECMA_GET_INTERNAL_VALUE_POINTER (ecma_compiled_code_t,
|
||||
@@ -698,11 +698,11 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
{
|
||||
ecma_dealloc_extended_object (object_p, sizeof (ecma_static_function_t));
|
||||
}
|
||||
#else /* !JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#else /* !ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
ecma_bytecode_deref (ECMA_GET_INTERNAL_VALUE_POINTER (ecma_compiled_code_t,
|
||||
ext_func_p->u.function.bytecode_cp));
|
||||
ecma_dealloc_extended_object (object_p, sizeof (ecma_extended_object_t));
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -713,7 +713,7 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
|
||||
ecma_free_value_if_not_object (arrow_func_p->this_binding);
|
||||
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
if (arrow_func_p->bytecode_cp != ECMA_NULL_POINTER)
|
||||
{
|
||||
ecma_bytecode_deref (ECMA_GET_NON_NULL_POINTER (ecma_compiled_code_t,
|
||||
@@ -724,11 +724,11 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
|
||||
{
|
||||
ecma_dealloc_extended_object (object_p, sizeof (ecma_static_arrow_function_t));
|
||||
}
|
||||
#else /* !JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#else /* !ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
ecma_bytecode_deref (ECMA_GET_NON_NULL_POINTER (ecma_compiled_code_t,
|
||||
arrow_func_p->bytecode_cp));
|
||||
ecma_dealloc_extended_object (object_p, sizeof (ecma_arrow_function_t));
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
return;
|
||||
}
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
@@ -993,13 +993,13 @@ ecma_free_unused_memory (jmem_free_unused_memory_severity_t severity) /**< sever
|
||||
|
||||
if (severity == JMEM_FREE_UNUSED_MEMORY_SEVERITY_LOW)
|
||||
{
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
if (JERRY_CONTEXT (ecma_prop_hashmap_alloc_state) > ECMA_PROP_HASHMAP_ALLOC_ON)
|
||||
{
|
||||
--JERRY_CONTEXT (ecma_prop_hashmap_alloc_state);
|
||||
}
|
||||
JERRY_CONTEXT (status_flags) &= (uint32_t) ~ECMA_STATUS_HIGH_SEV_GC;
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
|
||||
/*
|
||||
* If there is enough newly allocated objects since last GC, probably it is worthwhile to start GC now.
|
||||
@@ -1016,7 +1016,7 @@ ecma_free_unused_memory (jmem_free_unused_memory_severity_t severity) /**< sever
|
||||
{
|
||||
JERRY_ASSERT (severity == JMEM_FREE_UNUSED_MEMORY_SEVERITY_HIGH);
|
||||
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
if (JERRY_CONTEXT (status_flags) & ECMA_STATUS_HIGH_SEV_GC)
|
||||
{
|
||||
JERRY_CONTEXT (ecma_prop_hashmap_alloc_state) = ECMA_PROP_HASHMAP_ALLOC_MAX;
|
||||
@@ -1026,7 +1026,7 @@ ecma_free_unused_memory (jmem_free_unused_memory_severity_t severity) /**< sever
|
||||
++JERRY_CONTEXT (ecma_prop_hashmap_alloc_state);
|
||||
JERRY_CONTEXT (status_flags) |= ECMA_STATUS_HIGH_SEV_GC;
|
||||
}
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
|
||||
/* Freeing as much memory as we currently can */
|
||||
ecma_gc_run (severity);
|
||||
|
||||
@@ -58,9 +58,9 @@ typedef enum
|
||||
{
|
||||
ECMA_STATUS_API_AVAILABLE = (1u << 0), /**< api available */
|
||||
ECMA_STATUS_DIRECT_EVAL = (1u << 1), /**< eval is called directly */
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
ECMA_STATUS_HIGH_SEV_GC = (1u << 2), /**< last gc run was a high severity run */
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
ECMA_STATUS_EXCEPTION = (1u << 3), /**< last exception is a normal exception */
|
||||
} ecma_status_flag_t;
|
||||
|
||||
@@ -476,16 +476,16 @@ typedef uint8_t ecma_property_t; /**< ecma_property_types_t (3 bit) and ecma_pro
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
jmem_cpointer_t next_property_cp; /**< next cpointer */
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
ecma_property_t types[ECMA_PROPERTY_PAIR_ITEM_COUNT]; /**< two property type slot. The first represent
|
||||
* the type of this property (e.g. property pair) */
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
uint16_t padding; /**< an unused value */
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
jmem_cpointer_t next_property_cp; /**< next cpointer */
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
} ecma_property_header_t;
|
||||
|
||||
/**
|
||||
@@ -503,11 +503,11 @@ typedef struct
|
||||
typedef union
|
||||
{
|
||||
ecma_value_t value; /**< value of a property */
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
jmem_cpointer_t getter_setter_pair_cp; /**< cpointer to getter setter pair */
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
ecma_getter_setter_pointers_t getter_setter_pair; /**< getter setter pair */
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
} ecma_property_value_t;
|
||||
|
||||
/**
|
||||
@@ -877,7 +877,7 @@ typedef struct
|
||||
* If regexp, the other flags must be RE_FLAG... */
|
||||
} ecma_compiled_code_t;
|
||||
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
|
||||
/**
|
||||
* Description of static function objects.
|
||||
@@ -888,7 +888,7 @@ typedef struct
|
||||
const ecma_compiled_code_t *bytecode_p; /**< real byte code pointer */
|
||||
} ecma_static_function_t;
|
||||
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
|
||||
@@ -903,7 +903,7 @@ typedef struct
|
||||
jmem_cpointer_t bytecode_cp; /**< function byte code */
|
||||
} ecma_arrow_function_t;
|
||||
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
|
||||
/**
|
||||
* Description of static arrow function objects.
|
||||
@@ -914,7 +914,7 @@ typedef struct
|
||||
const ecma_compiled_code_t *bytecode_p;
|
||||
} ecma_static_arrow_function_t;
|
||||
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
@@ -1233,11 +1233,11 @@ typedef enum
|
||||
* Maximum value of the immediate part of a direct magic string.
|
||||
* Must be compatible with the immediate property name.
|
||||
*/
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
#define ECMA_DIRECT_STRING_MAX_IMM 0x07ffffff
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
#define ECMA_DIRECT_STRING_MAX_IMM 0x0000ffff
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
|
||||
/**
|
||||
* Shift for direct string value part in ecma_value_t.
|
||||
@@ -1409,7 +1409,7 @@ typedef struct
|
||||
ecma_value_t value; /**< referenced value */
|
||||
} ecma_error_reference_t;
|
||||
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
|
||||
/**
|
||||
* The lowest state of the ecma_prop_hashmap_alloc_state counter.
|
||||
@@ -1423,7 +1423,7 @@ typedef struct
|
||||
*/
|
||||
#define ECMA_PROP_HASHMAP_ALLOC_MAX 4
|
||||
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
|
||||
/**
|
||||
* Number of values in a literal storage item
|
||||
@@ -1439,15 +1439,15 @@ typedef struct
|
||||
jmem_cpointer_t values[ECMA_LIT_STORAGE_VALUE_COUNT]; /**< list of values */
|
||||
} ecma_lit_storage_item_t;
|
||||
|
||||
#ifndef CONFIG_ECMA_LCACHE_DISABLE
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
/**
|
||||
* Container of an LCache entry identifier
|
||||
*/
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
typedef uint64_t ecma_lcache_hash_entry_id_t;
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
typedef uint32_t ecma_lcache_hash_entry_id_t;
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
|
||||
/**
|
||||
* Entry of LCache hash table
|
||||
@@ -1471,7 +1471,7 @@ typedef struct
|
||||
*/
|
||||
#define ECMA_LCACHE_HASH_ROW_LENGTH 2
|
||||
|
||||
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_TYPEDARRAY)
|
||||
|
||||
|
||||
@@ -564,16 +564,16 @@ ecma_create_named_accessor_property (ecma_object_t *object_p, /**< object */
|
||||
uint8_t type_and_flags = ECMA_PROPERTY_TYPE_NAMEDACCESSOR | prop_attributes;
|
||||
|
||||
ecma_property_value_t value;
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (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_p, get_p);
|
||||
ECMA_SET_POINTER (getter_setter_pair_p->setter_p, set_p);
|
||||
ECMA_SET_POINTER (value.getter_setter_pair_cp, getter_setter_pair_p);
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
ECMA_SET_POINTER (value.getter_setter_pair.getter_p, get_p);
|
||||
ECMA_SET_POINTER (value.getter_setter_pair.setter_p, set_p);
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
|
||||
return ecma_create_property (object_p, name_p, type_and_flags, value, out_prop_p);
|
||||
} /* ecma_create_named_accessor_property */
|
||||
@@ -593,17 +593,17 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
|
||||
|
||||
ecma_property_t *property_p = NULL;
|
||||
|
||||
#ifndef CONFIG_ECMA_LCACHE_DISABLE
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
property_p = ecma_lcache_lookup (obj_p, name_p);
|
||||
if (property_p != NULL)
|
||||
{
|
||||
return property_p;
|
||||
}
|
||||
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
|
||||
ecma_property_header_t *prop_iter_p = ecma_get_property_list (obj_p);
|
||||
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
if (prop_iter_p != NULL && prop_iter_p->types[0] == ECMA_PROPERTY_TYPE_HASHMAP)
|
||||
{
|
||||
jmem_cpointer_t property_real_name_cp;
|
||||
@@ -611,17 +611,17 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
|
||||
name_p,
|
||||
&property_real_name_cp);
|
||||
|
||||
#ifndef CONFIG_ECMA_LCACHE_DISABLE
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
if (property_p != NULL
|
||||
&& !ecma_is_property_lcached (property_p))
|
||||
{
|
||||
ecma_lcache_insert (obj_p, property_real_name_cp, property_p);
|
||||
}
|
||||
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
|
||||
return property_p;
|
||||
}
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
|
||||
JERRY_ASSERT (ECMA_PROPERTY_PAIR_ITEM_COUNT == 2);
|
||||
|
||||
@@ -709,13 +709,13 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
|
||||
ecma_property_hashmap_create (obj_p);
|
||||
}
|
||||
|
||||
#ifndef CONFIG_ECMA_LCACHE_DISABLE
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
if (property_p != NULL
|
||||
&& !ecma_is_property_lcached (property_p))
|
||||
{
|
||||
ecma_lcache_insert (obj_p, property_name_cp, property_p);
|
||||
}
|
||||
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
|
||||
return property_p;
|
||||
} /* ecma_find_named_property */
|
||||
@@ -763,12 +763,12 @@ ecma_free_property (ecma_object_t *object_p, /**< object the property belongs to
|
||||
}
|
||||
case ECMA_PROPERTY_TYPE_NAMEDACCESSOR:
|
||||
{
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
ecma_getter_setter_pointers_t *getter_setter_pair_p;
|
||||
getter_setter_pair_p = ECMA_GET_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 /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -782,12 +782,12 @@ ecma_free_property (ecma_object_t *object_p, /**< object the property belongs to
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef CONFIG_ECMA_LCACHE_DISABLE
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
if (ecma_is_property_lcached (property_p))
|
||||
{
|
||||
ecma_lcache_invalidate (object_p, name_cp, property_p);
|
||||
}
|
||||
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
|
||||
if (ECMA_PROPERTY_GET_NAME_TYPE (*property_p) == ECMA_DIRECT_STRING_PTR)
|
||||
{
|
||||
@@ -1089,14 +1089,14 @@ ecma_named_data_property_assign_value (ecma_object_t *obj_p, /**< object */
|
||||
ecma_object_t *
|
||||
ecma_get_named_accessor_property_getter (const ecma_property_value_t *prop_value_p) /**< property value reference */
|
||||
{
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
ecma_getter_setter_pointers_t *getter_setter_pair_p;
|
||||
getter_setter_pair_p = ECMA_GET_POINTER (ecma_getter_setter_pointers_t,
|
||||
prop_value_p->getter_setter_pair_cp);
|
||||
return ECMA_GET_POINTER (ecma_object_t, getter_setter_pair_p->getter_p);
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
return ECMA_GET_POINTER (ecma_object_t, prop_value_p->getter_setter_pair.getter_p);
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
} /* ecma_get_named_accessor_property_getter */
|
||||
|
||||
/**
|
||||
@@ -1107,14 +1107,14 @@ ecma_get_named_accessor_property_getter (const ecma_property_value_t *prop_value
|
||||
ecma_object_t *
|
||||
ecma_get_named_accessor_property_setter (const ecma_property_value_t *prop_value_p) /**< property value reference */
|
||||
{
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
ecma_getter_setter_pointers_t *getter_setter_pair_p;
|
||||
getter_setter_pair_p = ECMA_GET_POINTER (ecma_getter_setter_pointers_t,
|
||||
prop_value_p->getter_setter_pair_cp);
|
||||
return ECMA_GET_POINTER (ecma_object_t, getter_setter_pair_p->setter_p);
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
return ECMA_GET_POINTER (ecma_object_t, prop_value_p->getter_setter_pair.setter_p);
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
} /* ecma_get_named_accessor_property_setter */
|
||||
|
||||
/**
|
||||
@@ -1127,14 +1127,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, ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
|
||||
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
ecma_getter_setter_pointers_t *getter_setter_pair_p;
|
||||
getter_setter_pair_p = ECMA_GET_POINTER (ecma_getter_setter_pointers_t,
|
||||
prop_value_p->getter_setter_pair_cp);
|
||||
ECMA_SET_POINTER (getter_setter_pair_p->getter_p, getter_p);
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
ECMA_SET_POINTER (prop_value_p->getter_setter_pair.getter_p, getter_p);
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
} /* ecma_set_named_accessor_property_getter */
|
||||
|
||||
/**
|
||||
@@ -1147,14 +1147,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, ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
|
||||
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
ecma_getter_setter_pointers_t *getter_setter_pair_p;
|
||||
getter_setter_pair_p = ECMA_GET_POINTER (ecma_getter_setter_pointers_t,
|
||||
prop_value_p->getter_setter_pair_cp);
|
||||
ECMA_SET_POINTER (getter_setter_pair_p->setter_p, setter_p);
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
ECMA_SET_POINTER (prop_value_p->getter_setter_pair.setter_p, setter_p);
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
} /* ecma_set_named_accessor_property_setter */
|
||||
|
||||
/**
|
||||
@@ -1263,7 +1263,7 @@ ecma_set_property_configurable_attr (ecma_property_t *property_p, /**< [in,out]
|
||||
}
|
||||
} /* ecma_set_property_configurable_attr */
|
||||
|
||||
#ifndef CONFIG_ECMA_LCACHE_DISABLE
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
|
||||
/**
|
||||
* Check whether the property is registered in LCache
|
||||
@@ -1301,7 +1301,7 @@ ecma_set_property_lcached (ecma_property_t *property_p, /**< property */
|
||||
}
|
||||
} /* ecma_set_property_lcached */
|
||||
|
||||
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
|
||||
/**
|
||||
* Construct empty property descriptor, i.e.:
|
||||
@@ -1582,9 +1582,9 @@ ecma_bytecode_deref (ecma_compiled_code_t *bytecode_p) /**< byte code pointer */
|
||||
}
|
||||
#endif /* JERRY_DEBUGGER */
|
||||
|
||||
#ifdef JMEM_STATS
|
||||
#if ENABLED (JERRY_MEM_STATS)
|
||||
jmem_stats_free_byte_code_bytes (((size_t) bytecode_p->size) << JMEM_ALIGNMENT_LOG);
|
||||
#endif /* JMEM_STATS */
|
||||
#endif /* ENABLED (JERRY_MEM_STATS) */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -376,10 +376,10 @@ void ecma_set_property_enumerable_attr (ecma_property_t *property_p, bool is_enu
|
||||
bool ecma_is_property_configurable (ecma_property_t property);
|
||||
void ecma_set_property_configurable_attr (ecma_property_t *property_p, bool is_configurable);
|
||||
|
||||
#ifndef CONFIG_ECMA_LCACHE_DISABLE
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
bool ecma_is_property_lcached (ecma_property_t *property_p);
|
||||
void ecma_set_property_lcached (ecma_property_t *property_p, bool is_lcached);
|
||||
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
|
||||
ecma_property_descriptor_t ecma_make_empty_property_descriptor (void);
|
||||
void ecma_free_property_descriptor (ecma_property_descriptor_t *prop_desc_p);
|
||||
|
||||
@@ -39,14 +39,14 @@ ecma_init (void)
|
||||
|
||||
jmem_register_free_unused_memory_callback (ecma_free_unused_memory);
|
||||
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
JERRY_CONTEXT (ecma_prop_hashmap_alloc_state) = ECMA_PROP_HASHMAP_ALLOC_ON;
|
||||
JERRY_CONTEXT (status_flags) &= (uint32_t) ~ECMA_STATUS_HIGH_SEV_GC;
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
|
||||
#ifdef VM_RECURSION_LIMIT
|
||||
JERRY_CONTEXT (vm_recursion_counter) = VM_RECURSION_LIMIT;
|
||||
#endif /* VM_RECURSION_LIMIT */
|
||||
#if defined (JERRY_VM_RECURSION_LIMIT) && (JERRY_VM_RECURSION_LIMIT != 0)
|
||||
JERRY_CONTEXT (vm_recursion_counter) = JERRY_VM_RECURSION_LIMIT;
|
||||
#endif /* defined (JERRY_VM_RECURSION_LIMIT) && (JERRY_VM_RECURSION_LIMIT != 0) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_BUILTIN_PROMISE)
|
||||
ecma_job_queue_init ();
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_ECMA_LCACHE_DISABLE
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
|
||||
/**
|
||||
* Mask for hash bits
|
||||
@@ -208,7 +208,7 @@ ecma_lcache_invalidate (ecma_object_t *object_p, /**< object */
|
||||
}
|
||||
} /* ecma_lcache_invalidate */
|
||||
|
||||
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_ECMA_LCACHE_DISABLE
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
|
||||
void ecma_lcache_insert (ecma_object_t *object_p, jmem_cpointer_t name_cp, ecma_property_t *prop_p);
|
||||
ecma_property_t *ecma_lcache_lookup (ecma_object_t *object_p, const ecma_string_t *prop_name_p);
|
||||
void ecma_lcache_invalidate (ecma_object_t *object_p, jmem_cpointer_t name_cp, ecma_property_t *prop_p);
|
||||
|
||||
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -233,7 +233,7 @@ ecma_find_or_create_literal_number (ecma_number_t number_arg) /**< number to be
|
||||
*/
|
||||
#define JERRY_SNAPSHOT_LITERAL_IS_NUMBER (1u << ECMA_VALUE_SHIFT)
|
||||
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
|
||||
#if ENABLED (JERRY_SNAPSHOT_SAVE)
|
||||
|
||||
/**
|
||||
* Append the value at the end of the appropriate list if it is not present there.
|
||||
@@ -463,9 +463,9 @@ ecma_save_literals_for_snapshot (ecma_collection_header_t *lit_pool_p, /**< list
|
||||
return true;
|
||||
} /* ecma_save_literals_for_snapshot */
|
||||
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_SAVE) */
|
||||
|
||||
#if defined JERRY_ENABLE_SNAPSHOT_EXEC || defined JERRY_ENABLE_SNAPSHOT_SAVE
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC) || ENABLED (JERRY_SNAPSHOT_SAVE)
|
||||
|
||||
/**
|
||||
* Get the compressed pointer of a given literal.
|
||||
@@ -492,7 +492,7 @@ ecma_snapshot_get_literal (const uint8_t *literal_base_p, /**< literal start */
|
||||
return ecma_find_or_create_literal_string (literal_p + sizeof (uint16_t), length);
|
||||
} /* ecma_snapshot_get_literal */
|
||||
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC || JERRY_ENABLE_SNAPSHOT_SAVE */
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) || ENABLED (JERRY_SNAPSHOT_SAVE) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
|
||||
#if ENABLED (JERRY_SNAPSHOT_SAVE)
|
||||
/**
|
||||
* Snapshot literal - offset map
|
||||
*/
|
||||
@@ -36,26 +36,26 @@ typedef struct
|
||||
ecma_value_t literal_id; /**< literal id */
|
||||
ecma_value_t literal_offset; /**< literal offset */
|
||||
} lit_mem_to_snapshot_id_map_entry_t;
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_SAVE) */
|
||||
|
||||
void ecma_finalize_lit_storage (void);
|
||||
|
||||
ecma_value_t ecma_find_or_create_literal_string (const lit_utf8_byte_t *chars_p, lit_utf8_size_t size);
|
||||
ecma_value_t ecma_find_or_create_literal_number (ecma_number_t number_arg);
|
||||
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_SAVE
|
||||
#if ENABLED (JERRY_SNAPSHOT_SAVE)
|
||||
void ecma_save_literals_append_value (ecma_value_t value, ecma_collection_header_t *lit_pool_p);
|
||||
void ecma_save_literals_add_compiled_code (const ecma_compiled_code_t *compiled_code_p,
|
||||
ecma_collection_header_t *lit_pool_p);
|
||||
bool ecma_save_literals_for_snapshot (ecma_collection_header_t *lit_pool_p, uint32_t *buffer_p, size_t buffer_size,
|
||||
size_t *in_out_buffer_offset_p, lit_mem_to_snapshot_id_map_entry_t **out_map_p,
|
||||
uint32_t *out_map_len_p);
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_SAVE */
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_SAVE) */
|
||||
|
||||
#if defined JERRY_ENABLE_SNAPSHOT_EXEC || defined JERRY_ENABLE_SNAPSHOT_SAVE
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC) || ENABLED (JERRY_SNAPSHOT_SAVE)
|
||||
ecma_value_t
|
||||
ecma_snapshot_get_literal (const uint8_t *literal_base_p, ecma_value_t literal_value);
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC || JERRY_ENABLE_SNAPSHOT_SAVE */
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) || ENABLED (JERRY_SNAPSHOT_SAVE) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
|
||||
/**
|
||||
* Compute the total size of the property hashmap.
|
||||
@@ -42,7 +42,7 @@
|
||||
/**
|
||||
* Stepping values for searching items in the hashmap.
|
||||
*/
|
||||
static const uint8_t ecma_property_hashmap_steps[ECMA_PROPERTY_HASHMAP_NUMBER_OF_STEPS] JERRY_CONST_DATA =
|
||||
static const uint8_t ecma_property_hashmap_steps[ECMA_PROPERTY_HASHMAP_NUMBER_OF_STEPS] JERRY_ATTR_CONST_DATA =
|
||||
{
|
||||
3, 5, 7, 11, 13, 17, 19, 23
|
||||
};
|
||||
@@ -65,7 +65,7 @@ static const uint8_t ecma_property_hashmap_steps[ECMA_PROPERTY_HASHMAP_NUMBER_OF
|
||||
#define ECMA_PROPERTY_HASHMAP_SET_BIT(byte_p, index) \
|
||||
((byte_p)[(index) >> 3] = (uint8_t) ((byte_p)[(index) >> 3] | (1 << ((index) & 0x7))))
|
||||
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
|
||||
/**
|
||||
* Create a new property hashmap for the object.
|
||||
@@ -74,7 +74,7 @@ static const uint8_t ecma_property_hashmap_steps[ECMA_PROPERTY_HASHMAP_NUMBER_OF
|
||||
void
|
||||
ecma_property_hashmap_create (ecma_object_t *object_p) /**< object */
|
||||
{
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
if (JERRY_CONTEXT (ecma_prop_hashmap_alloc_state) != ECMA_PROP_HASHMAP_ALLOC_ON)
|
||||
{
|
||||
return;
|
||||
@@ -214,9 +214,9 @@ ecma_property_hashmap_create (ecma_object_t *object_p) /**< object */
|
||||
prop_iter_p = ECMA_GET_POINTER (ecma_property_header_t,
|
||||
prop_iter_p->next_property_cp);
|
||||
}
|
||||
#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#else /* !ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
JERRY_UNUSED (object_p);
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
} /* ecma_property_hashmap_create */
|
||||
|
||||
/**
|
||||
@@ -226,7 +226,7 @@ ecma_property_hashmap_create (ecma_object_t *object_p) /**< object */
|
||||
void
|
||||
ecma_property_hashmap_free (ecma_object_t *object_p) /**< object */
|
||||
{
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
/* Property hash must be exists and must be the first property. */
|
||||
ecma_property_header_t *property_p = ecma_get_property_list (object_p);
|
||||
|
||||
@@ -238,9 +238,9 @@ ecma_property_hashmap_free (ecma_object_t *object_p) /**< object */
|
||||
|
||||
jmem_heap_free_block (hashmap_p,
|
||||
ECMA_PROPERTY_HASHMAP_GET_TOTAL_SIZE (hashmap_p->max_property_count));
|
||||
#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#else /* !ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
JERRY_UNUSED (object_p);
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
} /* ecma_property_hashmap_free */
|
||||
|
||||
/**
|
||||
@@ -252,7 +252,7 @@ ecma_property_hashmap_insert (ecma_object_t *object_p, /**< object */
|
||||
ecma_property_pair_t *property_pair_p, /**< property pair */
|
||||
int property_index) /**< property index in the pair (0 or 1) */
|
||||
{
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
ecma_property_hashmap_t *hashmap_p = ECMA_GET_NON_NULL_POINTER (ecma_property_hashmap_t,
|
||||
object_p->property_list_or_bound_object_cp);
|
||||
|
||||
@@ -322,12 +322,12 @@ ecma_property_hashmap_insert (ecma_object_t *object_p, /**< object */
|
||||
{
|
||||
*bits_p = (uint8_t) ((*bits_p) | mask);
|
||||
}
|
||||
#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#else /* !ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
JERRY_UNUSED (object_p);
|
||||
JERRY_UNUSED (name_p);
|
||||
JERRY_UNUSED (property_pair_p);
|
||||
JERRY_UNUSED (property_index);
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
} /* ecma_property_hashmap_insert */
|
||||
|
||||
/**
|
||||
@@ -341,7 +341,7 @@ ecma_property_hashmap_delete (ecma_object_t *object_p, /**< object */
|
||||
jmem_cpointer_t name_cp, /**< property name */
|
||||
ecma_property_t *property_p) /**< property */
|
||||
{
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
ecma_property_hashmap_t *hashmap_p = ECMA_GET_NON_NULL_POINTER (ecma_property_hashmap_t,
|
||||
object_p->property_list_or_bound_object_cp);
|
||||
|
||||
@@ -411,16 +411,16 @@ ecma_property_hashmap_delete (ecma_object_t *object_p, /**< object */
|
||||
JERRY_ASSERT (entry_index != start_entry_index);
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
}
|
||||
#else /* CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#else /* !ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
JERRY_UNUSED (object_p);
|
||||
JERRY_UNUSED (name_cp);
|
||||
JERRY_UNUSED (property_p);
|
||||
|
||||
return ECMA_PROPERTY_HASHMAP_DELETE_HAS_HASHMAP;
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
} /* ecma_property_hashmap_delete */
|
||||
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
/**
|
||||
* Find a named property.
|
||||
*
|
||||
@@ -594,7 +594,7 @@ ecma_property_hashmap_find (ecma_property_hashmap_t *hashmap_p, /**< hashmap */
|
||||
#endif /* !JERRY_NDEBUG */
|
||||
}
|
||||
} /* ecma_property_hashmap_find */
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -70,10 +70,10 @@ void ecma_property_hashmap_insert (ecma_object_t *object_p, ecma_string_t *name_
|
||||
ecma_property_hashmap_delete_status ecma_property_hashmap_delete (ecma_object_t *object_p, jmem_cpointer_t name_cp,
|
||||
ecma_property_t *property_p);
|
||||
|
||||
#ifndef CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE
|
||||
#if ENABLED (JERRY_PROPRETY_HASHMAP)
|
||||
ecma_property_t *ecma_property_hashmap_find (ecma_property_hashmap_t *hashmap_p, ecma_string_t *name_p,
|
||||
jmem_cpointer_t *property_real_name_cp);
|
||||
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
|
||||
#endif /* ENABLED (JERRY_PROPRETY_HASHMAP) */
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
#include "js-parser.h"
|
||||
#include "lit-magic-strings.h"
|
||||
|
||||
#ifdef JERRY_ENABLE_LINE_INFO
|
||||
#if ENABLED (JERRY_LINE_INFO)
|
||||
#include "jcontext.h"
|
||||
#endif /* JERRY_ENABLE_LINE_INFO */
|
||||
#endif /* ENABLED (JERRY_LINE_INFO) */
|
||||
|
||||
#define ECMA_BUILTINS_INTERNAL
|
||||
#include "ecma-builtins-internal.h"
|
||||
@@ -159,9 +159,9 @@ ecma_builtin_function_dispatch_construct (const ecma_value_t *arguments_list_p,
|
||||
ECMA_STRING_TO_UTF8_STRING (arguments_str_p, arguments_buffer_p, arguments_buffer_size);
|
||||
ECMA_STRING_TO_UTF8_STRING (function_body_str_p, function_body_buffer_p, function_body_buffer_size);
|
||||
|
||||
#ifdef JERRY_ENABLE_LINE_INFO
|
||||
#if ENABLED (JERRY_LINE_INFO)
|
||||
JERRY_CONTEXT (resource_name) = ecma_make_magic_string_value (LIT_MAGIC_STRING__EMPTY);
|
||||
#endif /* JERRY_ENABLE_LINE_INFO */
|
||||
#endif /* ENABLED (JERRY_LINE_INFO) */
|
||||
|
||||
ecma_compiled_code_t *bytecode_data_p = NULL;
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ ecma_op_eval_chars_buffer (const lit_utf8_byte_t *code_p, /**< code characters b
|
||||
size_t code_buffer_size, /**< size of the buffer */
|
||||
uint32_t parse_opts) /**< ecma_parse_opts_t option bits */
|
||||
{
|
||||
#ifndef JERRY_DISABLE_JS_PARSER
|
||||
#if ENABLED (JERRY_PARSER)
|
||||
JERRY_ASSERT (code_p != NULL);
|
||||
|
||||
ecma_compiled_code_t *bytecode_data_p;
|
||||
@@ -91,9 +91,9 @@ ecma_op_eval_chars_buffer (const lit_utf8_byte_t *code_p, /**< code characters b
|
||||
parse_opts &= (uint32_t) ~ECMA_PARSE_STRICT_MODE;
|
||||
}
|
||||
|
||||
#ifdef JERRY_ENABLE_LINE_INFO
|
||||
#if ENABLED (JERRY_LINE_INFO)
|
||||
JERRY_CONTEXT (resource_name) = ecma_make_magic_string_value (LIT_MAGIC_STRING__EMPTY);
|
||||
#endif /* JERRY_ENABLE_LINE_INFO */
|
||||
#endif /* ENABLED (JERRY_LINE_INFO) */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_CLASS)
|
||||
ECMA_CLEAR_SUPER_EVAL_PARSER_OPTS ();
|
||||
@@ -112,13 +112,13 @@ ecma_op_eval_chars_buffer (const lit_utf8_byte_t *code_p, /**< code characters b
|
||||
}
|
||||
|
||||
return vm_run_eval (bytecode_data_p, parse_opts);
|
||||
#else /* JERRY_DISABLE_JS_PARSER */
|
||||
#else /* !ENABLED (JERRY_PARSER) */
|
||||
JERRY_UNUSED (code_p);
|
||||
JERRY_UNUSED (code_buffer_size);
|
||||
JERRY_UNUSED (parse_opts);
|
||||
|
||||
return ecma_raise_syntax_error (ECMA_ERR_MSG ("The parser has been disabled."));
|
||||
#endif /* !JERRY_DISABLE_JS_PARSER */
|
||||
#endif /* ENABLED (JERRY_PARSER) */
|
||||
} /* ecma_op_eval_chars_buffer */
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
#include "jcontext.h"
|
||||
#include "jrt.h"
|
||||
|
||||
#ifdef JERRY_ENABLE_LINE_INFO
|
||||
#if ENABLED (JERRY_LINE_INFO)
|
||||
#include "vm.h"
|
||||
#endif /* JERRY_ENABLE_LINE_INFO */
|
||||
#endif /* ENABLED (JERRY_LINE_INFO) */
|
||||
|
||||
/** \addtogroup ecma ECMA
|
||||
* @{
|
||||
@@ -140,7 +140,7 @@ ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error typ
|
||||
|
||||
((ecma_extended_object_t *) new_error_obj_p)->u.class_prop.class_id = LIT_MAGIC_STRING_ERROR_UL;
|
||||
|
||||
#ifdef JERRY_ENABLE_LINE_INFO
|
||||
#if ENABLED (JERRY_LINE_INFO)
|
||||
/* The "stack" identifier is not a magic string. */
|
||||
const char * const stack_id_p = "stack";
|
||||
|
||||
@@ -156,7 +156,7 @@ ecma_new_standard_error (ecma_standard_error_t error_type) /**< native error typ
|
||||
|
||||
prop_value_p->value = backtrace_value;
|
||||
ecma_deref_object (ecma_get_object_from_value (backtrace_value));
|
||||
#endif /* JERRY_ENABLE_LINE_INFO */
|
||||
#endif /* ENABLED (JERRY_LINE_INFO) */
|
||||
|
||||
return new_error_obj_p;
|
||||
} /* ecma_new_standard_error */
|
||||
@@ -240,7 +240,7 @@ ecma_raise_standard_error (ecma_standard_error_t error_type, /**< error type */
|
||||
return ECMA_VALUE_ERROR;
|
||||
} /* ecma_raise_standard_error */
|
||||
|
||||
#ifdef JERRY_ENABLE_ERROR_MESSAGES
|
||||
#if ENABLED (JERRY_ERROR_MESSAGES)
|
||||
|
||||
/**
|
||||
* Raise a standard ecma-error with the given format string and arguments.
|
||||
@@ -335,7 +335,7 @@ ecma_raise_standard_error_with_format (ecma_standard_error_t error_type, /**< er
|
||||
return ECMA_VALUE_ERROR;
|
||||
} /* ecma_raise_standard_error_with_format */
|
||||
|
||||
#endif /* JERRY_ENABLE_ERROR_MESSAGES */
|
||||
#endif /* ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
|
||||
/**
|
||||
* Raise a common error with the given message.
|
||||
|
||||
@@ -26,11 +26,11 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef JERRY_ENABLE_ERROR_MESSAGES
|
||||
#if ENABLED (JERRY_ERROR_MESSAGES)
|
||||
#define ECMA_ERR_MSG(msg) msg
|
||||
#else /* !JERRY_ENABLE_ERROR_MESSAGES */
|
||||
#else /* !ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
#define ECMA_ERR_MSG(msg) NULL
|
||||
#endif /* JERRY_ENABLE_ERROR_MESSAGES */
|
||||
#endif /* ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
|
||||
/**
|
||||
* Native errors.
|
||||
@@ -53,9 +53,9 @@ typedef enum
|
||||
ecma_standard_error_t ecma_get_error_type (ecma_object_t *error_object);
|
||||
ecma_object_t *ecma_new_standard_error (ecma_standard_error_t error_type);
|
||||
ecma_object_t *ecma_new_standard_error_with_message (ecma_standard_error_t error_type, ecma_string_t *message_string_p);
|
||||
#ifdef JERRY_ENABLE_ERROR_MESSAGES
|
||||
#if ENABLED (JERRY_ERROR_MESSAGES)
|
||||
ecma_value_t ecma_raise_standard_error_with_format (ecma_standard_error_t error_type, const char *msg_p, ...);
|
||||
#endif /* JERRY_ENABLE_ERROR_MESSAGES */
|
||||
#endif /* ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
ecma_value_t ecma_raise_common_error (const char *msg_p);
|
||||
ecma_value_t ecma_raise_range_error (const char *msg_p);
|
||||
ecma_value_t ecma_raise_reference_error (const char *msg_p);
|
||||
|
||||
@@ -128,12 +128,12 @@ ecma_op_create_function_object (ecma_object_t *scope_p, /**< function's scope */
|
||||
|
||||
size_t function_object_size = sizeof (ecma_extended_object_t);
|
||||
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STATIC_FUNCTION)
|
||||
{
|
||||
function_object_size = sizeof (ecma_static_function_t);
|
||||
}
|
||||
#endif
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
|
||||
ecma_object_t *func_p = ecma_create_object (prototype_obj_p,
|
||||
function_object_size,
|
||||
@@ -160,7 +160,7 @@ ecma_op_create_function_object (ecma_object_t *scope_p, /**< function's scope */
|
||||
|
||||
/* 10., 11., 12. */
|
||||
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
if (!(bytecode_data_p->status_flags & CBC_CODE_FLAGS_STATIC_FUNCTION))
|
||||
{
|
||||
ECMA_SET_INTERNAL_VALUE_POINTER (ext_func_p->u.function.bytecode_cp, bytecode_data_p);
|
||||
@@ -171,10 +171,10 @@ ecma_op_create_function_object (ecma_object_t *scope_p, /**< function's scope */
|
||||
ext_func_p->u.function.bytecode_cp = ECMA_NULL_POINTER;
|
||||
((ecma_static_function_t *) func_p)->bytecode_p = bytecode_data_p;
|
||||
}
|
||||
#else /* !JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#else /* !ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
ECMA_SET_INTERNAL_VALUE_POINTER (ext_func_p->u.function.bytecode_cp, bytecode_data_p);
|
||||
ecma_bytecode_ref ((ecma_compiled_code_t *) bytecode_data_p);
|
||||
#endif
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
|
||||
/* 14., 15., 16., 17., 18. */
|
||||
/*
|
||||
@@ -204,12 +204,12 @@ ecma_op_create_arrow_function_object (ecma_object_t *scope_p, /**< function's sc
|
||||
|
||||
size_t arrow_function_object_size = sizeof (ecma_arrow_function_t);
|
||||
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
if (bytecode_data_p->status_flags & CBC_CODE_FLAGS_STATIC_FUNCTION)
|
||||
{
|
||||
arrow_function_object_size = sizeof (ecma_static_arrow_function_t);
|
||||
}
|
||||
#endif
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
|
||||
ecma_object_t *func_p = ecma_create_object (prototype_obj_p,
|
||||
arrow_function_object_size,
|
||||
@@ -219,7 +219,7 @@ ecma_op_create_arrow_function_object (ecma_object_t *scope_p, /**< function's sc
|
||||
|
||||
ECMA_SET_NON_NULL_POINTER (arrow_func_p->scope_cp, scope_p);
|
||||
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
if (!(bytecode_data_p->status_flags & CBC_CODE_FLAGS_STATIC_FUNCTION))
|
||||
{
|
||||
ECMA_SET_NON_NULL_POINTER (arrow_func_p->bytecode_cp, bytecode_data_p);
|
||||
@@ -230,10 +230,10 @@ ecma_op_create_arrow_function_object (ecma_object_t *scope_p, /**< function's sc
|
||||
arrow_func_p->bytecode_cp = ECMA_NULL_POINTER;
|
||||
((ecma_static_arrow_function_t *) func_p)->bytecode_p = bytecode_data_p;
|
||||
}
|
||||
#else /* !JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#else /* !ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
ECMA_SET_NON_NULL_POINTER (arrow_func_p->bytecode_cp, bytecode_data_p);
|
||||
ecma_bytecode_ref ((ecma_compiled_code_t *) bytecode_data_p);
|
||||
#endif
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
|
||||
arrow_func_p->this_binding = ecma_copy_value_if_not_object (this_binding);
|
||||
return func_p;
|
||||
@@ -280,7 +280,7 @@ ecma_op_create_external_function_object (ecma_external_handler_t handler_cb) /**
|
||||
inline const ecma_compiled_code_t * JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_op_function_get_compiled_code (ecma_extended_object_t *function_p) /**< function pointer */
|
||||
{
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
if (function_p->u.function.bytecode_cp != ECMA_NULL_POINTER)
|
||||
{
|
||||
return ECMA_GET_INTERNAL_VALUE_POINTER (const ecma_compiled_code_t,
|
||||
@@ -290,10 +290,10 @@ ecma_op_function_get_compiled_code (ecma_extended_object_t *function_p) /**< fun
|
||||
{
|
||||
return ((ecma_static_function_t *) function_p)->bytecode_p;
|
||||
}
|
||||
#else /* !JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#else /* !ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
return ECMA_GET_INTERNAL_VALUE_POINTER (const ecma_compiled_code_t,
|
||||
function_p->u.function.bytecode_cp);
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
} /* ecma_op_function_get_compiled_code */
|
||||
|
||||
#if ENABLED (JERRY_ES2015_ARROW_FUNCTION)
|
||||
@@ -306,7 +306,7 @@ ecma_op_function_get_compiled_code (ecma_extended_object_t *function_p) /**< fun
|
||||
inline const ecma_compiled_code_t * JERRY_ATTR_ALWAYS_INLINE
|
||||
ecma_op_arrow_function_get_compiled_code (ecma_arrow_function_t *arrow_function_p) /**< arrow function pointer */
|
||||
{
|
||||
#ifdef JERRY_ENABLE_SNAPSHOT_EXEC
|
||||
#if ENABLED (JERRY_SNAPSHOT_EXEC)
|
||||
if (arrow_function_p->bytecode_cp != ECMA_NULL_POINTER)
|
||||
{
|
||||
return ECMA_GET_NON_NULL_POINTER (const ecma_compiled_code_t,
|
||||
@@ -316,10 +316,10 @@ ecma_op_arrow_function_get_compiled_code (ecma_arrow_function_t *arrow_function_
|
||||
{
|
||||
return ((ecma_static_arrow_function_t *) arrow_function_p)->bytecode_p;
|
||||
}
|
||||
#else /* !JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#else /* !ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
return ECMA_GET_NON_NULL_POINTER (const ecma_compiled_code_t,
|
||||
arrow_function_p->bytecode_cp);
|
||||
#endif /* JERRY_ENABLE_SNAPSHOT_EXEC */
|
||||
#endif /* ENABLED (JERRY_SNAPSHOT_EXEC) */
|
||||
} /* ecma_op_arrow_function_get_compiled_code */
|
||||
|
||||
#endif /* ENABLED (JERRY_ES2015_ARROW_FUNCTION) */
|
||||
|
||||
@@ -93,13 +93,13 @@ ecma_op_get_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
|
||||
}
|
||||
|
||||
*ref_base_lex_env_p = NULL;
|
||||
#ifdef JERRY_ENABLE_ERROR_MESSAGES
|
||||
#if ENABLED (JERRY_ERROR_MESSAGES)
|
||||
return ecma_raise_standard_error_with_format (ECMA_ERROR_REFERENCE,
|
||||
"% is not defined",
|
||||
ecma_make_string_value (name_p));
|
||||
#else /* !JERRY_ENABLE_ERROR_MESSAGES */
|
||||
#else /* ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
return ecma_raise_reference_error (NULL);
|
||||
#endif /* JERRY_ENABLE_ERROR_MESSAGES */
|
||||
#endif /* ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
|
||||
} /* ecma_op_get_value_lex_env_base */
|
||||
|
||||
@@ -250,13 +250,13 @@ ecma_op_put_value_lex_env_base (ecma_object_t *lex_env_p, /**< lexical environme
|
||||
|
||||
if (is_strict)
|
||||
{
|
||||
#ifdef JERRY_ENABLE_ERROR_MESSAGES
|
||||
#if ENABLED (JERRY_ERROR_MESSAGES)
|
||||
return ecma_raise_standard_error_with_format (ECMA_ERROR_REFERENCE,
|
||||
"% is not defined",
|
||||
ecma_make_string_value (name_p));
|
||||
#else /* !JERRY_ENABLE_ERROR_MESSAGES */
|
||||
#else /* !ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
return ecma_raise_reference_error (NULL);
|
||||
#endif /* JERRY_ENABLE_ERROR_MESSAGES */
|
||||
#endif /* ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
}
|
||||
|
||||
ecma_value_t completion = ecma_op_object_put (ecma_builtin_get_global (),
|
||||
|
||||
@@ -475,26 +475,26 @@ ecma_op_general_object_define_own_property (ecma_object_t *object_p, /**< the ob
|
||||
JERRY_ASSERT (current_property_type == ECMA_PROPERTY_TYPE_NAMEDDATA);
|
||||
ecma_free_value_if_not_object (value_p->value);
|
||||
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (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));
|
||||
getter_setter_pair_p->getter_p = JMEM_CP_NULL;
|
||||
getter_setter_pair_p->setter_p = JMEM_CP_NULL;
|
||||
ECMA_SET_POINTER (value_p->getter_setter_pair_cp, getter_setter_pair_p);
|
||||
#else /* !JERRY_CPOINTER_32_BIT */
|
||||
#else /* !ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
value_p->getter_setter_pair.getter_p = JMEM_CP_NULL;
|
||||
value_p->getter_setter_pair.setter_p = JMEM_CP_NULL;
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
}
|
||||
else
|
||||
{
|
||||
JERRY_ASSERT (current_property_type == ECMA_PROPERTY_TYPE_NAMEDACCESSOR);
|
||||
#ifdef JERRY_CPOINTER_32_BIT
|
||||
#if ENABLED (JERRY_CPOINTER_32_BIT)
|
||||
ecma_getter_setter_pointers_t *getter_setter_pair_p;
|
||||
getter_setter_pair_p = ECMA_GET_POINTER (ecma_getter_setter_pointers_t,
|
||||
value_p->getter_setter_pair_cp);
|
||||
jmem_pools_free (getter_setter_pair_p, sizeof (ecma_getter_setter_pointers_t));
|
||||
#endif /* JERRY_CPOINTER_32_BIT */
|
||||
#endif /* ENABLED (JERRY_CPOINTER_32_BIT) */
|
||||
value_p->value = ECMA_VALUE_UNDEFINED;
|
||||
}
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical
|
||||
{
|
||||
ecma_object_t *binding_obj_p = ecma_get_lex_env_binding_object (lex_env_p);
|
||||
|
||||
#ifndef CONFIG_ECMA_LCACHE_DISABLE
|
||||
#if ENABLED (JERRY_LCACHE)
|
||||
ecma_property_t *property_p = ecma_lcache_lookup (binding_obj_p, name_p);
|
||||
|
||||
if (property_p != NULL)
|
||||
@@ -142,7 +142,7 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical
|
||||
ecma_value_t base_value = ecma_make_object_value (binding_obj_p);
|
||||
return ecma_op_function_call (getter_p, base_value, NULL, 0);
|
||||
}
|
||||
#endif /* !CONFIG_ECMA_LCACHE_DISABLE */
|
||||
#endif /* ENABLED (JERRY_LCACHE) */
|
||||
|
||||
ecma_value_t prop_value = ecma_op_object_find (binding_obj_p, name_p);
|
||||
|
||||
@@ -163,14 +163,14 @@ ecma_op_resolve_reference_value (ecma_object_t *lex_env_p, /**< starting lexical
|
||||
lex_env_p = ecma_get_lex_env_outer_reference (lex_env_p);
|
||||
}
|
||||
|
||||
#ifdef JERRY_ENABLE_ERROR_MESSAGES
|
||||
#if ENABLED (JERRY_ERROR_MESSAGES)
|
||||
ecma_value_t name_val = ecma_make_string_value (name_p);
|
||||
ecma_value_t error_value = ecma_raise_standard_error_with_format (ECMA_ERROR_REFERENCE,
|
||||
"% is not defined",
|
||||
name_val);
|
||||
#else /* !JERRY_ENABLE_ERROR_MESSAGES */
|
||||
#else /* ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
ecma_value_t error_value = ecma_raise_reference_error (NULL);
|
||||
#endif /* JERRY_ENABLE_ERROR_MESSAGES */
|
||||
#endif /* !ENABLED (JERRY_ERROR_MESSAGES) */
|
||||
return error_value;
|
||||
} /* ecma_op_resolve_reference_value */
|
||||
|
||||
|
||||
@@ -66,9 +66,9 @@
|
||||
/*
|
||||
* Check RegExp recursion depth limit
|
||||
*/
|
||||
#ifdef REGEXP_RECURSION_LIMIT
|
||||
JERRY_STATIC_ASSERT (REGEXP_RECURSION_LIMIT > 0, regexp_recursion_limit_must_be_greater_than_zero);
|
||||
#endif /* REGEXP_RECURSION_LIMIT */
|
||||
#if defined (JERRY_REGEXP_RECURSION_LIMIT) && (JERRY_REGEXP_RECURSION_LIMIT != 0)
|
||||
JERRY_STATIC_ASSERT (JERRY_REGEXP_RECURSION_LIMIT > 0, regexp_recursion_limit_must_be_greater_than_zero);
|
||||
#endif /* defined (JERRY_REGEXP_RECURSION_LIMIT) && (JERRY_REGEXP_RECURSION_LIMIT) != 0) */
|
||||
|
||||
/**
|
||||
* Parse RegExp flags (global, ignoreCase, multiline)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifdef REGEXP_RECURSION_LIMIT
|
||||
#if defined (JERRY_REGEXP_RECURSION_LIMIT) && (JERRY_REGEXP_RECURSION_LIMIT != 0)
|
||||
/**
|
||||
* Decrease the recursion counter and test it.
|
||||
* If the counter reaches the limit of the recursion depth
|
||||
@@ -50,8 +50,8 @@
|
||||
/**
|
||||
* Set the recursion counter to the max depth of the recursion.
|
||||
*/
|
||||
#define REGEXP_RECURSION_COUNTER_INIT() (re_ctx.recursion_counter = REGEXP_RECURSION_LIMIT)
|
||||
#else /* !REGEXP_RECURSION_LIMIT */
|
||||
#define REGEXP_RECURSION_COUNTER_INIT() (re_ctx.recursion_counter = JERRY_REGEXP_RECURSION_LIMIT)
|
||||
#else /* !(defined (JERRY_REGEXP_RECURSION_LIMIT) && (JERRY_REGEXP_RECURSION_LIMIT != 0)) */
|
||||
/**
|
||||
* Decrease the recursion counter and test it.
|
||||
* If the counter reaches the limit of the recursion depth
|
||||
@@ -66,7 +66,7 @@
|
||||
* Set the recursion counter to the max depth of the recursion.
|
||||
*/
|
||||
#define REGEXP_RECURSION_COUNTER_INIT()
|
||||
#endif /* REGEXP_RECURSION_LIMIT */
|
||||
#endif /* defined (JERRY_REGEXP_RECURSION_LIMIT) && (JERRY_REGEXP_RECURSION_LIMIT != 0) */
|
||||
|
||||
/**
|
||||
* RegExp flags
|
||||
@@ -88,9 +88,9 @@ typedef struct
|
||||
const lit_utf8_byte_t **saved_p; /**< saved result string pointers, ECMA 262 v5, 15.10.2.1, State */
|
||||
const lit_utf8_byte_t *input_start_p; /**< start of input pattern string */
|
||||
const lit_utf8_byte_t *input_end_p; /**< end of input pattern string */
|
||||
#ifdef REGEXP_RECURSION_LIMIT
|
||||
#if defined (JERRY_REGEXP_RECURSION_LIMIT) && (JERRY_REGEXP_RECURSION_LIMIT != 0)
|
||||
uint32_t recursion_counter; /**< RegExp recursion counter */
|
||||
#endif /* REGEXP_RECURSION_LIMIT */
|
||||
#endif /* defined (JERRY_REGEXP_RECURSION_LIMIT) && (JERRY_REGEXP_RECURSION_LIMIT != 0) */
|
||||
uint32_t num_of_captures; /**< number of capture groups */
|
||||
uint32_t num_of_non_captures; /**< number of non-capture groups */
|
||||
uint32_t *num_of_iterations_p; /**< number of iterations */
|
||||
|
||||
Reference in New Issue
Block a user