⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 259681 in webkit


Ignore:
Timestamp:
Apr 7, 2020, 4:11:21 PM (6 years ago)
Author:
sbarati@apple.com
Message:

Delete ICs can't cache dictionaries
https://bugs.webkit.org/show_bug.cgi?id=210147
<rdar://problem/61382405>

Reviewed by Tadeu Zagallo.

JSTests:

  • stress/dont-cache-delete-ic-on-dictionary-2.js: Added.

(assert):
(makeDictionary):
(foo):

  • stress/dont-cache-delete-ic-on-dictionary.js: Added.

(assert):
(foo):

Source/JavaScriptCore:

We were happily caching delete IC cases on a dictionary object.
This is clearly wrong, as we might cache a miss on a dictionary
on a property "P", even though we might add "P" to the structure
without transitioning it.

  • jit/Repatch.cpp:

(JSC::tryCacheDeleteBy):

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r259676 r259681  
     12020-04-07  Saam Barati  <sbarati@apple.com>
     2
     3        Delete ICs can't cache dictionaries
     4        https://bugs.webkit.org/show_bug.cgi?id=210147
     5        <rdar://problem/61382405>
     6
     7        Reviewed by Tadeu Zagallo.
     8
     9        * stress/dont-cache-delete-ic-on-dictionary-2.js: Added.
     10        (assert):
     11        (makeDictionary):
     12        (foo):
     13        * stress/dont-cache-delete-ic-on-dictionary.js: Added.
     14        (assert):
     15        (foo):
     16
    1172020-04-07  Tadeu Zagallo  <tzagallo@apple.com>
    218
  • trunk/Source/JavaScriptCore/ChangeLog

    r259676 r259681  
     12020-04-07  Saam Barati  <sbarati@apple.com>
     2
     3        Delete ICs can't cache dictionaries
     4        https://bugs.webkit.org/show_bug.cgi?id=210147
     5        <rdar://problem/61382405>
     6
     7        Reviewed by Tadeu Zagallo.
     8
     9        We were happily caching delete IC cases on a dictionary object.
     10        This is clearly wrong, as we might cache a miss on a dictionary
     11        on a property "P", even though we might add "P" to the structure
     12        without transitioning it.
     13
     14        * jit/Repatch.cpp:
     15        (JSC::tryCacheDeleteBy):
     16
    1172020-04-07  Tadeu Zagallo  <tzagallo@apple.com>
    218
  • trunk/Source/JavaScriptCore/jit/Repatch.cpp

    r259676 r259681  
    757757            return GiveUpOnCache;
    758758
     759        if (baseValue.asCell()->structure()->isDictionary()) {
     760            if (baseValue.asCell()->structure()->hasBeenFlattenedBefore())
     761                return GiveUpOnCache;
     762            jsCast<JSObject*>(baseValue)->flattenDictionaryObject(vm);
     763            return RetryCacheLater;
     764        }
     765
     766        if (oldStructure->isDictionary())
     767            return RetryCacheLater;
     768
    759769        std::unique_ptr<AccessCase> newCase;
    760770
Note: See TracChangeset for help on using the changeset viewer.