@@ -586,8 +586,6 @@ ecma_create_named_data_property (ecma_object_t *object_p, /**< object */
586586
587587 name_p = ecma_copy_or_ref_ecma_string (name_p );
588588
589- ecma_lcache_invalidate (object_p , name_p , NULL );
590-
591589 ecma_property_value_t value ;
592590 value .value = ecma_make_simple_value (ECMA_SIMPLE_VALUE_UNDEFINED );
593591
@@ -614,8 +612,6 @@ ecma_create_named_accessor_property (ecma_object_t *object_p, /**< object */
614612
615613 name_p = ecma_copy_or_ref_ecma_string (name_p );
616614
617- ecma_lcache_invalidate (object_p , name_p , NULL );
618-
619615 ecma_property_value_t value ;
620616 ECMA_SET_POINTER (value .getter_setter_pair .getter_p , get_p );
621617 ECMA_SET_POINTER (value .getter_setter_pair .setter_p , set_p );
@@ -636,9 +632,9 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
636632 JERRY_ASSERT (obj_p != NULL );
637633 JERRY_ASSERT (name_p != NULL );
638634
639- ecma_property_t * property_p ;
635+ ecma_property_t * property_p = ecma_lcache_lookup ( obj_p , name_p ) ;
640636
641- if (ecma_lcache_lookup ( obj_p , name_p , & property_p ) )
637+ if (property_p != NULL )
642638 {
643639 return property_p ;
644640 }
@@ -649,14 +645,23 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
649645 if (prop_iter_p != NULL
650646 && ECMA_PROPERTY_GET_TYPE (prop_iter_p -> types + 0 ) == ECMA_PROPERTY_TYPE_HASHMAP )
651647 {
652- property_p = ecma_property_hashmap_find ((ecma_property_hashmap_t * ) prop_iter_p , name_p );
653- ecma_lcache_insert (obj_p , name_p , property_p );
648+ ecma_string_t * property_real_name_p ;
649+ property_p = ecma_property_hashmap_find ((ecma_property_hashmap_t * ) prop_iter_p ,
650+ name_p ,
651+ & property_real_name_p );
652+
653+ if (property_p != NULL
654+ && !ecma_is_property_lcached (property_p ))
655+ {
656+ ecma_lcache_insert (obj_p , property_real_name_p , property_p );
657+ }
654658
655659 return property_p ;
656660 }
657661#endif /* !CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE */
658662
659663 property_p = NULL ;
664+ ecma_string_t * property_name_p = NULL ;
660665
661666 uint32_t steps = 0 ;
662667
@@ -670,8 +675,8 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
670675
671676 if (prop_pair_p -> names_cp [0 ] != ECMA_NULL_POINTER )
672677 {
673- ecma_string_t * property_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t ,
674- prop_pair_p -> names_cp [0 ]);
678+ property_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t ,
679+ prop_pair_p -> names_cp [0 ]);
675680
676681 if (ecma_compare_ecma_strings (name_p , property_name_p ))
677682 {
@@ -682,8 +687,8 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
682687
683688 if (prop_pair_p -> names_cp [1 ] != ECMA_NULL_POINTER )
684689 {
685- ecma_string_t * property_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t ,
686- prop_pair_p -> names_cp [1 ]);
690+ property_name_p = ECMA_GET_NON_NULL_POINTER (ecma_string_t ,
691+ prop_pair_p -> names_cp [1 ]);
687692
688693 if (ecma_compare_ecma_strings (name_p , property_name_p ))
689694 {
@@ -703,7 +708,11 @@ ecma_find_named_property (ecma_object_t *obj_p, /**< object to find property in
703708 ecma_property_hashmap_create (obj_p );
704709 }
705710
706- ecma_lcache_insert (obj_p , name_p , property_p );
711+ if (property_p != NULL
712+ && !ecma_is_property_lcached (property_p ))
713+ {
714+ ecma_lcache_insert (obj_p , property_name_p , property_p );
715+ }
707716
708717 return property_p ;
709718} /* ecma_find_named_property */
@@ -875,12 +884,18 @@ ecma_free_property (ecma_object_t *object_p, /**< object the property belongs to
875884 case ECMA_PROPERTY_TYPE_NAMEDDATA :
876885 {
877886 ecma_free_named_data_property (object_p , property_p );
878- ecma_lcache_invalidate (object_p , name_p , property_p );
887+ if (ecma_is_property_lcached (property_p ))
888+ {
889+ ecma_lcache_invalidate (object_p , name_p , property_p );
890+ }
879891 break ;
880892 }
881893 case ECMA_PROPERTY_TYPE_NAMEDACCESSOR :
882894 {
883- ecma_lcache_invalidate (object_p , name_p , property_p );
895+ if (ecma_is_property_lcached (property_p ))
896+ {
897+ ecma_lcache_invalidate (object_p , name_p , property_p );
898+ }
884899 break ;
885900 }
886901 case ECMA_PROPERTY_TYPE_INTERNAL :
@@ -1270,7 +1285,7 @@ ecma_is_property_lcached (ecma_property_t *prop_p) /**< property */
12701285/**
12711286 * Set value of flag indicating whether the property is registered in LCache
12721287 */
1273- void
1288+ inline void __attr_always_inline___
12741289ecma_set_property_lcached (ecma_property_t * prop_p , /**< property */
12751290 bool is_lcached ) /**< contained (true) or not (false) */
12761291{
0 commit comments