Optimize array push/pop for fast-array cases (#3187)

Performance results:
ARM: 1m19s -> 0m57s
Intel: 0m7,5s -> 0m5s

Binary size increase: 168 bytes

JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
Szilagyi Adam
2019-10-16 16:41:01 +02:00
committed by Robert Fancsik
parent 390916e989
commit 09c5d98e25
5 changed files with 64 additions and 17 deletions
+7 -1
View File
@@ -1024,7 +1024,13 @@ ecma_op_object_put (ecma_object_t *object_p, /**< the object */
return ecma_reject (is_throw);
}
if (ecma_fast_array_set_property (object_p, property_name_p, value))
uint32_t index = ecma_string_get_array_index (property_name_p);
if (JERRY_UNLIKELY (index == ECMA_STRING_NOT_ARRAY_INDEX))
{
ecma_fast_array_convert_to_normal (object_p);
}
else if (ecma_fast_array_set_property (object_p, index, value))
{
return ECMA_VALUE_TRUE;
}