Changeset 156624 in webkit


Ignore:
Timestamp:
Sep 29, 2013 8:45:30 PM (11 years ago)
Author:
akling@apple.com
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.

Location:
trunk/Source
Files:
52 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.cpp

    r155143 r156624  
    4646const ClassInfo JSCallbackFunction::s_info = { "CallbackFunction", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(JSCallbackFunction) };
    4747
    48 JSCallbackFunction::JSCallbackFunction(JSGlobalObject* globalObject, Structure* structure, JSObjectCallAsFunctionCallback callback)
    49     : InternalFunction(globalObject, structure)
     48JSCallbackFunction::JSCallbackFunction(VM& vm, Structure* structure, JSObjectCallAsFunctionCallback callback)
     49    : InternalFunction(vm, structure)
    5050    , m_callback(callback)
    5151{
     
    5858}
    5959
    60 JSCallbackFunction* JSCallbackFunction::create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const String& name)
     60JSCallbackFunction* JSCallbackFunction::create(VM& vm, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const String& name)
    6161{
    62     JSCallbackFunction* function = new (NotNull, allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, globalObject->callbackFunctionStructure(), callback);
    63     function->finishCreation(exec->vm(), name);
     62    JSCallbackFunction* function = new (NotNull, allocateCell<JSCallbackFunction>(vm.heap)) JSCallbackFunction(vm, globalObject->callbackFunctionStructure(), callback);
     63    function->finishCreation(vm, name);
    6464    return function;
    6565}
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.h

    r154038 r156624  
    3737    typedef InternalFunction Base;
    3838
    39     static JSCallbackFunction* create(ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const String& name);
     39    static JSCallbackFunction* create(VM&, JSGlobalObject*, JSObjectCallAsFunctionCallback, const String& name);
    4040
    4141    DECLARE_INFO;
     
    4949
    5050private:
    51     JSCallbackFunction(JSGlobalObject*, Structure*, JSObjectCallAsFunctionCallback);
     51    JSCallbackFunction(VM&, Structure*, JSObjectCallAsFunctionCallback);
    5252    void finishCreation(VM&, const String& name);
    5353
  • 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                    }
  • trunk/Source/JavaScriptCore/API/JSObjectRef.cpp

    r154459 r156624  
    106106    ExecState* exec = toJS(ctx);
    107107    APIEntryShim entryShim(exec);
    108     return toRef(JSCallbackFunction::create(exec, exec->lexicalGlobalObject(), callAsFunction, name ? name->string() : ASCIILiteral("anonymous")));
     108    return toRef(JSCallbackFunction::create(exec->vm(), exec->lexicalGlobalObject(), callAsFunction, name ? name->string() : ASCIILiteral("anonymous")));
    109109}
    110110
  • trunk/Source/JavaScriptCore/API/ObjCCallbackFunction.h

    r154038 r156624  
    4848    typedef InternalFunction Base;
    4949
    50     static ObjCCallbackFunction* create(ExecState*, JSGlobalObject*, const String& name, PassOwnPtr<ObjCCallbackFunctionImpl>);
     50    static ObjCCallbackFunction* create(VM&, JSGlobalObject*, const String& name, PassOwnPtr<ObjCCallbackFunctionImpl>);
    5151    static void destroy(JSCell*);
    5252
     
    6262
    6363protected:
    64     ObjCCallbackFunction(JSGlobalObject*, JSObjectCallAsFunctionCallback, PassOwnPtr<ObjCCallbackFunctionImpl>);
     64    ObjCCallbackFunction(VM&, JSGlobalObject*, JSObjectCallAsFunctionCallback, PassOwnPtr<ObjCCallbackFunctionImpl>);
    6565
    6666private:
  • trunk/Source/JavaScriptCore/API/ObjCCallbackFunction.mm

    r154647 r156624  
    468468const JSC::ClassInfo ObjCCallbackFunction::s_info = { "CallbackFunction", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(ObjCCallbackFunction) };
    469469
    470 ObjCCallbackFunction::ObjCCallbackFunction(JSC::JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, PassOwnPtr<ObjCCallbackFunctionImpl> impl)
    471     : Base(globalObject, globalObject->objcCallbackFunctionStructure())
     470ObjCCallbackFunction::ObjCCallbackFunction(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, PassOwnPtr<ObjCCallbackFunctionImpl> impl)
     471    : Base(vm, globalObject->objcCallbackFunctionStructure())
    472472    , m_callback(callback)
    473473    , m_impl(impl)
     
    475475}
    476476
    477 ObjCCallbackFunction* ObjCCallbackFunction::create(JSC::ExecState* exec, JSC::JSGlobalObject* globalObject, const String& name, PassOwnPtr<ObjCCallbackFunctionImpl> impl)
    478 {
    479     ObjCCallbackFunction* function = new (NotNull, allocateCell<ObjCCallbackFunction>(*exec->heap())) ObjCCallbackFunction(globalObject, objCCallbackFunctionCallAsFunction, impl);
    480     function->finishCreation(exec->vm(), name);
     477ObjCCallbackFunction* ObjCCallbackFunction::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, const String& name, PassOwnPtr<ObjCCallbackFunctionImpl> impl)
     478{
     479    ObjCCallbackFunction* function = new (NotNull, allocateCell<ObjCCallbackFunction>(vm.heap)) ObjCCallbackFunction(vm, globalObject, objCCallbackFunctionCallAsFunction, impl);
     480    function->finishCreation(vm, name);
    481481    return function;
    482482}
     
    590590    OwnPtr<JSC::ObjCCallbackFunctionImpl> impl = adoptPtr(new JSC::ObjCCallbackFunctionImpl(context, invocation, type, instanceClass, arguments.release(), result.release()));
    591591    // FIXME: Maybe we could support having the selector as the name of the function to make it a bit more user-friendly from the JS side?
    592     return toRef(JSC::ObjCCallbackFunction::create(exec, exec->lexicalGlobalObject(), "", impl.release()));
     592    return toRef(JSC::ObjCCallbackFunction::create(exec->vm(), exec->lexicalGlobalObject(), "", impl.release()));
    593593}
    594594
  • trunk/Source/JavaScriptCore/ChangeLog

    r156621 r156624  
     12013-09-29  Andreas Kling  <akling@apple.com>
     2
     3        Pass VM instead of JSGlobalObject to function constructors.
     4        <https://webkit.org/b/122082>
     5
     6        Reviewed by Darin Adler.
     7
     8        Functions don't need anything from the global object during their
     9        construction and only use it to get to the VM. Reduce loads by
     10        simply passing the VM around instead.
     11
     12        This patch is mostly mechanical, I just changed the signature of
     13        InternalFunction and worked my way from there until it built.
     14
     15        JSC release binary size -= 4840 bytes.
     16
    1172013-09-29  Andreas Kling  <akling@apple.com>
    218
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp

    r156498 r156624  
    5555*/
    5656
    57 ArrayConstructor::ArrayConstructor(JSGlobalObject* globalObject, Structure* structure)
    58     : InternalFunction(globalObject, structure)
     57ArrayConstructor::ArrayConstructor(VM& vm, Structure* structure)
     58    : InternalFunction(vm, structure)
    5959{
    6060}
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h

    r156498 r156624  
    3434    typedef InternalFunction Base;
    3535
    36     static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
     36    static ArrayConstructor* create(VM& vm, Structure* structure, ArrayPrototype* arrayPrototype)
    3737    {
    38         VM& vm = exec->vm();
    39         ArrayConstructor* constructor = new (NotNull, allocateCell<ArrayConstructor>(vm.heap)) ArrayConstructor(globalObject, structure);
     38        ArrayConstructor* constructor = new (NotNull, allocateCell<ArrayConstructor>(vm.heap)) ArrayConstructor(vm, structure);
    4039        constructor->finishCreation(vm, arrayPrototype);
    4140        return constructor;
     
    5453
    5554private:
    56     ArrayConstructor(JSGlobalObject*, Structure*);
     55    ArrayConstructor(VM&, Structure*);
    5756    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5857
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp

    r156498 r156624  
    3232const ClassInfo BooleanConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(BooleanConstructor) };
    3333
    34 BooleanConstructor::BooleanConstructor(JSGlobalObject* globalObject, Structure* structure)
    35     : InternalFunction(globalObject, structure)
     34BooleanConstructor::BooleanConstructor(VM& vm, Structure* structure)
     35    : InternalFunction(vm, structure)
    3636{
    3737}
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h

    r156498 r156624  
    3232    typedef InternalFunction Base;
    3333
    34     static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
     34    static BooleanConstructor* create(VM& vm, Structure* structure, BooleanPrototype* booleanPrototype)
    3535    {
    36         VM& vm = exec->vm();
    37         BooleanConstructor* constructor = new (NotNull, allocateCell<BooleanConstructor>(vm.heap)) BooleanConstructor(globalObject, structure);
     36        BooleanConstructor* constructor = new (NotNull, allocateCell<BooleanConstructor>(vm.heap)) BooleanConstructor(vm, structure);
    3837        constructor->finishCreation(vm, booleanPrototype);
    3938        return constructor;
     
    5150
    5251private:
    53     BooleanConstructor(JSGlobalObject*, Structure*);
     52    BooleanConstructor(VM&, Structure*);
    5453    static ConstructType getConstructData(JSCell*, ConstructData&);
    5554    static CallType getCallData(JSCell*, CallData&);
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp

    r156620 r156624  
    7575STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(DateConstructor);
    7676
    77 DateConstructor::DateConstructor(JSGlobalObject* globalObject, Structure* structure)
    78     : InternalFunction(globalObject, structure)
     77DateConstructor::DateConstructor(VM& vm, Structure* structure)
     78    : InternalFunction(vm, structure)
    7979{
    8080}
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.h

    r156498 r156624  
    3232        typedef InternalFunction Base;
    3333
    34         static DateConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
     34        static DateConstructor* create(VM& vm, Structure* structure, DatePrototype* datePrototype)
    3535        {
    36             DateConstructor* constructor = new (NotNull, allocateCell<DateConstructor>(*exec->heap())) DateConstructor(globalObject, structure);
    37             constructor->finishCreation(exec->vm(), datePrototype);
     36            DateConstructor* constructor = new (NotNull, allocateCell<DateConstructor>(vm.heap)) DateConstructor(vm, structure);
     37            constructor->finishCreation(vm, datePrototype);
    3838            return constructor;
    3939        }
     
    5151
    5252    private:
    53         DateConstructor(JSGlobalObject*, Structure*);
     53        DateConstructor(VM&, Structure*);
    5454        static ConstructType getConstructData(JSCell*, ConstructData&);
    5555        static CallType getCallData(JSCell*, CallData&);
  • trunk/Source/JavaScriptCore/runtime/Error.h

    r154797 r156624  
    7474    class StrictModeTypeErrorFunction : public InternalFunction {
    7575    private:
    76         StrictModeTypeErrorFunction(JSGlobalObject* globalObject, Structure* structure, const String& message)
    77             : InternalFunction(globalObject, structure)
     76        StrictModeTypeErrorFunction(VM& vm, Structure* structure, const String& message)
     77            : InternalFunction(vm, structure)
    7878            , m_message(message)
    7979        {
     
    8585        typedef InternalFunction Base;
    8686
    87         static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const String& message)
     87        static StrictModeTypeErrorFunction* create(VM& vm, Structure* structure, const String& message)
    8888        {
    89             StrictModeTypeErrorFunction* function = new (NotNull, allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);
    90             function->finishCreation(exec->vm(), String());
     89            StrictModeTypeErrorFunction* function = new (NotNull, allocateCell<StrictModeTypeErrorFunction>(vm.heap)) StrictModeTypeErrorFunction(vm, structure, message);
     90            function->finishCreation(vm, String());
    9191            return function;
    9292        }
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.cpp

    r156498 r156624  
    3434const ClassInfo ErrorConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(ErrorConstructor) };
    3535
    36 ErrorConstructor::ErrorConstructor(JSGlobalObject* globalObject, Structure* structure)
    37     : InternalFunction(globalObject, structure)
     36ErrorConstructor::ErrorConstructor(VM& vm, Structure* structure)
     37    : InternalFunction(vm, structure)
    3838{
    3939}
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h

    r156498 r156624  
    3333        typedef InternalFunction Base;
    3434
    35         static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)
     35        static ErrorConstructor* create(VM& vm, Structure* structure, ErrorPrototype* errorPrototype)
    3636        {
    37             VM& vm = exec->vm();
    38             ErrorConstructor* constructor = new (NotNull, allocateCell<ErrorConstructor>(vm.heap)) ErrorConstructor(globalObject, structure);
     37            ErrorConstructor* constructor = new (NotNull, allocateCell<ErrorConstructor>(vm.heap)) ErrorConstructor(vm, structure);
    3938            constructor->finishCreation(vm, errorPrototype);
    4039            return constructor;
     
    5251       
    5352    private:
    54         ErrorConstructor(JSGlobalObject*, Structure*);
     53        ErrorConstructor(VM&, Structure*);
    5554        static ConstructType getConstructData(JSCell*, ConstructData&);
    5655        static CallType getCallData(JSCell*, CallData&);
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp

    r156602 r156624  
    4040const ClassInfo FunctionConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(FunctionConstructor) };
    4141
    42 FunctionConstructor::FunctionConstructor(JSGlobalObject* globalObject, Structure* structure)
    43     : InternalFunction(globalObject, structure)
     42FunctionConstructor::FunctionConstructor(VM& vm, Structure* structure)
     43    : InternalFunction(vm, structure)
    4444{
    4545}
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.h

    r156498 r156624  
    3636        typedef InternalFunction Base;
    3737
    38         static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)
     38        static FunctionConstructor* create(VM& vm, Structure* structure, FunctionPrototype* functionPrototype)
    3939        {
    40             VM& vm = exec->vm();
    41             FunctionConstructor* constructor = new (NotNull, allocateCell<FunctionConstructor>(vm.heap)) FunctionConstructor(globalObject, structure);
     40            FunctionConstructor* constructor = new (NotNull, allocateCell<FunctionConstructor>(vm.heap)) FunctionConstructor(vm, structure);
    4241            constructor->finishCreation(vm, functionPrototype);
    4342            return constructor;
     
    5251
    5352    private:
    54         FunctionConstructor(JSGlobalObject*, Structure*);
     53        FunctionConstructor(VM&, Structure*);
    5554        void finishCreation(VM&, FunctionPrototype*);
    5655        static ConstructType getConstructData(JSCell*, ConstructData&);
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp

    r156602 r156624  
    4343static EncodedJSValue JSC_HOST_CALL functionProtoFuncBind(ExecState*);
    4444
    45 FunctionPrototype::FunctionPrototype(JSGlobalObject* globalObject, Structure* structure)
    46     : InternalFunction(globalObject, structure)
     45FunctionPrototype::FunctionPrototype(VM& vm, Structure* structure)
     46    : InternalFunction(vm, structure)
    4747{
    4848}
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.h

    r156498 r156624  
    3030        typedef InternalFunction Base;
    3131
    32         static FunctionPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     32        static FunctionPrototype* create(VM& vm, Structure* structure)
    3333        {
    34             VM& vm = exec->vm();
    35             FunctionPrototype* prototype = new (NotNull, allocateCell<FunctionPrototype>(vm.heap)) FunctionPrototype(globalObject, structure);
     34            FunctionPrototype* prototype = new (NotNull, allocateCell<FunctionPrototype>(vm.heap)) FunctionPrototype(vm, structure);
    3635            prototype->finishCreation(vm, String());
    3736            return prototype;
     
    5150
    5251    private:
    53         FunctionPrototype(JSGlobalObject*, Structure*);
     52        FunctionPrototype(VM&, Structure*);
    5453        static CallType getCallData(JSCell*, CallData&);
    5554    };
  • trunk/Source/JavaScriptCore/runtime/InternalFunction.cpp

    r155143 r156624  
    3535const ClassInfo InternalFunction::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(InternalFunction) };
    3636
    37 InternalFunction::InternalFunction(JSGlobalObject* globalObject, Structure* structure)
    38     : JSDestructibleObject(globalObject->vm(), structure)
     37InternalFunction::InternalFunction(VM& vm, Structure* structure)
     38    : JSDestructibleObject(vm, structure)
    3939{
    4040}
  • trunk/Source/JavaScriptCore/runtime/InternalFunction.h

    r154038 r156624  
    5050        static const unsigned StructureFlags = ImplementsHasInstance | JSObject::StructureFlags;
    5151
    52         JS_EXPORT_PRIVATE InternalFunction(JSGlobalObject*, Structure*);
     52        JS_EXPORT_PRIVATE InternalFunction(VM&, Structure*);
    5353
    5454        JS_EXPORT_PRIVATE void finishCreation(VM&, const String& name);
  • trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.cpp

    r156240 r156624  
    4141};
    4242
    43 JSArrayBufferConstructor::JSArrayBufferConstructor(
    44     JSGlobalObject* globalObject, Structure* structure)
    45     : Base(globalObject, structure)
     43JSArrayBufferConstructor::JSArrayBufferConstructor(VM& vm, Structure* structure)
     44    : Base(vm, structure)
    4645{
    4746}
     
    5453}
    5554
    56 JSArrayBufferConstructor* JSArrayBufferConstructor::create(CallFrame* callFrame, JSGlobalObject* globalObject, Structure* structure, JSArrayBufferPrototype* prototype)
     55JSArrayBufferConstructor* JSArrayBufferConstructor::create(VM& vm, Structure* structure, JSArrayBufferPrototype* prototype)
    5756{
    58     VM& vm = callFrame->vm();
    5957    JSArrayBufferConstructor* result =
    6058        new (NotNull, allocateCell<JSArrayBufferConstructor>(vm.heap))
    61         JSArrayBufferConstructor(globalObject, structure);
     59        JSArrayBufferConstructor(vm, structure);
    6260    result->finishCreation(vm, prototype);
    6361    return result;
  • trunk/Source/JavaScriptCore/runtime/JSArrayBufferConstructor.h

    r155177 r156624  
    3838
    3939protected:
    40     JSArrayBufferConstructor(JSGlobalObject*, Structure*);
     40    JSArrayBufferConstructor(VM&, Structure*);
    4141    void finishCreation(VM&, JSArrayBufferPrototype*);
    4242
    4343public:
    44     static JSArrayBufferConstructor* create(CallFrame*, JSGlobalObject*, Structure*, JSArrayBufferPrototype*);
     44    static JSArrayBufferConstructor* create(VM&, Structure*, JSArrayBufferPrototype*);
    4545   
    4646    DECLARE_INFO;
  • trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h

    r154127 r156624  
    3737
    3838protected:
    39     JSGenericTypedArrayViewConstructor(JSGlobalObject*, Structure*);
     39    JSGenericTypedArrayViewConstructor(VM&, Structure*);
    4040    void finishCreation(VM&, JSObject* prototype, const String& name);
    4141
    4242public:
    4343    static JSGenericTypedArrayViewConstructor* create(
    44         JSGlobalObject*, Structure*, JSObject* prototype, const String& name);
    45    
     44        VM&, Structure*, JSObject* prototype, const String& name);
     45
    4646    DECLARE_INFO;
    4747   
  • trunk/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructorInlines.h

    r156240 r156624  
    3535
    3636template<typename ViewClass>
    37 JSGenericTypedArrayViewConstructor<ViewClass>::JSGenericTypedArrayViewConstructor(JSGlobalObject* globalObject, Structure* structure)
    38     : Base(globalObject, structure)
     37JSGenericTypedArrayViewConstructor<ViewClass>::JSGenericTypedArrayViewConstructor(VM& vm, Structure* structure)
     38    : Base(vm, structure)
    3939{
    4040}
     
    5252JSGenericTypedArrayViewConstructor<ViewClass>*
    5353JSGenericTypedArrayViewConstructor<ViewClass>::create(
    54     JSGlobalObject* globalObject, Structure* structure, JSObject* prototype,
     54    VM& vm, Structure* structure, JSObject* prototype,
    5555    const String& name)
    5656{
    57     VM& vm = globalObject->vm();
    5857    JSGenericTypedArrayViewConstructor* result =
    5958        new (NotNull, allocateCell<JSGenericTypedArrayViewConstructor>(vm.heap))
    60         JSGenericTypedArrayViewConstructor(globalObject, structure);
     59        JSGenericTypedArrayViewConstructor(vm, structure);
    6160    result->finishCreation(vm, prototype, name);
    6261    return result;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r156621 r156624  
    229229    VM& vm = exec->vm();
    230230
    231     m_functionPrototype.set(vm, this, FunctionPrototype::create(exec, this, FunctionPrototype::createStructure(vm, this, jsNull()))); // The real prototype will be set once ObjectPrototype is created.
     231    m_functionPrototype.set(vm, this, FunctionPrototype::create(vm, FunctionPrototype::createStructure(vm, this, jsNull()))); // The real prototype will be set once ObjectPrototype is created.
    232232    m_functionStructure.set(vm, this, JSFunction::createStructure(vm, this, m_functionPrototype.get()));
    233233    m_boundFunctionStructure.set(vm, this, JSBoundFunction::createStructure(vm, this, m_functionPrototype.get()));
     
    322322    // Constructors
    323323
    324     JSCell* objectConstructor = ObjectConstructor::create(exec, this, ObjectConstructor::createStructure(vm, this, m_functionPrototype.get()), m_objectPrototype.get());
    325     JSCell* functionConstructor = FunctionConstructor::create(exec, this, FunctionConstructor::createStructure(vm, this, m_functionPrototype.get()), m_functionPrototype.get());
    326     JSCell* arrayConstructor = ArrayConstructor::create(exec, this, ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_arrayPrototype.get());
     324    JSCell* objectConstructor = ObjectConstructor::create(vm, ObjectConstructor::createStructure(vm, this, m_functionPrototype.get()), m_objectPrototype.get());
     325    JSCell* functionConstructor = FunctionConstructor::create(vm, FunctionConstructor::createStructure(vm, this, m_functionPrototype.get()), m_functionPrototype.get());
     326    JSCell* arrayConstructor = ArrayConstructor::create(vm, ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_arrayPrototype.get());
    327327
    328328#if ENABLE(PROMISES)
    329     JSCell* promiseConstructor = JSPromiseConstructor::create(exec, this, JSPromiseConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promisePrototype.get());
    330     JSCell* promiseResolverConstructor = JSPromiseResolverConstructor::create(exec, this, JSPromiseResolverConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promiseResolverPrototype.get());
     329    JSCell* promiseConstructor = JSPromiseConstructor::create(vm, JSPromiseConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promisePrototype.get());
     330    JSCell* promiseResolverConstructor = JSPromiseResolverConstructor::create(vm, JSPromiseResolverConstructor::createStructure(vm, this, m_functionPrototype.get()), m_promiseResolverPrototype.get());
    331331#endif // ENABLE(PROMISES)
    332332
    333     m_regExpConstructor.set(vm, this, RegExpConstructor::create(exec, this, RegExpConstructor::createStructure(vm, this, m_functionPrototype.get()), m_regExpPrototype.get()));
     333    m_regExpConstructor.set(vm, this, RegExpConstructor::create(vm, RegExpConstructor::createStructure(vm, this, m_functionPrototype.get()), m_regExpPrototype.get()));
    334334
    335335#define CREATE_CONSTRUCTOR_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
    336     capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(exec, this, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get()); \
     336    capitalName ## Constructor* lowerName ## Constructor = capitalName ## Constructor::create(vm, capitalName ## Constructor::createStructure(vm, this, m_functionPrototype.get()), m_ ## lowerName ## Prototype.get()); \
    337337    m_ ## lowerName ## Prototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, lowerName ## Constructor, DontEnum); \
    338338
     
    392392   
    393393    FixedArray<InternalFunction*, NUMBER_OF_TYPED_ARRAY_TYPES> typedArrayConstructors;
    394     typedArrayConstructors[toIndex(TypeInt8)] = JSInt8ArrayConstructor::create(this, JSInt8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt8)].prototype.get(), "Int8Array");
    395     typedArrayConstructors[toIndex(TypeInt16)] = JSInt16ArrayConstructor::create(this, JSInt16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt16)].prototype.get(), "Int16Array");
    396     typedArrayConstructors[toIndex(TypeInt32)] = JSInt32ArrayConstructor::create(this, JSInt32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt32)].prototype.get(), "Int32Array");
    397     typedArrayConstructors[toIndex(TypeUint8)] = JSUint8ArrayConstructor::create(this, JSUint8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8)].prototype.get(), "Uint8Array");
    398     typedArrayConstructors[toIndex(TypeUint8Clamped)] = JSUint8ClampedArrayConstructor::create(this, JSUint8ClampedArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8Clamped)].prototype.get(), "Uint8ClampedArray");
    399     typedArrayConstructors[toIndex(TypeUint16)] = JSUint16ArrayConstructor::create(this, JSUint16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint16)].prototype.get(), "Uint16Array");
    400     typedArrayConstructors[toIndex(TypeUint32)] = JSUint32ArrayConstructor::create(this, JSUint32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint32)].prototype.get(), "Uint32Array");
    401     typedArrayConstructors[toIndex(TypeFloat32)] = JSFloat32ArrayConstructor::create(this, JSFloat32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat32)].prototype.get(), "Float32Array");
    402     typedArrayConstructors[toIndex(TypeFloat64)] = JSFloat64ArrayConstructor::create(this, JSFloat64ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat64)].prototype.get(), "Float64Array");
    403     typedArrayConstructors[toIndex(TypeDataView)] = JSDataViewConstructor::create(this, JSDataViewConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeDataView)].prototype.get(), "DataView");
     394    typedArrayConstructors[toIndex(TypeInt8)] = JSInt8ArrayConstructor::create(vm, JSInt8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt8)].prototype.get(), "Int8Array");
     395    typedArrayConstructors[toIndex(TypeInt16)] = JSInt16ArrayConstructor::create(vm, JSInt16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt16)].prototype.get(), "Int16Array");
     396    typedArrayConstructors[toIndex(TypeInt32)] = JSInt32ArrayConstructor::create(vm, JSInt32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeInt32)].prototype.get(), "Int32Array");
     397    typedArrayConstructors[toIndex(TypeUint8)] = JSUint8ArrayConstructor::create(vm, JSUint8ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8)].prototype.get(), "Uint8Array");
     398    typedArrayConstructors[toIndex(TypeUint8Clamped)] = JSUint8ClampedArrayConstructor::create(vm, JSUint8ClampedArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint8Clamped)].prototype.get(), "Uint8ClampedArray");
     399    typedArrayConstructors[toIndex(TypeUint16)] = JSUint16ArrayConstructor::create(vm, JSUint16ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint16)].prototype.get(), "Uint16Array");
     400    typedArrayConstructors[toIndex(TypeUint32)] = JSUint32ArrayConstructor::create(vm, JSUint32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeUint32)].prototype.get(), "Uint32Array");
     401    typedArrayConstructors[toIndex(TypeFloat32)] = JSFloat32ArrayConstructor::create(vm, JSFloat32ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat32)].prototype.get(), "Float32Array");
     402    typedArrayConstructors[toIndex(TypeFloat64)] = JSFloat64ArrayConstructor::create(vm, JSFloat64ArrayConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeFloat64)].prototype.get(), "Float64Array");
     403    typedArrayConstructors[toIndex(TypeDataView)] = JSDataViewConstructor::create(vm, JSDataViewConstructor::createStructure(vm, this, m_functionPrototype.get()), m_typedArrays[toIndex(TypeDataView)].prototype.get(), "DataView");
    404404
    405405    for (unsigned typedArrayIndex = NUMBER_OF_TYPED_ARRAY_TYPES; typedArrayIndex--;) {
     
    424424        m_privateNameStructure.set(vm, this, NameInstance::createStructure(vm, this, privateNamePrototype));
    425425
    426         JSCell* privateNameConstructor = NameConstructor::create(exec, this, NameConstructor::createStructure(vm, this, m_functionPrototype.get()), privateNamePrototype);
     426        JSCell* privateNameConstructor = NameConstructor::create(vm, NameConstructor::createStructure(vm, this, m_functionPrototype.get()), privateNamePrototype);
    427427        privateNamePrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, privateNameConstructor, DontEnum);
    428428        putDirectWithoutTransition(vm, Identifier(exec, "Name"), privateNameConstructor, DontEnum);
  • trunk/Source/JavaScriptCore/runtime/JSPromiseCallback.cpp

    r154847 r156624  
    4040const ClassInfo JSPromiseCallback::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSPromiseCallback) };
    4141
    42 JSPromiseCallback* JSPromiseCallback::create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSPromiseResolver* resolver, Algorithm algorithm)
     42JSPromiseCallback* JSPromiseCallback::create(VM& vm, Structure* structure, JSPromiseResolver* resolver, Algorithm algorithm)
    4343{
    44     JSPromiseCallback* constructor = new (NotNull, allocateCell<JSPromiseCallback>(*exec->heap())) JSPromiseCallback(globalObject, structure, algorithm);
    45     constructor->finishCreation(exec, resolver);
     44    JSPromiseCallback* constructor = new (NotNull, allocateCell<JSPromiseCallback>(vm.heap)) JSPromiseCallback(vm, structure, algorithm);
     45    constructor->finishCreation(vm, resolver);
    4646    return constructor;
    4747}
     
    5252}
    5353
    54 JSPromiseCallback::JSPromiseCallback(JSGlobalObject* globalObject, Structure* structure, Algorithm algorithm)
    55     : InternalFunction(globalObject, structure)
     54JSPromiseCallback::JSPromiseCallback(VM& vm, Structure* structure, Algorithm algorithm)
     55    : InternalFunction(vm, structure)
    5656    , m_algorithm(algorithm)
    5757{
    5858}
    5959
    60 void JSPromiseCallback::finishCreation(ExecState* exec, JSPromiseResolver* resolver)
     60void JSPromiseCallback::finishCreation(VM& vm, JSPromiseResolver* resolver)
    6161{
    62     Base::finishCreation(exec->vm(), "PromiseCallback");
    63     m_resolver.set(exec->vm(), this, resolver);
     62    Base::finishCreation(vm, "PromiseCallback");
     63    m_resolver.set(vm, this, resolver);
    6464}
    6565
     
    113113const ClassInfo JSPromiseWrapperCallback::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSPromiseWrapperCallback) };
    114114
    115 JSPromiseWrapperCallback* JSPromiseWrapperCallback::create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSPromiseResolver* resolver, JSValue callback)
     115JSPromiseWrapperCallback* JSPromiseWrapperCallback::create(VM& vm, Structure* structure, JSPromiseResolver* resolver, JSValue callback)
    116116{
    117     JSPromiseWrapperCallback* constructor = new (NotNull, allocateCell<JSPromiseWrapperCallback>(*exec->heap())) JSPromiseWrapperCallback(globalObject, structure);
    118     constructor->finishCreation(exec, resolver, callback);
     117    JSPromiseWrapperCallback* constructor = new (NotNull, allocateCell<JSPromiseWrapperCallback>(vm.heap)) JSPromiseWrapperCallback(vm, structure);
     118    constructor->finishCreation(vm, resolver, callback);
    119119    return constructor;
    120120}
     
    125125}
    126126
    127 JSPromiseWrapperCallback::JSPromiseWrapperCallback(JSGlobalObject* globalObject, Structure* structure)
    128     : InternalFunction(globalObject, structure)
     127JSPromiseWrapperCallback::JSPromiseWrapperCallback(VM& vm, Structure* structure)
     128    : InternalFunction(vm, structure)
    129129{
    130130}
    131131
    132 void JSPromiseWrapperCallback::finishCreation(ExecState* exec, JSPromiseResolver* resolver, JSValue callback)
     132void JSPromiseWrapperCallback::finishCreation(VM& vm, JSPromiseResolver* resolver, JSValue callback)
    133133{
    134     Base::finishCreation(exec->vm(), "PromiseWrapperCallback");
    135     m_resolver.set(exec->vm(), this, resolver);
    136     m_callback.set(exec->vm(), this, callback);
     134    Base::finishCreation(vm, "PromiseWrapperCallback");
     135    m_resolver.set(vm, this, resolver);
     136    m_callback.set(vm, this, callback);
    137137}
    138138
  • trunk/Source/JavaScriptCore/runtime/JSPromiseCallback.h

    r154847 r156624  
    4545    };
    4646
    47     static JSPromiseCallback* create(ExecState*, JSGlobalObject*, Structure*, JSPromiseResolver*, Algorithm);
     47    static JSPromiseCallback* create(VM&, Structure*, JSPromiseResolver*, Algorithm);
    4848    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
    4949
     
    5151
    5252private:
    53     JSPromiseCallback(JSGlobalObject*, Structure*, Algorithm);
    54     void finishCreation(ExecState*, JSPromiseResolver*);
     53    JSPromiseCallback(VM&, Structure*, Algorithm);
     54    void finishCreation(VM&, JSPromiseResolver*);
    5555    static const unsigned StructureFlags = OverridesVisitChildren | JSObject::StructureFlags;
    5656
     
    6868    typedef InternalFunction Base;
    6969
    70     static JSPromiseWrapperCallback* create(ExecState*, JSGlobalObject*, Structure*, JSPromiseResolver*, JSValue callback);
     70    static JSPromiseWrapperCallback* create(VM&, Structure*, JSPromiseResolver*, JSValue callback);
    7171    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
    7272
     
    7474
    7575private:
    76     JSPromiseWrapperCallback(JSGlobalObject*, Structure*);
    77     void finishCreation(ExecState*, JSPromiseResolver*, JSValue callback);
     76    JSPromiseWrapperCallback(VM&, Structure*);
     77    void finishCreation(VM&, JSPromiseResolver*, JSValue callback);
    7878    static const unsigned StructureFlags = OverridesVisitChildren | JSObject::StructureFlags;
    7979
  • trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.cpp

    r156498 r156624  
    6666*/
    6767
    68 JSPromiseConstructor* JSPromiseConstructor::create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSPromisePrototype* promisePrototype)
     68JSPromiseConstructor* JSPromiseConstructor::create(VM& vm, Structure* structure, JSPromisePrototype* promisePrototype)
    6969{
    70     VM& vm = exec->vm();
    71     JSPromiseConstructor* constructor = new (NotNull, allocateCell<JSPromiseConstructor>(vm.heap)) JSPromiseConstructor(globalObject, structure);
     70    JSPromiseConstructor* constructor = new (NotNull, allocateCell<JSPromiseConstructor>(vm.heap)) JSPromiseConstructor(vm, structure);
    7271    constructor->finishCreation(vm, promisePrototype);
    7372    return constructor;
     
    7978}
    8079
    81 JSPromiseConstructor::JSPromiseConstructor(JSGlobalObject* globalObject, Structure* structure)
    82     : InternalFunction(globalObject, structure)
     80JSPromiseConstructor::JSPromiseConstructor(VM& vm, Structure* structure)
     81    : InternalFunction(vm, structure)
    8382{
    8483}
  • trunk/Source/JavaScriptCore/runtime/JSPromiseConstructor.h

    r156498 r156624  
    3939    typedef InternalFunction Base;
    4040
    41     static JSPromiseConstructor* create(ExecState*, JSGlobalObject*, Structure*, JSPromisePrototype*);
     41    static JSPromiseConstructor* create(VM&, Structure*, JSPromisePrototype*);
    4242    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
    4343
     
    4949
    5050private:
    51     JSPromiseConstructor(JSGlobalObject*, Structure*);
     51    JSPromiseConstructor(VM&, Structure*);
    5252    static ConstructType getConstructData(JSCell*, ConstructData&);
    5353    static CallType getCallData(JSCell*, CallData&);
  • trunk/Source/JavaScriptCore/runtime/JSPromisePrototype.cpp

    r156498 r156624  
    9393{
    9494    if (!callback.isUndefined())
    95         return JSPromiseWrapperCallback::create(exec, globalObject, globalObject->promiseWrapperCallbackStructure(), resolver, callback);
    96     return JSPromiseCallback::create(exec, globalObject, globalObject->promiseCallbackStructure(), resolver, algorithm);
     95        return JSPromiseWrapperCallback::create(exec->vm(), globalObject->promiseWrapperCallbackStructure(), resolver, callback);
     96    return JSPromiseCallback::create(exec->vm(), globalObject->promiseCallbackStructure(), resolver, algorithm);
    9797}
    9898
     
    159159    JSFunction* callee = jsCast<JSFunction*>(exec->callee());
    160160    JSGlobalObject* globalObject = callee->globalObject();
     161    VM& vm = exec->vm();
    161162
    162163    // 1. Let promise be a new promise.
    163     JSPromise* promise = JSPromise::createWithResolver(exec->vm(), globalObject);
     164    JSPromise* promise = JSPromise::createWithResolver(vm, globalObject);
    164165
    165166    // 2. Let resolver be promise's associated resolver.
     
    167168
    168169    // 3. Let fulfillCallback be a new promise callback for resolver and its fulfill algorithm.
    169     InternalFunction* fulfillWrapper = JSPromiseCallback::create(exec, globalObject, globalObject->promiseCallbackStructure(), resolver, JSPromiseCallback::Fulfill);
     170    InternalFunction* fulfillWrapper = JSPromiseCallback::create(vm, globalObject->promiseCallbackStructure(), resolver, JSPromiseCallback::Fulfill);
    170171
    171172    // 4. Let rejectWrapper be a promise wrapper callback for resolver and rejectCallback if rejectCallback is
  • trunk/Source/JavaScriptCore/runtime/JSPromiseResolver.cpp

    r154847 r156624  
    149149        CallType callType = JSC::getCallData(then, callData);
    150150        if (callType != CallTypeNone) {
     151            VM& vm = exec->vm();
    151152            // 4.1. Let fulfillCallback be a promise callback for the context object and its resolve algorithm.
    152             JSPromiseCallback* fulfillCallback = JSPromiseCallback::create(exec, globalObject(), globalObject()->promiseCallbackStructure(), this, JSPromiseCallback::Resolve);
     153            JSPromiseCallback* fulfillCallback = JSPromiseCallback::create(vm, globalObject()->promiseCallbackStructure(), this, JSPromiseCallback::Resolve);
    153154
    154155            // 4.2. Let rejectCallback be a promise callback for the context object and its reject algorithm.
    155             JSPromiseCallback* rejectCallback = JSPromiseCallback::create(exec, globalObject(), globalObject()->promiseCallbackStructure(), this, JSPromiseCallback::Reject);
     156            JSPromiseCallback* rejectCallback = JSPromiseCallback::create(vm, globalObject()->promiseCallbackStructure(), this, JSPromiseCallback::Reject);
    156157           
    157158            // 4.3. Call the JavaScript [[Call]] internal method of then with this value value and fulfillCallback
  • trunk/Source/JavaScriptCore/runtime/JSPromiseResolverConstructor.cpp

    r156498 r156624  
    4141const ClassInfo JSPromiseResolverConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSPromiseResolverConstructor) };
    4242
    43 JSPromiseResolverConstructor* JSPromiseResolverConstructor::create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSPromiseResolverPrototype* promisePrototype)
     43JSPromiseResolverConstructor* JSPromiseResolverConstructor::create(VM& vm, Structure* structure, JSPromiseResolverPrototype* promisePrototype)
    4444{
    45     VM& vm = exec->vm();
    46     JSPromiseResolverConstructor* constructor = new (NotNull, allocateCell<JSPromiseResolverConstructor>(vm.heap)) JSPromiseResolverConstructor(globalObject, structure);
     45    JSPromiseResolverConstructor* constructor = new (NotNull, allocateCell<JSPromiseResolverConstructor>(vm.heap)) JSPromiseResolverConstructor(vm, structure);
    4746    constructor->finishCreation(vm, promisePrototype);
    4847    return constructor;
     
    5453}
    5554
    56 JSPromiseResolverConstructor::JSPromiseResolverConstructor(JSGlobalObject* globalObject, Structure* structure)
    57     : InternalFunction(globalObject, structure)
     55JSPromiseResolverConstructor::JSPromiseResolverConstructor(VM& vm, Structure* structure)
     56    : InternalFunction(vm, structure)
    5857{
    5958}
  • trunk/Source/JavaScriptCore/runtime/JSPromiseResolverConstructor.h

    r156498 r156624  
    3939    typedef InternalFunction Base;
    4040
    41     static JSPromiseResolverConstructor* create(ExecState*, JSGlobalObject*, Structure*, JSPromiseResolverPrototype*);
     41    static JSPromiseResolverConstructor* create(VM&, Structure*, JSPromiseResolverPrototype*);
    4242    static Structure* createStructure(VM&, JSGlobalObject*, JSValue);
    4343
     
    4949
    5050private:
    51     JSPromiseResolverConstructor(JSGlobalObject*, Structure*);
     51    JSPromiseResolverConstructor(VM&, Structure*);
    5252    static ConstructType getConstructData(JSCell*, ConstructData&);
    5353    static CallType getCallData(JSCell*, CallData&);
  • trunk/Source/JavaScriptCore/runtime/MapConstructor.h

    r156498 r156624  
    3737    typedef InternalFunction Base;
    3838
    39     static MapConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, MapPrototype* mapPrototype)
     39    static MapConstructor* create(VM& vm, Structure* structure, MapPrototype* mapPrototype)
    4040    {
    41         VM& vm = exec->vm();
    42         MapConstructor* constructor = new (NotNull, allocateCell<MapConstructor>(vm.heap)) MapConstructor(globalObject, structure);
     41        MapConstructor* constructor = new (NotNull, allocateCell<MapConstructor>(vm.heap)) MapConstructor(vm, structure);
    4342        constructor->finishCreation(vm, mapPrototype);
    4443        return constructor;
     
    5352
    5453private:
    55     MapConstructor(JSGlobalObject* globalObject, Structure* structure)
    56         : Base(globalObject, structure)
     54    MapConstructor(VM& vm, Structure* structure)
     55        : Base(vm, structure)
    5756    {
    5857    }
  • trunk/Source/JavaScriptCore/runtime/NameConstructor.cpp

    r156498 r156624  
    3737const ClassInfo NameConstructor::s_info = { "Function", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(NameConstructor) };
    3838
    39 NameConstructor::NameConstructor(JSGlobalObject* globalObject, Structure* structure)
    40     : InternalFunction(globalObject, structure)
     39NameConstructor::NameConstructor(VM& vm, Structure* structure)
     40    : InternalFunction(vm, structure)
    4141{
    4242}
  • trunk/Source/JavaScriptCore/runtime/NameConstructor.h

    r156498 r156624  
    3838    typedef InternalFunction Base;
    3939
    40     static NameConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NamePrototype* prototype)
     40    static NameConstructor* create(VM& vm, Structure* structure, NamePrototype* prototype)
    4141    {
    42         VM& vm = exec->vm();
    43         NameConstructor* constructor = new (NotNull, allocateCell<NameConstructor>(vm.heap)) NameConstructor(globalObject, structure);
     42        NameConstructor* constructor = new (NotNull, allocateCell<NameConstructor>(vm.heap)) NameConstructor(vm, structure);
    4443        constructor->finishCreation(vm, prototype);
    4544        return constructor;
     
    5756   
    5857private:
    59     NameConstructor(JSGlobalObject*, Structure*);
     58    NameConstructor(VM&, Structure*);
    6059    static ConstructType getConstructData(JSCell*, ConstructData&);
    6160    static CallType getCallData(JSCell*, CallData&);
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp

    r156240 r156624  
    3434const ClassInfo NativeErrorConstructor::s_info = { "Function", &InternalFunction::s_info, 0, 0, CREATE_METHOD_TABLE(NativeErrorConstructor) };
    3535
    36 NativeErrorConstructor::NativeErrorConstructor(JSGlobalObject* globalObject, Structure* structure)
    37     : InternalFunction(globalObject, structure)
     36NativeErrorConstructor::NativeErrorConstructor(VM& vm, Structure* structure)
     37    : InternalFunction(vm, structure)
    3838{
    3939}
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h

    r156620 r156624  
    3737        static NativeErrorConstructor* create(VM& vm, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const String& name)
    3838        {
    39             NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(vm.heap)) NativeErrorConstructor(globalObject, structure);
     39            NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(vm.heap)) NativeErrorConstructor(vm, structure);
    4040            constructor->finishCreation(vm, globalObject, prototypeStructure, name);
    4141            return constructor;
     
    6767
    6868    private:
    69         NativeErrorConstructor(JSGlobalObject*, Structure*);
     69        NativeErrorConstructor(VM&, Structure*);
    7070        static const unsigned StructureFlags = OverridesVisitChildren | InternalFunction::StructureFlags;
    7171        static ConstructType getConstructData(JSCell*, ConstructData&);
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r156498 r156624  
    5656*/
    5757
    58 NumberConstructor::NumberConstructor(JSGlobalObject* globalObject, Structure* structure)
    59     : InternalFunction(globalObject, structure)
     58NumberConstructor::NumberConstructor(VM& vm, Structure* structure)
     59    : InternalFunction(vm, structure)
    6060{
    6161}
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.h

    r156498 r156624  
    3232        typedef InternalFunction Base;
    3333
    34         static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype)
     34        static NumberConstructor* create(VM& vm, Structure* structure, NumberPrototype* numberPrototype)
    3535        {
    36             VM& vm = exec->vm();
    37             NumberConstructor* constructor = new (NotNull, allocateCell<NumberConstructor>(vm.heap)) NumberConstructor(globalObject, structure);
     36            NumberConstructor* constructor = new (NotNull, allocateCell<NumberConstructor>(vm.heap)) NumberConstructor(vm, structure);
    3837            constructor->finishCreation(vm, numberPrototype);
    3938            return constructor;
     
    5958
    6059    private:
    61         NumberConstructor(JSGlobalObject*, Structure*);
     60        NumberConstructor(VM&, Structure*);
    6261        static ConstructType getConstructData(JSCell*, ConstructData&);
    6362        static CallType getCallData(JSCell*, CallData&);
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.cpp

    r156498 r156624  
    8181*/
    8282
    83 ObjectConstructor::ObjectConstructor(JSGlobalObject* globalObject, Structure* structure)
    84     : InternalFunction(globalObject, structure)
     83ObjectConstructor::ObjectConstructor(VM& vm, Structure* structure)
     84    : InternalFunction(vm, structure)
    8585{
    8686}
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h

    r156498 r156624  
    3434        typedef InternalFunction Base;
    3535
    36         static ObjectConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objectPrototype)
     36        static ObjectConstructor* create(VM& vm, Structure* structure, ObjectPrototype* objectPrototype)
    3737        {
    38             VM& vm = exec->vm();
    39             ObjectConstructor* constructor = new (NotNull, allocateCell<ObjectConstructor>(vm.heap)) ObjectConstructor(globalObject, structure);
     38            ObjectConstructor* constructor = new (NotNull, allocateCell<ObjectConstructor>(vm.heap)) ObjectConstructor(vm, structure);
    4039            constructor->finishCreation(vm, objectPrototype);
    4140            return constructor;
     
    5655
    5756    private:
    58         ObjectConstructor(JSGlobalObject*, Structure*);
     57        ObjectConstructor(VM&, Structure*);
    5958        static ConstructType getConstructData(JSCell*, ConstructData&);
    6059        static CallType getCallData(JSCell*, CallData&);
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp

    r156498 r156624  
    8383*/
    8484
    85 RegExpConstructor::RegExpConstructor(JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)
    86     : InternalFunction(globalObject, structure)
    87     , m_cachedResult(globalObject->vm(), this, regExpPrototype->regExp())
     85RegExpConstructor::RegExpConstructor(VM& vm, Structure* structure, RegExpPrototype* regExpPrototype)
     86    : InternalFunction(vm, structure)
     87    , m_cachedResult(vm, this, regExpPrototype->regExp())
    8888    , m_multiline(false)
    8989{
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h

    r156498 r156624  
    3737        typedef InternalFunction Base;
    3838
    39         static RegExpConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)
     39        static RegExpConstructor* create(VM& vm, Structure* structure, RegExpPrototype* regExpPrototype)
    4040        {
    41             VM& vm = exec->vm();
    42             RegExpConstructor* constructor = new (NotNull, allocateCell<RegExpConstructor>(vm.heap)) RegExpConstructor(globalObject, structure, regExpPrototype);
     41            RegExpConstructor* constructor = new (NotNull, allocateCell<RegExpConstructor>(vm.heap)) RegExpConstructor(vm, structure, regExpPrototype);
    4342            constructor->finishCreation(vm, regExpPrototype);
    4443            return constructor;
     
    7776
    7877    private:
    79         RegExpConstructor(JSGlobalObject*, Structure*, RegExpPrototype*);
     78        RegExpConstructor(VM&, Structure*, RegExpPrototype*);
    8079        static void destroy(JSCell*);
    8180        static ConstructType getConstructData(JSCell*, ConstructData&);
  • trunk/Source/JavaScriptCore/runtime/SetConstructor.h

    r156498 r156624  
    3737    typedef InternalFunction Base;
    3838
    39     static SetConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, SetPrototype* setPrototype)
     39    static SetConstructor* create(VM& vm, Structure* structure, SetPrototype* setPrototype)
    4040    {
    41         VM& vm = exec->vm();
    42         SetConstructor* constructor = new (NotNull, allocateCell<SetConstructor>(vm.heap)) SetConstructor(globalObject, structure);
     41        SetConstructor* constructor = new (NotNull, allocateCell<SetConstructor>(vm.heap)) SetConstructor(vm, structure);
    4342        constructor->finishCreation(vm, setPrototype);
    4443        return constructor;
     
    5352
    5453private:
    55     SetConstructor(JSGlobalObject* globalObject, Structure* structure)
    56         : Base(globalObject, structure)
     54    SetConstructor(VM& vm, Structure* structure)
     55        : Base(vm, structure)
    5756    {
    5857    }
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp

    r156498 r156624  
    4949STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(StringConstructor);
    5050
    51 StringConstructor::StringConstructor(JSGlobalObject* globalObject, Structure* structure)
    52     : InternalFunction(globalObject, structure)
     51StringConstructor::StringConstructor(VM& vm, Structure* structure)
     52    : InternalFunction(vm, structure)
    5353{
    5454}
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.h

    r156498 r156624  
    3232        typedef InternalFunction Base;
    3333
    34         static StringConstructor* create(ExecState* exec, JSGlobalObject* globalObject , Structure* structure, StringPrototype* stringPrototype)
     34        static StringConstructor* create(VM& vm, Structure* structure, StringPrototype* stringPrototype)
    3535        {
    36             VM& vm = exec->vm();
    37             StringConstructor* constructor = new (NotNull, allocateCell<StringConstructor>(vm.heap)) StringConstructor(globalObject, structure);
     36            StringConstructor* constructor = new (NotNull, allocateCell<StringConstructor>(vm.heap)) StringConstructor(vm, structure);
    3837            constructor->finishCreation(vm, stringPrototype);
    3938            return constructor;
     
    5150
    5251    private:
    53         StringConstructor(JSGlobalObject*, Structure*);
     52        StringConstructor(VM&, Structure*);
    5453        void finishCreation(VM&, StringPrototype*);
    5554        static ConstructType getConstructData(JSCell*, ConstructData&);
  • trunk/Source/JavaScriptCore/runtime/WeakMapConstructor.h

    r156498 r156624  
    3737    typedef InternalFunction Base;
    3838
    39     static WeakMapConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, WeakMapPrototype* prototype)
     39    static WeakMapConstructor* create(VM& vm, Structure* structure, WeakMapPrototype* prototype)
    4040    {
    41         VM& vm = exec->vm();
    42         WeakMapConstructor* constructor = new (NotNull, allocateCell<WeakMapConstructor>(vm.heap)) WeakMapConstructor(globalObject, structure);
     41        WeakMapConstructor* constructor = new (NotNull, allocateCell<WeakMapConstructor>(vm.heap)) WeakMapConstructor(vm, structure);
    4342        constructor->finishCreation(vm, prototype);
    4443        return constructor;
     
    5352
    5453private:
    55     WeakMapConstructor(JSGlobalObject* globalObject, Structure* structure)
    56         : Base(globalObject, structure)
     54    WeakMapConstructor(VM& vm, Structure* structure)
     55        : Base(vm, structure)
    5756    {
    5857    }
  • trunk/Source/WebCore/bridge/runtime_method.cpp

    r155739 r156624  
    4444RuntimeMethod::RuntimeMethod(JSGlobalObject* globalObject, Structure* structure, Method* method)
    4545    // Callers will need to pass in the right global object corresponding to this native object "method".
    46     : InternalFunction(globalObject, structure)
     46    : InternalFunction(globalObject->vm(), structure)
    4747    , m_method(method)
    4848{
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/JSNPMethod.cpp

    r155143 r156624  
    4747
    4848JSNPMethod::JSNPMethod(JSGlobalObject* globalObject, Structure* structure, NPIdentifier npIdentifier)
    49     : InternalFunction(globalObject, structure)
     49    : InternalFunction(globalObject->vm(), structure)
    5050    , m_npIdentifier(npIdentifier)
    5151{
Note: See TracChangeset for help on using the changeset viewer.