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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 19 deletions

View File

@ -815,13 +815,12 @@ typedef enum
*/
typedef enum
{
/* Types between 0 - 12 are ecma_object_type_t which can have a built-in flag. */
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE = 29, /**< declarative lexical environment */
/* Types between 0 - 12 are ecma_object_type_t. */
ECMA_LEXICAL_ENVIRONMENT_DECLARATIVE = 13, /**< declarative lexical environment */
#if JERRY_ESNEXT
ECMA_LEXICAL_ENVIRONMENT_CLASS = 30, /**< lexical environment with class */
ECMA_LEXICAL_ENVIRONMENT_CLASS = 14, /**< lexical environment with class */
#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
* environment type */
@ -875,12 +874,12 @@ typedef enum
/**
* Ecma object type mask for getting the object type.
*/
#define ECMA_OBJECT_TYPE_MASK 0x01fu
#define ECMA_OBJECT_TYPE_MASK 0x00fu
/**
* Extensible object.
*/
#define ECMA_OBJECT_FLAG_EXTENSIBLE 0x20
#define ECMA_OBJECT_FLAG_EXTENSIBLE 0x10
/**
* Declarative lexical environments created for non-closure code blocks
@ -895,7 +894,7 @@ typedef enum
/**
* 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.
@ -904,11 +903,6 @@ typedef enum
#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
*/
@ -916,11 +910,6 @@ typedef uint32_t ecma_object_descriptor_t;
#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
*/
@ -928,6 +917,11 @@ typedef uint16_t ecma_object_descriptor_t;
#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
*/

View File

@ -52,7 +52,10 @@ JERRY_STATIC_ASSERT (ECMA_OBJECT_REF_ONE == (ECMA_OBJECT_FLAG_EXTENSIBLE << 1),
ecma_object_ref_one_must_follow_the_extensible_flag);
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,
ecma_property_flags_mask_must_use_the_configurable_enumerable_writable_flags);