If you are going to go through all this trouble to optimize for the
probably should make these inlined for the fast case of looking up a 31-bit
signed integer. If you inline that case and then fall back to api.cc only
you need to allocate a heap number. If you do that, I suspect that it will
fast as the integer cache, unless webkit often caches integers where the
don't fit in the 31-bit signed range.
I wanted to do that, but I wasn't sure how. I couldn't figure out how to
i::Smi::IsValid and i::Smi::FromInt from the header. Should I just do the
mashing manually or is there a more structured approach I should use in the
Actually, I don't know if you will ever be able to replace the int cache
this code, since it allocates handles. Even if it's inlined, the handle
allocation will probably make it more than trivially expensive.
I'll land this in its current form which LGTM. At some point, mstarzinger or
svenpanne might want to make it inlinable, but that won't change the API.