Rework Map object (#2760)

This patch reworks the core of the builtin Map object.

Advantages:
 - Provide sublinear access time for the elements via Lcache and property hashmap
 - This implementation is suitable for the builtin Set object as well

Also add the missing 'forEach' routine for the builtin object as well.

JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
Robert Fancsik
2019-04-17 14:50:03 +02:00
committed by László Langó
parent bc9efb07a5
commit d2931c6e40
14 changed files with 525 additions and 406 deletions
@@ -30,6 +30,7 @@
ecma_value_t ecma_op_map_create (const ecma_value_t *arguments_list_p, ecma_length_t arguments_list_len);
ecma_value_t ecma_op_map_size (ecma_value_t this_arg);
ecma_value_t ecma_op_map_get (ecma_value_t this_arg, ecma_value_t key_arg);
ecma_value_t ecma_op_map_foreach (ecma_value_t this_arg, ecma_value_t predicate, ecma_value_t predicate_this_arg);
ecma_value_t ecma_op_map_has (ecma_value_t this_arg, ecma_value_t key_arg);
ecma_value_t ecma_op_map_set (ecma_value_t this_arg, ecma_value_t key_arg, ecma_value_t value_arg);
void ecma_op_map_clear_map (ecma_map_object_t *map_object_p);