Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions jerry-core/ecma/base/ecma-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,6 @@ ecma_try_to_give_back_some_memory (jmem_try_give_memory_back_severity_t severity
JERRY_ASSERT (severity == JMEM_TRY_GIVE_MEMORY_BACK_SEVERITY_HIGH);

/* Freeing as much memory as we currently can */
ecma_lcache_invalidate_all ();

ecma_gc_run ();
}
} /* ecma_try_to_give_back_some_memory */
Expand Down
1 change: 0 additions & 1 deletion jerry-core/ecma/base/ecma-helpers-string.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ ecma_copy_or_ref_ecma_string (ecma_string_t *string_p) /**< string descriptor */
if (unlikely (string_p->refs_and_container >= ECMA_STRING_MAX_REF))
{
/* First trying to free unreachable objects that maybe refer to the string */
ecma_lcache_invalidate_all ();
ecma_gc_run ();

if (string_p->refs_and_container >= ECMA_STRING_MAX_REF)
Expand Down
47 changes: 31 additions & 16 deletions jerry-core/ecma/base/ecma-helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,8 +586,6 @@ ecma_create_named_data_property (ecma_object_t *object_p, /**< object */

name_p = ecma_copy_or_ref_ecma_string (name_p);

ecma_lcache_invalidate (object_p, name_p, NULL);

ecma_property_value_t value;
value.value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED);

Expand All @@ -614,8 +612,6 @@ ecma_create_named_accessor_property (ecma_object_t *object_p, /**< object */

name_p = ecma_copy_or_ref_ecma_string (name_p);

ecma_lcache_invalidate (object_p, name_p, NULL);

ecma_property_value_t value;
ECMA_SET_POINTER (value.getter_setter_pair.getter_p, get_p);
ECMA_SET_POINTER (value.getter_setter_pair.setter_p, set_p);
Expand All @@ -636,9 +632,9 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
JERRY_ASSERT (obj_p != NULL);
JERRY_ASSERT (name_p != NULL);

ecma_property_t *property_p;
ecma_property_t *property_p = ecma_lcache_lookup (obj_p, name_p);

if (ecma_lcache_lookup (obj_p, name_p, &property_p))
if (property_p != NULL)
{
return property_p;
}
Expand All @@ -649,14 +645,23 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
if (prop_iter_p != NULL
&& ECMA_PROPERTY_GET_TYPE (prop_iter_p->types + 0) == ECMA_PROPERTY_TYPE_HASHMAP)
{
property_p = ecma_property_hashmap_find ((ecma_property_hashmap_t *) prop_iter_p, name_p);
ecma_lcache_insert (obj_p, name_p, property_p);
ecma_string_t *property_real_name_p;
property_p = ecma_property_hashmap_find ((ecma_property_hashmap_t *) prop_iter_p,
name_p,
&property_real_name_p);

if (property_p != NULL
&& !ecma_is_property_lcached (property_p))
{
ecma_lcache_insert (obj_p, property_real_name_p, property_p);
}

return property_p;
}
#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */

property_p = NULL;
ecma_string_t *property_name_p = NULL;

uint32_t steps = 0;

Expand All @@ -670,8 +675,8 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in

if (prop_pair_p->names_cp[0] != ECMA_NULL_POINTER)
{
ecma_string_t *property_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t,
prop_pair_p->names_cp[0]);
property_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t,
prop_pair_p->names_cp[0]);

if (ecma_compare_ecma_strings (name_p, property_name_p))
{
Expand All @@ -682,8 +687,8 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in

if (prop_pair_p->names_cp[1] != ECMA_NULL_POINTER)
{
ecma_string_t *property_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t,
prop_pair_p->names_cp[1]);
property_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t,
prop_pair_p->names_cp[1]);

if (ecma_compare_ecma_strings (name_p, property_name_p))
{
Expand All @@ -703,7 +708,11 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
ecma_property_hashmap_create (obj_p);
}

ecma_lcache_insert (obj_p, name_p, property_p);
if (property_p != NULL
&& !ecma_is_property_lcached (property_p))
{
ecma_lcache_insert (obj_p, property_name_p, property_p);
}

return property_p;
} /* ecma_find_named_property */
Expand Down Expand Up @@ -875,12 +884,18 @@ ecma_free_property (ecma_object_t *object_p, /**< object the property belongs to
case ECMA_PROPERTY_TYPE_NAMEDDATA:
{
ecma_free_named_data_property (object_p, property_p);
ecma_lcache_invalidate (object_p, name_p, property_p);
if (ecma_is_property_lcached (property_p))
{
ecma_lcache_invalidate (object_p, name_p, property_p);
}
break;
}
case ECMA_PROPERTY_TYPE_NAMEDACCESSOR:
{
ecma_lcache_invalidate (object_p, name_p, property_p);
if (ecma_is_property_lcached (property_p))
{
ecma_lcache_invalidate (object_p, name_p, property_p);
}
break;
}
case ECMA_PROPERTY_TYPE_INTERNAL:
Expand Down Expand Up @@ -1270,7 +1285,7 @@ ecma_is_property_lcached (ecma_property_t *prop_p) /**< property */
/**
* Set value of flag indicating whether the property is registered in LCache
*/
void
inline void __attr_always_inline___
ecma_set_property_lcached (ecma_property_t *prop_p, /**< property */
bool is_lcached) /**< contained (true) or not (false) */
{
Expand Down
1 change: 0 additions & 1 deletion jerry-core/ecma/base/ecma-init-finalize.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ ecma_finalize (void)
jmem_unregister_a_try_give_memory_back_callback (ecma_try_to_give_back_some_memory);

ecma_finalize_environment ();
ecma_lcache_invalidate_all ();
ecma_finalize_builtins ();
ecma_gc_run ();
} /* ecma_finalize */
Expand Down
Loading