Create special objects for scripts instead of functions (#4610)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2021-02-23 15:34:09 +01:00
committed by GitHub
parent 322265bfb9
commit 5c35370327
8 changed files with 73 additions and 55 deletions
+11 -5
View File
@@ -1571,6 +1571,15 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
switch (ext_object_p->u.class_prop.class_id)
{
case LIT_MAGIC_STRING_SCRIPT_UL:
{
ecma_compiled_code_t *compiled_code_p;
compiled_code_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_compiled_code_t,
ext_object_p->u.class_prop.u.value);
ecma_bytecode_deref (compiled_code_p);
break;
}
case LIT_MAGIC_STRING_STRING_UL:
case LIT_MAGIC_STRING_NUMBER_UL:
#if JERRY_ESNEXT
@@ -1684,13 +1693,10 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
}
#endif /* JERRY_ESNEXT */
#if JERRY_MODULE_SYSTEM
case LIT_MAGIC_STRING_RUNNABLE_UL:
case LIT_MAGIC_STRING_MODULE_UL:
{
ecma_extended_object_t *wrapper_p = (ecma_extended_object_t *) object_p;
JERRY_ASSERT (wrapper_p->u.class_prop.extra_info == ECMA_RUNNABLE_FLAGS_MODULE);
ecma_module_t *root_module_p = ECMA_GET_INTERNAL_VALUE_POINTER (ecma_module_t,
wrapper_p->u.class_prop.u.value);
ext_object_p->u.class_prop.u.value);
ecma_bytecode_deref (root_module_p->compiled_code_p);
ecma_module_cleanup (root_module_p);
-8
View File
@@ -1097,14 +1097,6 @@ typedef struct
#endif /* JERRY_SNAPSHOT_EXEC */
#if JERRY_ESNEXT
/**
* Flags for runnable objects.
*/
typedef enum
{
ECMA_RUNNABLE_FLAGS_EMPTY = (0), /**< empty flags */
ECMA_RUNNABLE_FLAGS_MODULE = (1 << 0) /**< runnable is a module */
} ecma_runnable_flags_t;
/**
* Description of arrow function objects.