Changeset 36286 in webkit for trunk/JavaScriptCore/kjs/lookup.cpp


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):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.