• Benedikt Meurer's avatar
    [cleanup] Remove the `Map::IsDictionaryMap()` method. · 5b46f573
    Benedikt Meurer authored
    There's a `Map::IsDictionaryMap()` method in addition to the
    `Map::is_dictionary_map()`, which apparently do very different things:
    The former checks whether the instance type of the Map is in a certain
    range (FIRST_DICTIONARY_TYPE to LAST_DICTIONARY_TYPE), while the latter
    checks the `is_dictionary_map` bit (which means that the backing store
    for the properties of a JSObject is in slow mode). To make matters worse
    there's also `CodeStubAssembler::IsDictionaryMap()`, which does the bit
    check similar to `Map::is_dictionary_map()`. And to make matters even
    worse the FIRST_DICTIONARY_TYPE to LAST_DICTIONARY_TYPE range also
    contains instance types for classes that aren't subclass of `Dictionary`
    (despite a comment stating the opposite).
    
    So in conclusion it's best to remove the confusing
    `Map::IsDictionaryMap()` method, which is anyways wrong, and just test
    explicitly for `NameDictionary`, `NumberDictionary` or
    `GlobalDictionary` in the appropriate places.
    
    Bug: v8:9183
    Change-Id: If35f73261e3cc96938ebf499bf32be3ec725288b
    Cq-Include-Trybots: luci.chromium.try:linux-rel,win7-rel
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1627330
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#61770}
    5b46f573
test-hashcode.cc 9.7 KB