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/runtime/Arguments.cpp

    r156229 r156602  
    107107        return;
    108108
     109    VM& vm = exec->vm();
    109110    m_overrodeCaller = true;
    110111    PropertyDescriptor descriptor;
    111     descriptor.setAccessorDescriptor(globalObject()->throwTypeErrorGetterSetter(exec), DontEnum | DontDelete | Accessor);
    112     methodTable()->defineOwnProperty(this, exec, exec->propertyNames().caller, descriptor, false);
     112    descriptor.setAccessorDescriptor(globalObject()->throwTypeErrorGetterSetter(vm), DontEnum | DontDelete | Accessor);
     113    methodTable()->defineOwnProperty(this, exec, vm.propertyNames->caller, descriptor, false);
    113114}
    114115
     
    117118    if (m_overrodeCallee)
    118119        return;
    119    
     120
     121    VM& vm = exec->vm();
    120122    m_overrodeCallee = true;
    121123    PropertyDescriptor descriptor;
    122     descriptor.setAccessorDescriptor(globalObject()->throwTypeErrorGetterSetter(exec), DontEnum | DontDelete | Accessor);
    123     methodTable()->defineOwnProperty(this, exec, exec->propertyNames().callee, descriptor, false);
     124    descriptor.setAccessorDescriptor(globalObject()->throwTypeErrorGetterSetter(vm), DontEnum | DontDelete | Accessor);
     125    methodTable()->defineOwnProperty(this, exec, vm.propertyNames->callee, descriptor, false);
    124126}
    125127
Note: See TracChangeset for help on using the changeset viewer.