Reviewed by Sam Weinig.
- allow polymorphic inline cache to handle Math object functions and possibly other similar things
1.012x speedup on SunSpider.
* kjs/MathObject.cpp:
(JSC::MathObject::getOwnPropertySlot):
* kjs/lookup.cpp:
(JSC::setUpStaticFunctionSlot):
* kjs/lookup.h:
(JSC::getStaticPropertySlot):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@36286
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2008-09-09 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Sam Weinig.
+
+ - allow polymorphic inline cache to handle Math object functions and possibly other similar things
+
+ 1.012x speedup on SunSpider.
+
+ * kjs/MathObject.cpp:
+ (JSC::MathObject::getOwnPropertySlot):
+ * kjs/lookup.cpp:
+ (JSC::setUpStaticFunctionSlot):
+ * kjs/lookup.h:
+ (JSC::getStaticPropertySlot):
+
2008-09-08 Sam Weinig <sam@webkit.org>
Reviewed by Maciej Stachowiak and Oliver Hunt.
return JSObject::getOwnPropertySlot(exec, propertyName, slot);
ASSERT(entry->attributes & Function);
- slot.setStaticEntry(this, entry, staticFunctionGetter);
+ setUpStaticFunctionSlot(exec, entry, this, propertyName, slot);
return true;
}
void setUpStaticFunctionSlot(ExecState* exec, const HashEntry* entry, JSObject* thisObj, const Identifier& propertyName, PropertySlot& slot)
{
ASSERT(entry->attributes & Function);
- PrototypeFunction* function = new (exec) PrototypeFunction(exec, entry->length, propertyName, entry->functionValue);
- thisObj->putDirect(propertyName, function, entry->attributes);
-
JSValue** location = thisObj->getDirectLocation(propertyName);
+
+ if (!location) {
+ PrototypeFunction* function = new (exec) PrototypeFunction(exec, entry->length, propertyName, entry->functionValue);
+ thisObj->putDirect(propertyName, function, entry->attributes);
+ location = thisObj->getDirectLocation(propertyName);
+ }
+
slot.setValueSlot(thisObj, location, thisObj->offsetForLocation(location));
}
return thisObj->ParentImp::getOwnPropertySlot(exec, propertyName, slot);
if (entry->attributes & Function)
- slot.setStaticEntry(thisObj, entry, staticFunctionGetter);
+ setUpStaticFunctionSlot(exec, entry, thisObj, propertyName, slot);
else
slot.setStaticEntry(thisObj, entry, staticValueGetter<ThisImp>);