Double the maximum number of object references (#4768)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-09-15 11:08:57 +02:00
committed by GitHub
parent d08b5be57f
commit 386ec44d4d
2 changed files with 16 additions and 19 deletions
+12 -18
View File
@@ -815,13 +815,12 @@ typedef enum
*/ */
typedef enum typedef enum
{ {
/* Types between 0 - 12 are ecma_object_type_t which can have a built-in flag. */ /* Types between 0 - 12 are ecma_object_type_t. */
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE = 13, /**< declarative lexical environment */
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE = 29, /**< declarative lexical environment */
#if JERRY_ESNEXT #if JERRY_ESNEXT
ECMA_LEXICAL_ENVIRONMENT_CLASS = 30, /**< lexical environment with class */ ECMA_LEXICAL_ENVIRONMENT_CLASS = 14, /**< lexical environment with class */
#endif /* JERRY_ESNEXT */ #endif /* JERRY_ESNEXT */
ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND = 31, /**< object-bound lexical environment */ ECMA_LEXICAL_ENVIRONMENT_THIS_OBJECT_BOUND = 15, /**< object-bound lexical environment */
ECMA_LEXICAL_ENVIRONMENT_TYPE_START = ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE, /**< first lexical ECMA_LEXICAL_ENVIRONMENT_TYPE_START = ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE, /**< first lexical
* environment type */ * environment type */
@@ -875,12 +874,12 @@ typedef enum
/** /**
* Ecma object type mask for getting the object type. * Ecma object type mask for getting the object type.
*/ */
#define ECMA_OBJECT_TYPE_MASK 0x01fu #define ECMA_OBJECT_TYPE_MASK 0x00fu
/** /**
* Extensible object. * Extensible object.
*/ */
#define ECMA_OBJECT_FLAG_EXTENSIBLE 0x20 #define ECMA_OBJECT_FLAG_EXTENSIBLE 0x10
/** /**
* Declarative lexical environments created for non-closure code blocks * Declarative lexical environments created for non-closure code blocks
@@ -895,7 +894,7 @@ typedef enum
/** /**
* Bitshift index for an ecma-object reference count field * Bitshift index for an ecma-object reference count field
*/ */
#define ECMA_OBJECT_REF_SHIFT 6 #define ECMA_OBJECT_REF_SHIFT 5
/** /**
* Value for increasing or decreasing the object reference counter. * Value for increasing or decreasing the object reference counter.
@@ -904,11 +903,6 @@ typedef enum
#if JERRY_CPOINTER_32_BIT #if JERRY_CPOINTER_32_BIT
/**
* Bitmask for an ecma-object reference count field
*/
#define ECMA_OBJECT_REF_MASK (((1u << 26) - 1) << ECMA_OBJECT_REF_SHIFT)
/** /**
* Type of the descriptor field of an object * Type of the descriptor field of an object
*/ */
@@ -916,11 +910,6 @@ typedef uint32_t ecma_object_descriptor_t;
#else /* !JERRY_CPOINTER_32_BIT */ #else /* !JERRY_CPOINTER_32_BIT */
/**
* Bitmask for an ecma-object reference count field
*/
#define ECMA_OBJECT_REF_MASK (((1u << 10) - 1) << ECMA_OBJECT_REF_SHIFT)
/** /**
* Type of the descriptor field of an object * Type of the descriptor field of an object
*/ */
@@ -928,6 +917,11 @@ typedef uint16_t ecma_object_descriptor_t;
#endif /* JERRY_CPOINTER_32_BIT */ #endif /* JERRY_CPOINTER_32_BIT */
/**
* Bitmask for an ecma-object reference count field
*/
#define ECMA_OBJECT_REF_MASK ((ecma_object_descriptor_t) (~0u << ECMA_OBJECT_REF_SHIFT))
/** /**
* Represents non-visited white object * Represents non-visited white object
*/ */
+3
View File
@@ -54,6 +54,9 @@ JERRY_STATIC_ASSERT (ECMA_OBJECT_REF_ONE == (ECMA_OBJECT_FLAG_EXTENSIBLE << 1),
JERRY_STATIC_ASSERT ((ECMA_OBJECT_MAX_REF + ECMA_OBJECT_REF_ONE) == ECMA_OBJECT_REF_MASK, JERRY_STATIC_ASSERT ((ECMA_OBJECT_MAX_REF + ECMA_OBJECT_REF_ONE) == ECMA_OBJECT_REF_MASK,
ecma_object_max_ref_does_not_fill_the_remaining_bits); ecma_object_max_ref_does_not_fill_the_remaining_bits);
JERRY_STATIC_ASSERT ((ECMA_OBJECT_REF_MASK & (ECMA_OBJECT_TYPE_MASK | ECMA_OBJECT_FLAG_EXTENSIBLE)) == 0,
ecma_object_ref_mask_overlaps_with_object_type_or_extensible);
JERRY_STATIC_ASSERT (ECMA_PROPERTY_FLAGS_MASK == ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE, JERRY_STATIC_ASSERT (ECMA_PROPERTY_FLAGS_MASK == ECMA_PROPERTY_CONFIGURABLE_ENUMERABLE_WRITABLE,
ecma_property_flags_mask_must_use_the_configurable_enumerable_writable_flags); ecma_property_flags_mask_must_use_the_configurable_enumerable_writable_flags);