• oliver@apple.com's avatar
    fourthTier: Structure transition table keys don't have to ref their StringImpl's · 36e01a77
    oliver@apple.com authored
    Reviewed by Geoffrey Garen.
    The structure transition table basically maps string to structure. The string is
    always also stored, and ref'd, in the structure in Structure::m_nameInPrevious.
    m_nameInPrevious is never mutated, and never cleared. The string cannot die unless
    the structure dies. If the structure dies, then that entry in the transition map
    becomes a zombie anyway and we will detect this separately.
    So, we don't need to use RefPtr<StringImpl>. We can just use StringImpl*.
    This also fixes a goof where we were getting the StringImpl's hash rather than
    using a pointer hash. Not only is the latter faster, but it prevents my change
    from leading to crashes: with my change we can have zombie keys, not just zombie
    values. They will exist only until the next map mutation, which will clear them.
    Lookups will work fine because the lookup routine will reject zombies. But it
Structure.cpp 36.9 KB