Eliminate the allocation of spread object (#3333)

ECMA_VALUE_SPREAD_ELEMENT can be used to represent that the next argument needs to be spreaded, therefore no allocation is needed.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-11-19 18:16:43 +01:00
committed by Dániel Bátyai
parent 70566a52fb
commit 830011c033
10 changed files with 49 additions and 207 deletions
-20
View File
@@ -465,17 +465,6 @@ ecma_gc_mark (ecma_object_t *object_p) /**< object to mark from */
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#if ENABLED (JERRY_ES2015)
case ECMA_PSEUDO_SPREAD_OBJECT:
{
ecma_value_t spread_value = ext_object_p->u.pseudo_array.u2.spread_value;
if (ecma_is_value_object (spread_value))
{
ecma_gc_set_object_visited (ecma_get_object_from_value (spread_value));
}
break;
}
#endif /* ENABLED (JERRY_ES2015) */
default:
{
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_ARGUMENTS);
@@ -967,15 +956,6 @@ ecma_gc_free_object (ecma_object_t *object_p) /**< object to free */
break;
}
#endif /* ENABLED (JERRY_ES2015_BUILTIN_ITERATOR) */
#if ENABLED (JERRY_ES2015)
case ECMA_PSEUDO_SPREAD_OBJECT:
{
ecma_value_t spread_value = ext_object_p->u.pseudo_array.u2.spread_value;
ecma_free_value_if_not_object (spread_value);
break;
}
#endif /* ENABLED (JERRY_ES2015) */
default:
{
JERRY_ASSERT (ext_object_p->u.pseudo_array.type == ECMA_PSEUDO_ARRAY_TYPEDARRAY