Changeset 156620 in webkit


Ignore:
Timestamp:
Sep 29, 2013 3:20:26 PM (11 years ago)
Author:
akling@apple.com
Message:

Pass VM instead of ExecState to simple builtin constructors.
<https://webkit.org/b/122077>

Reviewed by Sam Weinig.

None of the simple builtins need the ExecState for anything during
their construction, so reduce the amount of loads by just passing
the VM around instead.

Location:
trunk/Source
Files:
31 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r156617 r156620  
     12013-09-29  Andreas Kling  <akling@apple.com>
     2
     3        Pass VM instead of ExecState to simple builtin constructors.
     4        <https://webkit.org/b/122077>
     5
     6        Reviewed by Sam Weinig.
     7
     8        None of the simple builtins need the ExecState for anything during
     9        their construction, so reduce the amount of loads by just passing
     10        the VM around instead.
     11
    1122013-09-29  Nadav Rotem  <nrotem@apple.com>
    213
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.cpp

    r156498 r156620  
    5151STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(BooleanPrototype);
    5252
    53 BooleanPrototype::BooleanPrototype(ExecState* exec, Structure* structure)
    54     : BooleanObject(exec->vm(), structure)
     53BooleanPrototype::BooleanPrototype(VM& vm, Structure* structure)
     54    : BooleanObject(vm, structure)
    5555{
    5656}
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h

    r156498 r156620  
    3030    typedef BooleanObject Base;
    3131
    32     static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     32    static BooleanPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
    3333    {
    34         VM& vm = exec->vm();
    35         BooleanPrototype* prototype = new (NotNull, allocateCell<BooleanPrototype>(vm.heap)) BooleanPrototype(exec, structure);
     34        BooleanPrototype* prototype = new (NotNull, allocateCell<BooleanPrototype>(vm.heap)) BooleanPrototype(vm, structure);
    3635        prototype->finishCreation(vm, globalObject);
    3736        return prototype;
     
    5049
    5150private:
    52     BooleanPrototype(ExecState*, Structure*);
     51    BooleanPrototype(VM&, Structure*);
    5352    static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5453};
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp

    r156540 r156620  
    9595JSObject* constructDate(ExecState* exec, JSGlobalObject* globalObject, const ArgList& args)
    9696{
     97    VM& vm = exec->vm();
    9798    int numArgs = args.size();
    9899
     
    107108            JSValue primitive = args.at(0).toPrimitive(exec);
    108109            if (primitive.isString())
    109                 value = parseDate(exec->vm(), primitive.getString(exec));
     110                value = parseDate(vm, primitive.getString(exec));
    110111            else
    111112                value = primitive.toNumber(exec);
     
    140141            t.setIsDST(-1);
    141142            double ms = (numArgs >= 7) ? doubleArguments[6] : 0;
    142             value = gregorianDateTimeToMS(exec->vm(), t, ms, false);
     143            value = gregorianDateTimeToMS(vm, t, ms, false);
    143144        }
    144145    }
    145146
    146     return DateInstance::create(exec, globalObject->dateStructure(), value);
     147    return DateInstance::create(vm, globalObject->dateStructure(), value);
    147148}
    148149   
  • trunk/Source/JavaScriptCore/runtime/DateInstance.cpp

    r156540 r156620  
    3535const ClassInfo DateInstance::s_info = {"Date", &JSWrapperObject::s_info, 0, 0, CREATE_METHOD_TABLE(DateInstance)};
    3636
    37 DateInstance::DateInstance(ExecState* exec, Structure* structure)
    38     : JSWrapperObject(exec->vm(), structure)
     37DateInstance::DateInstance(VM& vm, Structure* structure)
     38    : JSWrapperObject(vm, structure)
    3939{
    4040}
  • trunk/Source/JavaScriptCore/runtime/DateInstance.h

    r154038 r156620  
    2828    class DateInstance : public JSWrapperObject {
    2929    protected:
    30         JS_EXPORT_PRIVATE DateInstance(ExecState*, Structure*);
     30        JS_EXPORT_PRIVATE DateInstance(VM&, Structure*);
    3131        void finishCreation(VM&);
    3232        JS_EXPORT_PRIVATE void finishCreation(VM&, double);
     
    3737        typedef JSWrapperObject Base;
    3838
    39         static DateInstance* create(ExecState* exec, Structure* structure, double date)
     39        static DateInstance* create(VM& vm, Structure* structure, double date)
    4040        {
    41             DateInstance* instance = new (NotNull, allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
    42             instance->finishCreation(exec->vm(), date);
     41            DateInstance* instance = new (NotNull, allocateCell<DateInstance>(vm.heap)) DateInstance(vm, structure);
     42            instance->finishCreation(vm, date);
    4343            return instance;
    4444        }
    4545
    46         static DateInstance* create(ExecState* exec, Structure* structure)
     46        static DateInstance* create(VM& vm, Structure* structure)
    4747        {
    48             DateInstance* instance = new (NotNull, allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
    49             instance->finishCreation(exec->vm());
     48            DateInstance* instance = new (NotNull, allocateCell<DateInstance>(vm.heap)) DateInstance(vm, structure);
     49            instance->finishCreation(vm);
    5050            return instance;
    5151        }
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.cpp

    r156540 r156620  
    502502// ECMA 15.9.4
    503503
    504 DatePrototype::DatePrototype(ExecState* exec, Structure* structure)
    505     : DateInstance(exec, structure)
     504DatePrototype::DatePrototype(VM& vm, Structure* structure)
     505    : DateInstance(vm, structure)
    506506{
    507507}
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.h

    r156498 r156620  
    3030    class DatePrototype : public DateInstance {
    3131    private:
    32         DatePrototype(ExecState*, Structure*);
     32        DatePrototype(VM&, Structure*);
    3333
    3434    public:
    3535        typedef DateInstance Base;
    3636
    37         static DatePrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     37        static DatePrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
    3838        {
    39             VM& vm = exec->vm();
    40             DatePrototype* prototype = new (NotNull, allocateCell<DatePrototype>(vm.heap)) DatePrototype(exec, structure);
     39            DatePrototype* prototype = new (NotNull, allocateCell<DatePrototype>(vm.heap)) DatePrototype(vm, structure);
    4140            prototype->finishCreation(vm, globalObject);
    4241            return prototype;
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp

    r156498 r156620  
    5050*/
    5151
    52 ErrorPrototype::ErrorPrototype(ExecState* exec, Structure* structure)
    53     : ErrorInstance(exec->vm(), structure)
     52ErrorPrototype::ErrorPrototype(VM& vm, Structure* structure)
     53    : ErrorInstance(vm, structure)
    5454{
    5555}
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h

    r156498 r156620  
    3232        typedef ErrorInstance Base;
    3333
    34         static ErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     34        static ErrorPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
    3535        {
    36             VM& vm = exec->vm();
    37             ErrorPrototype* prototype = new (NotNull, allocateCell<ErrorPrototype>(vm.heap)) ErrorPrototype(exec, structure);
     36            ErrorPrototype* prototype = new (NotNull, allocateCell<ErrorPrototype>(vm.heap)) ErrorPrototype(vm, structure);
    3837            prototype->finishCreation(vm, globalObject);
    3938            return prototype;
     
    4847
    4948    protected:
    50         ErrorPrototype(ExecState*, Structure*);
     49        ErrorPrototype(VM&, Structure*);
    5150        void finishCreation(VM&, JSGlobalObject*);
    5251
  • trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.cpp

    r156240 r156620  
    7979}
    8080
    81 void JSArrayBufferPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
     81void JSArrayBufferPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
    8282{
    83     VM& vm = exec->vm();
    84    
    8583    Base::finishCreation(vm);
    8684   
     
    8886}
    8987
    90 JSArrayBufferPrototype* JSArrayBufferPrototype::create(
    91     ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     88JSArrayBufferPrototype* JSArrayBufferPrototype::create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
    9289{
    93     VM& vm = exec->vm();
    9490    JSArrayBufferPrototype* prototype =
    9591        new (NotNull, allocateCell<JSArrayBufferPrototype>(vm.heap))
    9692        JSArrayBufferPrototype(vm, structure);
    97     prototype->finishCreation(exec, globalObject);
     93    prototype->finishCreation(vm, globalObject);
    9894    return prototype;
    9995}
  • trunk/Source/JavaScriptCore/runtime/JSArrayBufferPrototype.h

    r154127 r156620  
    3737protected:
    3838    JSArrayBufferPrototype(VM&, Structure*);
    39     void finishCreation(ExecState*, JSGlobalObject*);
     39    void finishCreation(VM&, JSGlobalObject*);
    4040
    4141public:
    42     static JSArrayBufferPrototype* create(ExecState*, JSGlobalObject*, Structure*);
     42    static JSArrayBufferPrototype* create(VM&, JSGlobalObject*, Structure*);
    4343   
    4444    DECLARE_INFO;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r156602 r156620  
    313313
    314314#define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName) \
    315     m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create(exec, this, capitalName##Prototype::createStructure(vm, this, m_objectPrototype.get()))); \
     315    m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create(vm, this, capitalName##Prototype::createStructure(vm, this, m_objectPrototype.get()))); \
    316316    m_ ## properName ## Structure.set(vm, this, instanceType::createStructure(vm, this, m_ ## lowerName ## Prototype.get()));
    317317
     
    345345    Structure* nativeErrorPrototypeStructure = NativeErrorPrototype::createStructure(vm, this, m_errorPrototype.get());
    346346    Structure* nativeErrorStructure = NativeErrorConstructor::createStructure(vm, this, m_functionPrototype.get());
    347     m_evalErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("EvalError")));
    348     m_rangeErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("RangeError")));
    349     m_referenceErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("ReferenceError")));
    350     m_syntaxErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("SyntaxError")));
    351     m_typeErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("TypeError")));
    352     m_URIErrorConstructor.set(vm, this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("URIError")));
     347    m_evalErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("EvalError")));
     348    m_rangeErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("RangeError")));
     349    m_referenceErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("ReferenceError")));
     350    m_syntaxErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("SyntaxError")));
     351    m_typeErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("TypeError")));
     352    m_URIErrorConstructor.set(vm, this, NativeErrorConstructor::create(vm, this, nativeErrorStructure, nativeErrorPrototypeStructure, ASCIILiteral("URIError")));
    353353
    354354    m_objectPrototype->putDirectWithoutTransition(vm, vm.propertyNames->constructor, objectConstructor, DontEnum);
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r156602 r156620  
    22022202}
    22032203
    2204 void JSObject::putDirectNativeFunction(ExecState* exec, JSGlobalObject* globalObject, const PropertyName& propertyName, unsigned functionLength, NativeFunction nativeFunction, Intrinsic intrinsic, unsigned attributes)
     2204void JSObject::putDirectNativeFunction(VM& vm, JSGlobalObject* globalObject, const PropertyName& propertyName, unsigned functionLength, NativeFunction nativeFunction, Intrinsic intrinsic, unsigned attributes)
    22052205{
    22062206    StringImpl* name = propertyName.publicName();
    22072207    ASSERT(name);
    22082208
    2209     VM& vm = exec->vm();
    22102209    JSFunction* function = JSFunction::create(vm, globalObject, functionLength, name, nativeFunction, intrinsic);
    22112210    putDirect(vm, propertyName, function, attributes);
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r156602 r156620  
    578578    void putDirectUndefined(PropertyOffset offset) { locationForOffset(offset)->setUndefined(); }
    579579
    580     void putDirectNativeFunction(ExecState*, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes);
     580    void putDirectNativeFunction(VM&, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes);
    581581    void putDirectNativeFunctionWithoutTransition(ExecState*, JSGlobalObject*, const PropertyName&, unsigned functionLength, NativeFunction, Intrinsic, unsigned attributes);
    582582
     
    14991499COMPILE_ASSERT(!(sizeof(JSObject) % sizeof(WriteBarrierBase<Unknown>)), JSObject_inline_storage_has_correct_alignment);
    15001500
    1501 ALWAYS_INLINE Identifier makeIdentifier(ExecState* exec, const char* name)
    1502 {
    1503     return Identifier(exec, name);
    1504 }
    1505 
    1506 ALWAYS_INLINE Identifier makeIdentifier(ExecState*, const Identifier& name)
     1501ALWAYS_INLINE Identifier makeIdentifier(VM& vm, const char* name)
     1502{
     1503    return Identifier(&vm, name);
     1504}
     1505
     1506ALWAYS_INLINE Identifier makeIdentifier(VM&, const Identifier& name)
    15071507{
    15081508    return name;
     
    15151515#define JSC_NATIVE_INTRINSIC_FUNCTION(jsName, cppName, attributes, length, intrinsic) \
    15161516    putDirectNativeFunction(\
    1517         exec, globalObject, makeIdentifier(exec, (jsName)), (length), cppName, \
     1517        vm, globalObject, makeIdentifier(vm, (jsName)), (length), cppName, \
    15181518        (intrinsic), (attributes))
    15191519
  • trunk/Source/JavaScriptCore/runtime/Lookup.cpp

    r154253 r156620  
    7070    ASSERT(thisObj->globalObject());
    7171    ASSERT(entry->attributes() & Function);
     72    VM& vm = exec->vm();
    7273    unsigned attributes;
    73     PropertyOffset offset = thisObj->getDirectOffset(exec->vm(), propertyName, attributes);
     74    PropertyOffset offset = thisObj->getDirectOffset(vm, propertyName, attributes);
    7475
    7576    if (!isValidOffset(offset)) {
     
    8081   
    8182        thisObj->putDirectNativeFunction(
    82             exec, thisObj->globalObject(), propertyName, entry->functionLength(),
     83            vm, thisObj->globalObject(), propertyName, entry->functionLength(),
    8384            entry->function(), entry->intrinsic(), entry->attributes());
    84         offset = thisObj->getDirectOffset(exec->vm(), propertyName, attributes);
     85        offset = thisObj->getDirectOffset(vm, propertyName, attributes);
    8586        ASSERT(isValidOffset(offset));
    8687    }
  • trunk/Source/JavaScriptCore/runtime/MapPrototype.cpp

    r156602 r156620  
    4949static EncodedJSValue JSC_HOST_CALL mapProtoFuncSize(ExecState*);
    5050   
    51 void MapPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
     51void MapPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
    5252{
    53     VM& vm = exec->vm();
    54 
    5553    Base::finishCreation(vm);
    5654    ASSERT(inherits(info()));
  • trunk/Source/JavaScriptCore/runtime/MapPrototype.h

    r154861 r156620  
    3535    typedef JSNonFinalObject Base;
    3636
    37     static MapPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     37    static MapPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
    3838    {
    39         MapPrototype* prototype = new (NotNull, allocateCell<MapPrototype>(*exec->heap())) MapPrototype(exec, structure);
    40         prototype->finishCreation(exec, globalObject);
     39        MapPrototype* prototype = new (NotNull, allocateCell<MapPrototype>(vm.heap)) MapPrototype(vm, structure);
     40        prototype->finishCreation(vm, globalObject);
    4141        return prototype;
    4242    }
     
    5050
    5151private:
    52     MapPrototype(ExecState* exec, Structure* structure)
    53         : Base(exec->vm(), structure)
     52    MapPrototype(VM& vm, Structure* structure)
     53        : Base(vm, structure)
    5454    {
    5555    }
    56     void finishCreation(ExecState*, JSGlobalObject*);
     56    void finishCreation(VM&, JSGlobalObject*);
    5757};
    5858
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h

    r154038 r156620  
    3535        typedef InternalFunction Base;
    3636
    37         static NativeErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const String& name)
     37        static NativeErrorConstructor* create(VM& vm, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const String& name)
    3838        {
    39             NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(globalObject, structure);
    40             constructor->finishCreation(exec, globalObject, prototypeStructure, name);
     39            NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(vm.heap)) NativeErrorConstructor(globalObject, structure);
     40            constructor->finishCreation(vm, globalObject, prototypeStructure, name);
    4141            return constructor;
    4242        }
     
    5252
    5353    protected:
    54         void finishCreation(ExecState* exec, JSGlobalObject* globalObject, Structure* prototypeStructure, const String& name)
     54        void finishCreation(VM& vm, JSGlobalObject* globalObject, Structure* prototypeStructure, const String& name)
    5555        {
    56             Base::finishCreation(exec->vm(), name);
     56            Base::finishCreation(vm, name);
    5757            ASSERT(inherits(info()));
    5858
    59             NativeErrorPrototype* prototype = NativeErrorPrototype::create(exec, globalObject, prototypeStructure, name, this);
     59            NativeErrorPrototype* prototype = NativeErrorPrototype::create(vm, globalObject, prototypeStructure, name, this);
    6060
    61             putDirect(exec->vm(), exec->propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5
    62             putDirect(exec->vm(), exec->propertyNames().prototype, prototype, DontDelete | ReadOnly | DontEnum);
    63             m_errorStructure.set(exec->vm(), this, ErrorInstance::createStructure(exec->vm(), globalObject, prototype));
     61            putDirect(vm, vm.propertyNames->length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5
     62            putDirect(vm, vm.propertyNames->prototype, prototype, DontDelete | ReadOnly | DontEnum);
     63            m_errorStructure.set(vm, this, ErrorInstance::createStructure(vm, globalObject, prototype));
    6464            ASSERT(m_errorStructure);
    6565            ASSERT(m_errorStructure->isObject());
  • trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.cpp

    r156498 r156620  
    2929namespace JSC {
    3030
    31 NativeErrorPrototype::NativeErrorPrototype(ExecState* exec, Structure* structure)
    32     : ErrorPrototype(exec, structure)
     31NativeErrorPrototype::NativeErrorPrototype(VM& vm, Structure* structure)
     32    : ErrorPrototype(vm, structure)
    3333{
    3434}
  • trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.h

    r156498 r156620  
    2929    class NativeErrorPrototype : public ErrorPrototype {
    3030    private:
    31         NativeErrorPrototype(ExecState*, Structure*);
     31        NativeErrorPrototype(VM&, Structure*);
    3232   
    3333    public:
    3434        typedef ErrorPrototype Base;
    3535
    36         static NativeErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const String& name, NativeErrorConstructor* constructor)
     36        static NativeErrorPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure, const String& name, NativeErrorConstructor* constructor)
    3737        {
    38             VM& vm = exec->vm();
    39             NativeErrorPrototype* prototype = new (NotNull, allocateCell<NativeErrorPrototype>(vm.heap)) NativeErrorPrototype(exec, structure);
     38            NativeErrorPrototype* prototype = new (NotNull, allocateCell<NativeErrorPrototype>(vm.heap)) NativeErrorPrototype(vm, structure);
    4039            prototype->finishCreation(vm, globalObject, name, constructor);
    4140            return prototype;
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.cpp

    r156498 r156620  
    7171STATIC_ASSERT_IS_TRIVIALLY_DESTRUCTIBLE(NumberPrototype);
    7272
    73 NumberPrototype::NumberPrototype(ExecState* exec, Structure* structure)
    74     : NumberObject(exec->vm(), structure)
     73NumberPrototype::NumberPrototype(VM& vm, Structure* structure)
     74    : NumberObject(vm, structure)
    7575{
    7676}
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.h

    r156498 r156620  
    3030        typedef NumberObject Base;
    3131
    32         static NumberPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     32        static NumberPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
    3333        {
    34             VM& vm = exec->vm();
    35             NumberPrototype* prototype = new (NotNull, allocateCell<NumberPrototype>(vm.heap)) NumberPrototype(exec, structure);
     34            NumberPrototype* prototype = new (NotNull, allocateCell<NumberPrototype>(vm.heap)) NumberPrototype(vm, structure);
    3635            prototype->finishCreation(vm, globalObject);
    3736            return prototype;
     
    5049
    5150    private:
    52         NumberPrototype(ExecState*, Structure*);
     51        NumberPrototype(VM&, Structure*);
    5352        static bool getOwnPropertySlot(JSObject*, ExecState*, PropertyName, PropertySlot&);
    5453    };
  • trunk/Source/JavaScriptCore/runtime/SetPrototype.cpp

    r156602 r156620  
    4848static EncodedJSValue JSC_HOST_CALL setProtoFuncSize(ExecState*);
    4949
    50 void SetPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
     50void SetPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
    5151{
    52     VM& vm = exec->vm();
    53 
    5452    Base::finishCreation(vm);
    5553    ASSERT(inherits(info()));
  • trunk/Source/JavaScriptCore/runtime/SetPrototype.h

    r154916 r156620  
    3535    typedef JSNonFinalObject Base;
    3636
    37     static SetPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     37    static SetPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
    3838    {
    39         SetPrototype* prototype = new (NotNull, allocateCell<SetPrototype>(*exec->heap())) SetPrototype(exec, structure);
    40         prototype->finishCreation(exec, globalObject);
     39        SetPrototype* prototype = new (NotNull, allocateCell<SetPrototype>(vm.heap)) SetPrototype(vm, structure);
     40        prototype->finishCreation(vm, globalObject);
    4141        return prototype;
    4242    }
     
    5050
    5151private:
    52     SetPrototype(ExecState* exec, Structure* structure)
    53         : Base(exec->vm(), structure)
     52    SetPrototype(VM& vm, Structure* structure)
     53        : Base(vm, structure)
    5454    {
    5555    }
    56     void finishCreation(ExecState*, JSGlobalObject*);
     56    void finishCreation(VM&, JSGlobalObject*);
    5757};
    5858
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r156240 r156620  
    8686
    8787// ECMA 15.5.4
    88 StringPrototype::StringPrototype(ExecState* exec, Structure* structure)
    89     : StringObject(exec->vm(), structure)
    90 {
    91 }
    92 
    93 void StringPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject, JSString* nameAndMessage)
    94 {
    95     VM& vm = exec->vm();
    96    
     88StringPrototype::StringPrototype(VM& vm, Structure* structure)
     89    : StringObject(vm, structure)
     90{
     91}
     92
     93void StringPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject, JSString* nameAndMessage)
     94{
    9795    Base::finishCreation(vm, nameAndMessage);
    9896    ASSERT(inherits(info()));
     
    135133
    136134    // The constructor will be added later, after StringConstructor has been built
    137     putDirectWithoutTransition(exec->vm(), exec->propertyNames().length, jsNumber(0), DontDelete | ReadOnly | DontEnum);
    138 }
    139 
    140 StringPrototype* StringPrototype::create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    141 {
    142     JSString* empty = jsEmptyString(exec);
    143     StringPrototype* prototype = new (NotNull, allocateCell<StringPrototype>(*exec->heap())) StringPrototype(exec, structure);
    144     prototype->finishCreation(exec, globalObject, empty);
     135    putDirectWithoutTransition(vm, vm.propertyNames->length, jsNumber(0), DontDelete | ReadOnly | DontEnum);
     136}
     137
     138StringPrototype* StringPrototype::create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
     139{
     140    JSString* empty = jsEmptyString(&vm);
     141    StringPrototype* prototype = new (NotNull, allocateCell<StringPrototype>(vm.heap)) StringPrototype(vm, structure);
     142    prototype->finishCreation(vm, globalObject, empty);
    145143    return prototype;
    146144}
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.h

    r154038 r156620  
    3030    class StringPrototype : public StringObject {
    3131    private:
    32         StringPrototype(ExecState*, Structure*);
     32        StringPrototype(VM&, Structure*);
    3333
    3434    public:
    3535        typedef StringObject Base;
    3636
    37         static StringPrototype* create(ExecState*, JSGlobalObject*, Structure*);
     37        static StringPrototype* create(VM&, JSGlobalObject*, Structure*);
    3838
    3939        static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
     
    4545       
    4646    protected:
    47         void finishCreation(ExecState*, JSGlobalObject*, JSString*);
     47        void finishCreation(VM&, JSGlobalObject*, JSString*);
    4848        static const unsigned StructureFlags = StringObject::StructureFlags;
    4949
  • trunk/Source/JavaScriptCore/runtime/WeakMapPrototype.cpp

    r155558 r156620  
    4141static EncodedJSValue JSC_HOST_CALL protoFuncWeakMapSet(ExecState*);
    4242
    43 void WeakMapPrototype::finishCreation(ExecState* exec, JSGlobalObject* globalObject)
     43void WeakMapPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
    4444{
    45     VM& vm = exec->vm();
    46 
    4745    Base::finishCreation(vm);
    4846    ASSERT(inherits(info()));
    4947    vm.prototypeMap.addPrototype(this);
    5048
    51     JSC_NATIVE_FUNCTION(exec->propertyNames().clear, protoFuncWeakMapClear, DontEnum, 0);
    52     JSC_NATIVE_FUNCTION(exec->propertyNames().deleteKeyword, protoFuncWeakMapDelete, DontEnum, 1);
    53     JSC_NATIVE_FUNCTION(exec->propertyNames().get, protoFuncWeakMapGet, DontEnum, 1);
    54     JSC_NATIVE_FUNCTION(exec->propertyNames().has, protoFuncWeakMapHas, DontEnum, 1);
    55     JSC_NATIVE_FUNCTION(exec->propertyNames().set, protoFuncWeakMapSet, DontEnum, 2);
     49    JSC_NATIVE_FUNCTION(vm.propertyNames->clear, protoFuncWeakMapClear, DontEnum, 0);
     50    JSC_NATIVE_FUNCTION(vm.propertyNames->deleteKeyword, protoFuncWeakMapDelete, DontEnum, 1);
     51    JSC_NATIVE_FUNCTION(vm.propertyNames->get, protoFuncWeakMapGet, DontEnum, 1);
     52    JSC_NATIVE_FUNCTION(vm.propertyNames->has, protoFuncWeakMapHas, DontEnum, 1);
     53    JSC_NATIVE_FUNCTION(vm.propertyNames->set, protoFuncWeakMapSet, DontEnum, 2);
    5654}
    5755
  • trunk/Source/JavaScriptCore/runtime/WeakMapPrototype.h

    r155473 r156620  
    3535    typedef JSNonFinalObject Base;
    3636
    37     static WeakMapPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     37    static WeakMapPrototype* create(VM& vm, JSGlobalObject* globalObject, Structure* structure)
    3838    {
    39         WeakMapPrototype* prototype = new (NotNull, allocateCell<WeakMapPrototype>(*exec->heap())) WeakMapPrototype(exec, structure);
    40         prototype->finishCreation(exec, globalObject);
     39        WeakMapPrototype* prototype = new (NotNull, allocateCell<WeakMapPrototype>(vm.heap)) WeakMapPrototype(vm, structure);
     40        prototype->finishCreation(vm, globalObject);
    4141        return prototype;
    4242    }
     
    5050
    5151private:
    52     WeakMapPrototype(ExecState* exec, Structure* structure)
    53         : Base(exec->vm(), structure)
     52    WeakMapPrototype(VM& vm, Structure* structure)
     53        : Base(vm, structure)
    5454    {
    5555    }
    56     void finishCreation(ExecState*, JSGlobalObject*);
     56    void finishCreation(VM&, JSGlobalObject*);
    5757};
    5858
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp

    r156602 r156620  
    122122    if (!std::isfinite(value))
    123123        return jsNull();
    124     return DateInstance::create(exec, exec->lexicalGlobalObject()->dateStructure(), value);
     124    return DateInstance::create(exec->vm(), exec->lexicalGlobalObject()->dateStructure(), value);
    125125}
    126126
  • trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp

    r156550 r156620  
    15171517            if (!read(d))
    15181518                return JSValue();
    1519             return DateInstance::create(m_exec, m_globalObject->dateStructure(), d);
     1519            return DateInstance::create(m_exec->vm(), m_globalObject->dateStructure(), d);
    15201520        }
    15211521        case FileTag: {
Note: See TracChangeset for help on using the changeset viewer.