The interpreter engine for the core JavaScript language, independent of the browser's object model. File ONLY core JavaScript language bugs in this category. For bugs involving browser objects such as "window" and "document", use the "DOM" component. For bugs involving calls between JavaScript and C++, use the "XPConnect" component.

There is a bunch of slowness here that often shows up in profiles.
For instance, SetNonexistentProperty calls SetPropertyByDefining where we then check if the property exists, but SetNonexistentProperty already *knows* the property doesn't exist.
Then via some other calls we end up in AddOrChangeProperty -> NativeObject::putProperty, and there we do *another* lookup!
We can do much better.

UpdateShapeTypeAndValue is a very hot function so let's optimize it a bit:
* There are two call sites but according to a profile Clang wasn't inlining it so I added MOZ_ALWAYS_INLINE.
* It always returns true so I changed the return type to void.
* It can't GC so I removed the handle arguments.

Makes sure CallAddPropertyHook and CallAddPropertyHookDense get inlined. This also changes CallAddPropertyHook to take a HandleId instead of HandleShape, so we can remove a Shape root in AddOrChangeProperty.

This inlines NativeObject::getChildPropertyOnDictionary into NativeObject::getChildProperty. This is faster because it eliminates a call that wasn't inlined, but it also makes the code easier to understand.

We want to make sure setLastProperty and updateSlotsForSpan get inlined in NativeObject::getChildProperty in Shape.cpp
The common case is that we don't need to realloc slots and the call overhead dominates these calls currently.

IdIsIndex is pretty hot, but it has an uninlined call to StringIsArrayIndex. This patch makes IdIsIndex check the first character of the string and if that's not 0-9 we can avoid the StringIsArrayIndex machinery.

(In reply to Tom Schuster [:evilpie] from comment #26)
> Nice, this was a measurable win on some six-speed tests.
I think this push also improved Speedometer with 1 point or so on Windows, both 32-bit and 64-bit. There's a small drop after this landed. Not much but given how much code Speedometer runs that's actually more than I expected from these changes.