Ignore:
Timestamp:
Sep 28, 2013, 7:15:24 AM (12 years ago)
Author:
[email protected]
Message:

Pass VM instead of ExecState to JSFunction constructors.
<https://webkit.org/b/122014>

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

JSFunction doesn't need the ExecState for anything during its
construction, so reduce the amount of loads by just passing the
VM around instead.

Factored out putDirectNonIndexAccessor() from the existing
putDirectAccessor() to avoid snowballing the patch (and because
it's kinda neat to avoid the extra branch.)

JSC release binary size -= 9680 bytes.

Source/WebCore:

Updated for new JSFunction::create() signature.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r156402 r156602  
    251251    void addFunction(VM& vm, const char* name, NativeFunction function, unsigned arguments)
    252252    {
    253         Identifier identifier(globalExec(), name);
    254         putDirect(vm, identifier, JSFunction::create(globalExec(), this, arguments, identifier.string(), function));
     253        Identifier identifier(&vm, name);
     254        putDirect(vm, identifier, JSFunction::create(vm, this, arguments, identifier.string(), function));
    255255    }
    256256   
    257257    void addConstructableFunction(VM& vm, const char* name, NativeFunction function, unsigned arguments)
    258258    {
    259         Identifier identifier(globalExec(), name);
    260         putDirect(vm, identifier, JSFunction::create(globalExec(), this, arguments, identifier.string(), function, NoIntrinsic, function));
     259        Identifier identifier(&vm, name);
     260        putDirect(vm, identifier, JSFunction::create(vm, this, arguments, identifier.string(), function, NoIntrinsic, function));
    261261    }
    262262};
Note: See TracChangeset for help on using the changeset viewer.