Ignore:
Timestamp:
Sep 29, 2013, 8:45:30 PM (12 years ago)
Author:
[email protected]
Message:

Pass VM instead of JSGlobalObject to function constructors.
<https://webkit.org/b/122082>

Reviewed by Darin Adler.

Functions don't need anything from the global object during their
construction and only use it to get to the VM. Reduce loads by
simply passing the VM around instead.

This patch is mostly mechanical, I just changed the signature of
InternalFunction and worked my way from there until it built.

JSC release binary size -= 4840 bytes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r156240 r156624  
    593593    if (Parent::getOwnPropertySlot(thisObj, exec, propertyName, slot2))
    594594        return slot2.getValue(exec, propertyName);
    595    
     595
    596596    if (StringImpl* name = propertyName.publicName()) {
    597597        for (JSClassRef jsClass = thisObj->classRef(); jsClass; jsClass = jsClass->parentClass) {
     
    599599                if (StaticFunctionEntry* entry = staticFunctions->get(name)) {
    600600                    if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) {
    601                        
    602                         JSObject* o = JSCallbackFunction::create(exec, thisObj->globalObject(), callAsFunction, name);
    603                         thisObj->putDirect(exec->vm(), propertyName, o, entry->attributes);
     601                        VM& vm = exec->vm();
     602                        JSObject* o = JSCallbackFunction::create(vm, thisObj->globalObject(), callAsFunction, name);
     603                        thisObj->putDirect(vm, propertyName, o, entry->attributes);
    604604                        return o;
    605605                    }
Note: See TracChangeset for help on using the changeset viewer.