Remove ES_NEXT macro (#4915)

- remove all '#JERRY_ESNEXT' macro
- remove 5.1 build profile, update test runner accordingly (Note: all builtins are turn on by default)
- move tests from tests/jerry/esnext into tests/jerry, concatenate files with same names
- add skiplist to some snapshot tests that were supported only in 5.1
- fix doxygen issues that were hidden before (bc. of es.next macro)

Co-authored-by: Martin Negyokru negyokru@inf.u-szeged.hu
JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2022-01-31 16:46:00 +01:00
committed by GitHub
parent 76403606d0
commit 4924f9fd31
973 changed files with 1902 additions and 8240 deletions
@@ -455,40 +455,6 @@ ecma_instantiate_builtin (ecma_global_object_t *global_object_p, /**< global obj
}
#endif /* JERRY_BUILTIN_BOOLEAN */
#if !JERRY_ESNEXT
#if JERRY_BUILTIN_DATE
case ECMA_BUILTIN_ID_DATE_PROTOTYPE:
{
JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_BUILT_IN_CLASS);
ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_DATE;
ecma_number_t *prim_prop_num_value_p = ecma_alloc_number ();
*prim_prop_num_value_p = ecma_number_make_nan ();
ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.cls.u3.value, prim_prop_num_value_p);
break;
}
#endif /* JERRY_BUILTIN_DATE */
#if JERRY_BUILTIN_REGEXP
case ECMA_BUILTIN_ID_REGEXP_PROTOTYPE:
{
JERRY_ASSERT (obj_type == ECMA_OBJECT_TYPE_BUILT_IN_CLASS);
ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
ext_object_p->u.cls.type = ECMA_OBJECT_CLASS_REGEXP;
re_compiled_code_t *bc_p =
re_compile_bytecode (ecma_get_magic_string (LIT_MAGIC_STRING_EMPTY_NON_CAPTURE_GROUP), RE_FLAG_EMPTY);
JERRY_ASSERT (bc_p != NULL);
ECMA_SET_INTERNAL_VALUE_POINTER (ext_object_p->u.cls.u3.value, bc_p);
break;
}
#endif /* JERRY_BUILTIN_REGEXP */
#endif /* !JERRY_ESNEXT */
default:
{
JERRY_ASSERT (obj_type != ECMA_OBJECT_TYPE_BUILT_IN_CLASS);
@@ -550,15 +516,13 @@ ecma_builtin_create_global_object (void)
/* Temporary self reference for GC mark. */
ECMA_SET_NON_NULL_POINTER (global_object_p->global_env_cp, object_p);
#if JERRY_ESNEXT
global_object_p->global_scope_cp = global_object_p->global_env_cp;
#endif /* JERRY_ESNEXT */
ecma_object_t *global_lex_env_p = ecma_create_object_lex_env (NULL, object_p);
ECMA_SET_NON_NULL_POINTER (global_object_p->global_env_cp, global_lex_env_p);
#if JERRY_ESNEXT
global_object_p->global_scope_cp = global_object_p->global_env_cp;
#endif /* JERRY_ESNEXT */
ecma_deref_object (global_lex_env_p);
ecma_object_t *prototype_object_p;
@@ -727,8 +691,6 @@ ecma_builtin_make_function_object_for_setter_accessor (ecma_object_t *builtin_ob
ECMA_BUILTIN_ROUTINE_SETTER);
} /* ecma_builtin_make_function_object_for_setter_accessor */
#if JERRY_ESNEXT
/**
* Create specification defined properties for built-in native handlers.
*
@@ -769,8 +731,6 @@ ecma_builtin_native_handler_try_to_instantiate_property (ecma_object_t *object_p
return prop_p;
} /* ecma_builtin_native_handler_try_to_instantiate_property */
#endif /* JERRY_ESNEXT */
/**
* Lazy instantiation of builtin routine property of builtin object
*
@@ -789,12 +749,10 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ext_func_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER))
{
return ecma_builtin_native_handler_try_to_instantiate_property (object_p, property_name_p);
}
#endif /* !JERRY_ESNEXT */
if (ecma_string_is_length (property_name_p))
{
@@ -803,7 +761,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
*/
ecma_property_t *len_prop_p;
#if JERRY_ESNEXT
uint8_t *bitset_p = &ext_func_p->u.built_in.u2.routine_flags;
if (*bitset_p & ECMA_BUILTIN_ROUTINE_LENGTH_INITIALIZED)
@@ -816,12 +773,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
* as it is configurable and so can be deleted (ECMA-262 v6, 19.2.4.1) */
ecma_property_value_t *len_prop_value_p =
ecma_create_named_data_property (object_p, property_name_p, ECMA_PROPERTY_BUILT_IN_CONFIGURABLE, &len_prop_p);
#else /* !JERRY_ESNEXT */
/* We don't need to mark that the property was already lazy instantiated,
* as it is non-configurable and so can't be deleted (ECMA-262 v5, 13.2.5) */
ecma_property_value_t *len_prop_value_p =
ecma_create_named_data_property (object_p, property_name_p, ECMA_PROPERTY_BUILT_IN_FIXED, &len_prop_p);
#endif /* JERRY_ESNEXT */
uint8_t length = 0;
@@ -845,7 +796,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
return len_prop_p;
}
#if JERRY_ESNEXT
/*
* Lazy instantiation of 'name' property
*/
@@ -918,7 +868,6 @@ ecma_builtin_routine_try_to_instantiate_property (ecma_object_t *object_p, /**<
return name_prop_p;
}
#endif /* JERRY_ESNEXT */
return NULL;
} /* ecma_builtin_routine_try_to_instantiate_property */
@@ -937,12 +886,10 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
{
lit_magic_string_id_t magic_string_id = ecma_get_string_magic (property_name_p);
#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ecma_prop_name_is_symbol (property_name_p)) && property_name_p->u.hash & ECMA_SYMBOL_FLAG_GLOBAL)
{
magic_string_id = (property_name_p->u.hash >> ECMA_SYMBOL_FLAGS_SHIFT);
}
#endif /* JERRY_ESNEXT */
if (magic_string_id == LIT_MAGIC_STRING__COUNT)
{
@@ -1034,11 +981,9 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
static const ecma_number_t builtin_number_list[] = {
ECMA_NUMBER_MAX_VALUE,
ECMA_NUMBER_MIN_VALUE,
#if JERRY_ESNEXT
ECMA_NUMBER_EPSILON,
ECMA_NUMBER_MAX_SAFE_INTEGER,
ECMA_NUMBER_MIN_SAFE_INTEGER,
#endif /* JERRY_ESNEXT */
ECMA_NUMBER_E,
ECMA_NUMBER_PI,
ECMA_NUMBER_LN10,
@@ -1083,7 +1028,6 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
value = ecma_make_magic_string_value ((lit_magic_string_id_t) curr_property_p->value);
break;
}
#if JERRY_ESNEXT
case ECMA_BUILTIN_PROPERTY_SYMBOL:
{
lit_magic_string_id_t symbol_id = (lit_magic_string_id_t) curr_property_p->value;
@@ -1108,7 +1052,6 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
ecma_ref_object (setter_p);
break;
}
#endif /* JERRY_ESNEXT */
case ECMA_BUILTIN_PROPERTY_OBJECT:
{
ecma_object_t *builtin_object_p;
@@ -1182,8 +1125,6 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
return prop_p;
} /* ecma_builtin_try_to_instantiate_property */
#if JERRY_ESNEXT
/**
* Delete configurable properties of native handlers.
*/
@@ -1241,8 +1182,6 @@ ecma_builtin_routine_delete_built_in_property (ecma_object_t *object_p, /**< obj
*bitset_p |= ECMA_BUILTIN_ROUTINE_NAME_INITIALIZED;
} /* ecma_builtin_routine_delete_built_in_property */
#endif /* JERRY_ESNEXT */
/**
* Delete configurable properties of built-ins.
*/
@@ -1252,7 +1191,6 @@ ecma_builtin_delete_built_in_property (ecma_object_t *object_p, /**< object */
{
lit_magic_string_id_t magic_string_id = ecma_get_string_magic (property_name_p);
#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ecma_prop_name_is_symbol (property_name_p)))
{
if (property_name_p->u.hash & ECMA_SYMBOL_FLAG_GLOBAL)
@@ -1260,7 +1198,6 @@ ecma_builtin_delete_built_in_property (ecma_object_t *object_p, /**< object */
magic_string_id = (property_name_p->u.hash >> ECMA_SYMBOL_FLAGS_SHIFT);
}
}
#endif /* JERRY_ESNEXT */
ecma_built_in_props_t *built_in_props_p;
ecma_object_type_t object_type = ecma_get_object_type (object_p);
@@ -1307,8 +1244,6 @@ ecma_builtin_delete_built_in_property (ecma_object_t *object_p, /**< object */
*bitset_p |= bit_for_index;
} /* ecma_builtin_delete_built_in_property */
#if JERRY_ESNEXT
/**
* List names of an Built-in native handler object's lazy instantiated properties,
* adding them to corresponding string collections
@@ -1334,8 +1269,6 @@ ecma_builtin_native_handler_list_lazy_property_names (ecma_object_t *object_p, /
}
} /* ecma_builtin_native_handler_list_lazy_property_names */
#endif /* JERRY_ESNEXT */
/**
* List names of a built-in function's lazy instantiated properties
*
@@ -1356,7 +1289,6 @@ ecma_builtin_routine_list_lazy_property_names (ecma_object_t *object_p, /**< a b
return;
}
#if JERRY_ESNEXT
ecma_extended_object_t *ext_func_p = (ecma_extended_object_t *) object_p;
if (JERRY_UNLIKELY (ext_func_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER))
@@ -1377,11 +1309,6 @@ ecma_builtin_routine_list_lazy_property_names (ecma_object_t *object_p, /**< a b
ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_NAME));
prop_counter_p->string_named_props++;
}
#else /* !JERRY_ESNEXT */
/* 'length' property is non-enumerable (ECMA-262 v5, 15) */
ecma_collection_push_back (prop_names_p, ecma_make_magic_string_value (LIT_MAGIC_STRING_LENGTH));
prop_counter_p->string_named_props++;
#endif /* JERRY_ESNEXT */
} /* ecma_builtin_routine_list_lazy_property_names */
/**
@@ -1421,10 +1348,8 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
uint8_t *bitset_p = built_in_props_p->u2.instantiated_bitset + 1;
#endif /* JERRY_BUILTIN_REALMS */
#if JERRY_ESNEXT
uint8_t *symbol_bitset_p = bitset_p;
bool has_symbol = true;
#endif /* JERRY_BUILTIN_REALMS */
if (!(filter & JERRY_PROPERTY_FILTER_EXCLUDE_STRINGS))
{
@@ -1432,9 +1357,7 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
uint8_t bitset = built_in_props_p->u2.instantiated_bitset[0];
uint32_t index = 0;
#if JERRY_ESNEXT
has_symbol = false;
#endif /* JERRY_BUILTIN_REALMS */
while (curr_property_p->magic_string_id != LIT_MAGIC_STRING__COUNT)
{
@@ -1448,21 +1371,17 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
if (!(bitset & bit_for_index))
{
#if JERRY_ESNEXT
if (JERRY_LIKELY (curr_property_p->magic_string_id < LIT_NON_INTERNAL_MAGIC_STRING__COUNT))
{
#endif /* JERRY_ESNEXT */
ecma_value_t name = ecma_make_magic_string_value ((lit_magic_string_id_t) curr_property_p->magic_string_id);
ecma_collection_push_back (prop_names_p, name);
prop_counter_p->string_named_props++;
#if JERRY_ESNEXT
}
else
{
JERRY_ASSERT (LIT_IS_GLOBAL_SYMBOL (curr_property_p->magic_string_id));
has_symbol = true;
}
#endif /* JERRY_ESNEXT */
}
curr_property_p++;
@@ -1470,7 +1389,6 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
}
}
#if JERRY_ESNEXT
if (has_symbol && !(filter & JERRY_PROPERTY_FILTER_EXCLUDE_SYMBOLS))
{
const ecma_builtin_property_descriptor_t *curr_property_p = ecma_builtin_property_list_references[builtin_id];
@@ -1498,7 +1416,6 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
index++;
}
}
#endif /* JERRY_ESNEXT */
} /* ecma_builtin_list_lazy_property_names */
/**
@@ -1563,13 +1480,11 @@ ecma_builtin_dispatch_call (ecma_object_t *obj_p, /**< built-in object */
if (ecma_builtin_function_is_routine (obj_p))
{
#if JERRY_ESNEXT
if (JERRY_UNLIKELY (ext_obj_p->u.built_in.id == ECMA_BUILTIN_ID_HANDLER))
{
ecma_builtin_handler_t handler = ecma_builtin_handler_get (ext_obj_p->u.built_in.routine_id);
return handler (obj_p, arguments_list_p, arguments_list_len);
}
#endif /* !JERRY_ESNEXT */
return ecma_builtin_dispatch_routine (ext_obj_p, this_arg_value, arguments_list_p, arguments_list_len);
}