[Webkit-unassigned] [Bug 158083] LLInt should support other types of prototype GetById caching.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jun 11 13:37:41 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=158083

--- Comment #45 from Caio Lima <ticaiolima at gmail.com> ---
(In reply to comment #44)
> A PropertyName is identical to a UniquedStringImpl* so you can just pass
> that.
> A PropertyName is a struct with a single UniquedStringImpl* field.
> 
> I believe get_by_id has an index in it's instruction corresponding to its
> UniquedStringImpl*. You may need to write some code that loads this off
> the CodeBlock based on some index. I'm not sure if we have code like that
> already
> in the LLInt but it should be easy to write. 

Actually, I don't think so. Checking the CodeBlock code I found the method used to get the identifier based in the identifier index.

const Identifier& CodeBlock::identifier(int index) const
{
    size_t unlinkedIdentifiers = m_unlinkedCode->numberOfIdentifiers();
    if (static_cast<unsigned>(index) < unlinkedIdentifiers)
        return m_unlinkedCode->identifier(index);

}

The m_unlikedCode stores the identifiers into a Vector<Identifier> m_identifiers. The problem is to revive the identifier contained in the Vector buffer. My current implementation is like this

macro loadIdentifier(index, dest)
    loadp CodeBlock[cfr], t2
    loadp CodeBlock::m_unlinkedCode[t2], t1 #t1 is pointing to UnlinkedCodeBlock
    addp UnlinkedCodeBlock::m_identifiers, t1 #Offset to point to m_identifiers
    loadis index, t2
    mulp sizeof Identifier, t2 
    addp t2, t1 # Offset to point to m_identifiers[index]
    addp Identifier::m_string, t1 # m_identifiers[index].m_string
    loadp t1, dest
end 

Any tip?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160611/03b8d2dd/attachment.html>


More information about the webkit-unassigned mailing list