Changeset 36286 in webkit for trunk/JavaScriptCore/kjs


Ignore:
Timestamp:
Sep 9, 2008, 12:58:53 AM (17 years ago)
Author:
[email protected]
Message:

2008-09-09 Maciej Stachowiak <[email protected]>

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):
Location:
trunk/JavaScriptCore/kjs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/MathObject.cpp

    r36263 r36286  
    107107
    108108    ASSERT(entry->attributes & Function);
    109     slot.setStaticEntry(this, entry, staticFunctionGetter);
     109    setUpStaticFunctionSlot(exec, entry, this, propertyName, slot);
    110110    return true;
    111111}
  • trunk/JavaScriptCore/kjs/lookup.cpp

    r36263 r36286  
    7373{
    7474    ASSERT(entry->attributes & Function);
    75     PrototypeFunction* function = new (exec) PrototypeFunction(exec, entry->length, propertyName, entry->functionValue);
    76     thisObj->putDirect(propertyName, function, entry->attributes);
     75    JSValue** location = thisObj->getDirectLocation(propertyName);
     76 
     77    if (!location) {
     78        PrototypeFunction* function = new (exec) PrototypeFunction(exec, entry->length, propertyName, entry->functionValue);
     79        thisObj->putDirect(propertyName, function, entry->attributes);
     80        location = thisObj->getDirectLocation(propertyName);
     81    }
    7782   
    78     JSValue** location = thisObj->getDirectLocation(propertyName);
    7983    slot.setValueSlot(thisObj, location, thisObj->offsetForLocation(location));
    8084}
  • trunk/JavaScriptCore/kjs/lookup.h

    r36264 r36286  
    146146
    147147        if (entry->attributes & Function)
    148             slot.setStaticEntry(thisObj, entry, staticFunctionGetter);
     148            setUpStaticFunctionSlot(exec, entry, thisObj, propertyName, slot);
    149149        else
    150150            slot.setStaticEntry(thisObj, entry, staticValueGetter<ThisImp>);
Note: See TracChangeset for help on using the changeset viewer.