Changeset 91194 in webkit


Ignore:
Timestamp:
Jul 18, 2011 10:47:13 AM (13 years ago)
Author:
oliver@apple.com
Message:

2011-07-18 Mark Hahnenberg <mhahnenberg@apple.com>

Refactor JSC to replace JSCell::operator new with static create method
https://bugs.webkit.org/show_bug.cgi?id=64466

Reviewed by Oliver Hunt (oliver@apple.com) and Darin Adler (Darin Adler).

First step in a longer refactoring process to remove the use of
operator new overloading in order to allocate GC objects and to replace
this method with static create methods for each individual type of heap-allocated
JS object. This particular patch only deals with replacing uses of
operator new within JSC proper. Future patches will remove it from the
parts that interface with the DOM. Due to the DOM's continued dependence
on it, operator new has not actually been removed from JSCell.

  • API/JSCallbackConstructor.h: (JSC::JSCallbackConstructor::create):
  • API/JSCallbackFunction.h: (JSC::JSCallbackFunction::create):
  • API/JSCallbackObject.h: (JSC::JSCallbackObject::operator new): (JSC::JSCallbackObject::create):
  • API/JSCallbackObjectFunctions.h: (JSC::::staticFunctionGetter):
  • API/JSClassRef.cpp: (OpaqueJSClass::prototype):
  • API/JSContextRef.cpp:
  • API/JSObjectRef.cpp: (JSObjectMake): (JSObjectMakeFunctionWithCallback): (JSObjectMakeConstructor):
  • JavaScriptCore.exp:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::createActivation):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::BytecodeGenerator):
  • bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::makeFunction):
  • bytecompiler/NodesCodegen.cpp: (JSC::RegExpNode::emitBytecode):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveArguments):
  • jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION):
  • jsc.cpp: (GlobalObject::create): (GlobalObject::GlobalObject): (functionRun): (jscmain):
  • runtime/Arguments.h: (JSC::Arguments::create): (JSC::Arguments::createNoParameters):
  • runtime/ArrayConstructor.cpp: (JSC::constructArrayWithSizeQuirk):
  • runtime/ArrayConstructor.h: (JSC::ArrayConstructor::create):
  • runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncSplice):
  • runtime/ArrayPrototype.h: (JSC::ArrayPrototype::create):
  • runtime/BooleanConstructor.cpp: (JSC::constructBoolean): (JSC::constructBooleanFromImmediateBoolean):
  • runtime/BooleanConstructor.h: (JSC::BooleanConstructor::create):
  • runtime/BooleanObject.h: (JSC::BooleanObject::create):
  • runtime/BooleanPrototype.h: (JSC::BooleanPrototype::create):
  • runtime/DateConstructor.cpp: (JSC::constructDate):
  • runtime/DateConstructor.h: (JSC::DateConstructor::create):
  • runtime/DateInstance.h: (JSC::DateInstance::create):
  • runtime/DatePrototype.h: (JSC::DatePrototype::create):
  • runtime/Error.cpp: (JSC::createError): (JSC::createEvalError): (JSC::createRangeError): (JSC::createReferenceError): (JSC::createSyntaxError): (JSC::createTypeError): (JSC::createURIError): (JSC::StrictModeTypeErrorFunction::create): (JSC::createTypeErrorFunction):
  • runtime/ErrorConstructor.h: (JSC::ErrorConstructor::create):
  • runtime/ErrorInstance.cpp: (JSC::ErrorInstance::ErrorInstance): (JSC::ErrorInstance::create):
  • runtime/ErrorInstance.h:
  • runtime/ErrorPrototype.cpp: (JSC::ErrorPrototype::ErrorPrototype):
  • runtime/ErrorPrototype.h: (JSC::ErrorPrototype::create):
  • runtime/ExceptionHelpers.cpp: (JSC::InterruptedExecutionError::InterruptedExecutionError): (JSC::InterruptedExecutionError::create): (JSC::createInterruptedExecutionException): (JSC::TerminatedExecutionError::TerminatedExecutionError): (JSC::TerminatedExecutionError::create): (JSC::createTerminatedExecutionException):
  • runtime/Executable.cpp: (JSC::FunctionExecutable::FunctionExecutable): (JSC::FunctionExecutable::fromGlobalCode):
  • runtime/Executable.h: (JSC::ExecutableBase::create): (JSC::NativeExecutable::create): (JSC::ScriptExecutable::ScriptExecutable): (JSC::EvalExecutable::create): (JSC::ProgramExecutable::create): (JSC::FunctionExecutable::create): (JSC::FunctionExecutable::make):
  • runtime/FunctionConstructor.cpp: (JSC::constructFunctionSkippingEvalEnabledCheck):
  • runtime/FunctionConstructor.h: (JSC::FunctionConstructor::create):
  • runtime/FunctionPrototype.cpp: (JSC::FunctionPrototype::addFunctionProperties):
  • runtime/FunctionPrototype.h: (JSC::FunctionPrototype::create):
  • runtime/GetterSetter.h: (JSC::GetterSetter::create):
  • runtime/JSAPIValueWrapper.h: (JSC::JSAPIValueWrapper::create): (JSC::jsAPIValueWrapper):
  • runtime/JSActivation.cpp: (JSC::JSActivation::argumentsGetter):
  • runtime/JSActivation.h: (JSC::JSActivation::create):
  • runtime/JSArray.h: (JSC::JSArray::create):
  • runtime/JSCell.h: (JSC::JSCell::allocateCell):
  • runtime/JSFunction.h: (JSC::JSFunction::create):
  • runtime/JSGlobalObject.cpp: (JSC::JSGlobalObject::init): (JSC::JSGlobalObject::reset):
  • runtime/JSGlobalObject.h: (JSC::constructEmptyArray): (JSC::constructArray):
  • runtime/JSNotAnObject.h: (JSC::JSNotAnObject::create):
  • runtime/JSONObject.h: (JSC::JSONObject::create):
  • runtime/JSObject.cpp: (JSC::JSObject::defineGetter): (JSC::JSObject::defineSetter): (JSC::putDescriptor):
  • runtime/JSObject.h: (JSC::JSFinalObject::create):
  • runtime/JSPropertyNameIterator.cpp: (JSC::JSPropertyNameIterator::create):
  • runtime/JSPropertyNameIterator.h: (JSC::JSPropertyNameIterator::create):
  • runtime/JSString.cpp: (JSC::JSString::substringFromRope): (JSC::JSString::replaceCharacter): (JSC::StringObject::create):
  • runtime/JSString.h: (JSC::RopeBuilder::JSString): (JSC::RopeBuilder::create): (JSC::RopeBuilder::createHasOtherOwner): (JSC::jsSingleCharacterString): (JSC::jsSingleCharacterSubstring): (JSC::jsNontrivialString): (JSC::jsString): (JSC::jsSubstring): (JSC::jsOwnedString):
  • runtime/JSValue.cpp: (JSC::JSValue::toObjectSlowCase): (JSC::JSValue::synthesizeObject): (JSC::JSValue::synthesizePrototype):
  • runtime/Lookup.cpp: (JSC::setUpStaticFunctionSlot):
  • runtime/MathObject.h: (JSC::MathObject::create):
  • runtime/NativeErrorConstructor.cpp: (JSC::NativeErrorConstructor::NativeErrorConstructor):
  • runtime/NativeErrorConstructor.h: (JSC::NativeErrorConstructor::create):
  • runtime/NativeErrorPrototype.h: (JSC::NativeErrorPrototype::create):
  • runtime/NumberConstructor.cpp: (JSC::constructWithNumberConstructor):
  • runtime/NumberConstructor.h: (JSC::NumberConstructor::create):
  • runtime/NumberObject.cpp: (JSC::constructNumber):
  • runtime/NumberObject.h: (JSC::NumberObject::create):
  • runtime/NumberPrototype.h: (JSC::NumberPrototype::create):
  • runtime/ObjectConstructor.h: (JSC::ObjectConstructor::create):
  • runtime/ObjectPrototype.h: (JSC::ObjectPrototype::create):
  • runtime/Operations.h: (JSC::jsString):
  • runtime/RegExp.cpp: (JSC::RegExp::RegExp): (JSC::RegExp::createWithoutCaching): (JSC::RegExp::create):
  • runtime/RegExp.h:
  • runtime/RegExpCache.cpp: (JSC::RegExpCache::lookupOrCreate):
  • runtime/RegExpConstructor.cpp: (JSC::RegExpConstructor::arrayOfMatches): (JSC::constructRegExp):
  • runtime/RegExpConstructor.h: (JSC::RegExpConstructor::create):
  • runtime/RegExpMatchesArray.h: (JSC::RegExpMatchesArray::create):
  • runtime/RegExpObject.h: (JSC::RegExpObject::create):
  • runtime/RegExpPrototype.cpp: (JSC::regExpProtoFuncCompile):
  • runtime/RegExpPrototype.h: (JSC::RegExpPrototype::create):
  • runtime/ScopeChain.h: (JSC::ScopeChainNode::create): (JSC::ScopeChainNode::push):
  • runtime/SmallStrings.cpp: (JSC::SmallStrings::createEmptyString): (JSC::SmallStrings::createSingleCharacterString):
  • runtime/StringConstructor.cpp: (JSC::constructWithStringConstructor):
  • runtime/StringConstructor.h: (JSC::StringConstructor::create):
  • runtime/StringObject.h: (JSC::StringObject::create):
  • runtime/StringObjectThatMasqueradesAsUndefined.h: (JSC::StringObjectThatMasqueradesAsUndefined::create):
  • runtime/StringPrototype.cpp: (JSC::stringProtoFuncMatch): (JSC::stringProtoFuncSearch):
  • runtime/StringPrototype.h: (JSC::StringPrototype::create):
  • runtime/Structure.h: (JSC::Structure::create): (JSC::Structure::createStructure):
  • runtime/StructureChain.h: (JSC::StructureChain::create):
Location:
trunk/Source
Files:
100 edited

Legend:

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

    r84052 r91194  
    3333
    3434class JSCallbackConstructor : public JSObjectWithGlobalObject {
     35protected:
     36    JSCallbackConstructor(JSGlobalObject*, Structure*, JSClassRef, JSObjectCallAsConstructorCallback);
    3537public:
    36     JSCallbackConstructor(JSGlobalObject*, Structure*, JSClassRef, JSObjectCallAsConstructorCallback);
     38    static JSCallbackConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, JSObjectCallAsConstructorCallback callback)
     39    {
     40        return new (allocateCell<JSCallbackConstructor>(*exec->heap())) JSCallbackConstructor(globalObject, structure, classRef, callback);
     41    }
     42   
    3743    virtual ~JSCallbackConstructor();
    3844    JSClassRef classRef() const { return m_class; }
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.h

    r84052 r91194  
    3333
    3434class JSCallbackFunction : public InternalFunction {
     35protected:
     36    JSCallbackFunction(ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const Identifier& name);
     37
    3538public:
    36     JSCallbackFunction(ExecState*, JSGlobalObject*, JSObjectCallAsFunctionCallback, const Identifier& name);
     39    static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
     40    {
     41        return new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(exec, globalObject, callback, name);
     42    }
    3743
    3844    static const ClassInfo s_info;
  • trunk/Source/JavaScriptCore/API/JSCallbackObject.h

    r87588 r91194  
    117117template <class Base>
    118118class JSCallbackObject : public Base {
    119 public:
     119protected:
    120120    JSCallbackObject(ExecState*, JSGlobalObject*, Structure*, JSClassRef, void* data);
    121121    JSCallbackObject(JSGlobalData&, JSClassRef, Structure*);
     122    // We'd like to use the placement version of operator new defined in JSCell, but
     123    // we can't because Base is a template argument, so we just duplicate the same
     124    // functionality here.
     125    void* operator new(size_t, void* ptr) { return ptr; }
     126
     127public:
     128    static JSCallbackObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, void* data)
     129    {
     130        return new (allocateCell<JSCallbackObject>(*exec->heap())) JSCallbackObject(exec, globalObject, structure, classRef, data);
     131    }
     132    static JSCallbackObject* create(JSGlobalData& globalData, JSClassRef classRef, Structure* structure)
     133    {
     134        return new (allocateCell<JSCallbackObject>(globalData.heap)) JSCallbackObject(globalData, classRef, structure);
     135    }
    122136
    123137    void setPrivate(void* data);
  • trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r88587 r91194  
    561561                if (JSObjectCallAsFunctionCallback callAsFunction = entry->callAsFunction) {
    562562                   
    563                     JSObject* o = new (exec) JSCallbackFunction(exec, asGlobalObject(thisObj->getAnonymousValue(0)), callAsFunction, propertyName);
     563                    JSObject* o = JSCallbackFunction::create(exec, asGlobalObject(thisObj->getAnonymousValue(0)), callAsFunction, propertyName);
    564564                    thisObj->putDirect(exec->globalData(), propertyName, o, entry->attributes);
    565565                    return o;
  • trunk/Source/JavaScriptCore/API/JSClassRef.cpp

    r83751 r91194  
    252252    if (!jsClassData.cachedPrototype) {
    253253        // Recursive, but should be good enough for our purposes
    254         jsClassData.cachedPrototype.set(exec->globalData(), new (exec) JSCallbackObject<JSObjectWithGlobalObject>(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData), 0); // set jsClassData as the object's private data, so it can clear our reference on destruction
     254        jsClassData.cachedPrototype.set(exec->globalData(), JSCallbackObject<JSObjectWithGlobalObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), prototypeClass, &jsClassData), 0); // set jsClassData as the object's private data, so it can clear our reference on destruction
    255255        if (parentClass) {
    256256            if (JSObject* prototype = parentClass->prototype(exec))
  • trunk/Source/JavaScriptCore/API/JSContextRef.cpp

    r86785 r91194  
    9898    }
    9999
    100     JSGlobalObject* globalObject = new (globalData.get()) JSCallbackObject<JSGlobalObject>(*globalData, globalObjectClass, JSCallbackObject<JSGlobalObject>::createStructure(*globalData, jsNull()));
     100    JSGlobalObject* globalObject = JSCallbackObject<JSGlobalObject>::create(*globalData, globalObjectClass, JSCallbackObject<JSGlobalObject>::createStructure(*globalData, jsNull()));
    101101    ExecState* exec = globalObject->globalExec();
    102102    JSValue prototype = globalObjectClass->prototype(exec);
  • trunk/Source/JavaScriptCore/API/JSObjectRef.cpp

    r83751 r91194  
    8282        return toRef(constructEmptyObject(exec));
    8383
    84     JSCallbackObject<JSObjectWithGlobalObject>* object = new (exec) JSCallbackObject<JSObjectWithGlobalObject>(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data);
     84    JSCallbackObject<JSObjectWithGlobalObject>* object = JSCallbackObject<JSObjectWithGlobalObject>::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackObjectStructure(), jsClass, data);
    8585    if (JSObject* prototype = jsClass->prototype(exec))
    8686        object->setPrototype(exec->globalData(), prototype);
     
    9696    Identifier nameID = name ? name->identifier(&exec->globalData()) : Identifier(exec, "anonymous");
    9797   
    98     return toRef(new (exec) JSCallbackFunction(exec, exec->lexicalGlobalObject(), callAsFunction, nameID));
     98    return toRef(JSCallbackFunction::create(exec, exec->lexicalGlobalObject(), callAsFunction, nameID));
    9999}
    100100
     
    108108        jsPrototype = exec->lexicalGlobalObject()->objectPrototype();
    109109
    110     JSCallbackConstructor* constructor = new (exec) JSCallbackConstructor(exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackConstructorStructure(), jsClass, callAsConstructor);
     110    JSCallbackConstructor* constructor = JSCallbackConstructor::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->callbackConstructorStructure(), jsClass, callAsConstructor);
    111111    constructor->putDirect(exec->globalData(), exec->propertyNames().prototype, jsPrototype, DontEnum | DontDelete | ReadOnly);
    112112    return toRef(constructor);
  • trunk/Source/JavaScriptCore/ChangeLog

    r91171 r91194  
     12011-07-18  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Refactor JSC to replace JSCell::operator new with static create method
     4        https://bugs.webkit.org/show_bug.cgi?id=64466
     5
     6        Reviewed by Oliver Hunt (oliver@apple.com) and Darin Adler (darin@apple.com).
     7
     8        First step in a longer refactoring process to remove the use of
     9        operator new overloading in order to allocate GC objects and to replace
     10        this method with static create methods for each individual type of heap-allocated
     11        JS object.  This particular patch only deals with replacing uses of
     12        operator new within JSC proper.  Future patches will remove it from the
     13        parts that interface with the DOM.  Due to the DOM's continued dependence
     14        on it, operator new has not actually been removed from JSCell.
     15
     16        * API/JSCallbackConstructor.h:
     17        (JSC::JSCallbackConstructor::create):
     18        * API/JSCallbackFunction.h:
     19        (JSC::JSCallbackFunction::create):
     20        * API/JSCallbackObject.h:
     21        (JSC::JSCallbackObject::operator new):
     22        (JSC::JSCallbackObject::create):
     23        * API/JSCallbackObjectFunctions.h:
     24        (JSC::::staticFunctionGetter):
     25        * API/JSClassRef.cpp:
     26        (OpaqueJSClass::prototype):
     27        * API/JSContextRef.cpp:
     28        * API/JSObjectRef.cpp:
     29        (JSObjectMake):
     30        (JSObjectMakeFunctionWithCallback):
     31        (JSObjectMakeConstructor):
     32        * JavaScriptCore.exp:
     33        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
     34        * bytecode/CodeBlock.cpp:
     35        (JSC::CodeBlock::createActivation):
     36        * bytecompiler/BytecodeGenerator.cpp:
     37        (JSC::BytecodeGenerator::BytecodeGenerator):
     38        * bytecompiler/BytecodeGenerator.h:
     39        (JSC::BytecodeGenerator::makeFunction):
     40        * bytecompiler/NodesCodegen.cpp:
     41        (JSC::RegExpNode::emitBytecode):
     42        * interpreter/Interpreter.cpp:
     43        (JSC::Interpreter::privateExecute):
     44        (JSC::Interpreter::retrieveArguments):
     45        * jit/JITStubs.cpp:
     46        (JSC::DEFINE_STUB_FUNCTION):
     47        * jsc.cpp:
     48        (GlobalObject::create):
     49        (GlobalObject::GlobalObject):
     50        (functionRun):
     51        (jscmain):
     52        * runtime/Arguments.h:
     53        (JSC::Arguments::create):
     54        (JSC::Arguments::createNoParameters):
     55        * runtime/ArrayConstructor.cpp:
     56        (JSC::constructArrayWithSizeQuirk):
     57        * runtime/ArrayConstructor.h:
     58        (JSC::ArrayConstructor::create):
     59        * runtime/ArrayPrototype.cpp:
     60        (JSC::arrayProtoFuncSplice):
     61        * runtime/ArrayPrototype.h:
     62        (JSC::ArrayPrototype::create):
     63        * runtime/BooleanConstructor.cpp:
     64        (JSC::constructBoolean):
     65        (JSC::constructBooleanFromImmediateBoolean):
     66        * runtime/BooleanConstructor.h:
     67        (JSC::BooleanConstructor::create):
     68        * runtime/BooleanObject.h:
     69        (JSC::BooleanObject::create):
     70        * runtime/BooleanPrototype.h:
     71        (JSC::BooleanPrototype::create):
     72        * runtime/DateConstructor.cpp:
     73        (JSC::constructDate):
     74        * runtime/DateConstructor.h:
     75        (JSC::DateConstructor::create):
     76        * runtime/DateInstance.h:
     77        (JSC::DateInstance::create):
     78        * runtime/DatePrototype.h:
     79        (JSC::DatePrototype::create):
     80        * runtime/Error.cpp:
     81        (JSC::createError):
     82        (JSC::createEvalError):
     83        (JSC::createRangeError):
     84        (JSC::createReferenceError):
     85        (JSC::createSyntaxError):
     86        (JSC::createTypeError):
     87        (JSC::createURIError):
     88        (JSC::StrictModeTypeErrorFunction::create):
     89        (JSC::createTypeErrorFunction):
     90        * runtime/ErrorConstructor.h:
     91        (JSC::ErrorConstructor::create):
     92        * runtime/ErrorInstance.cpp:
     93        (JSC::ErrorInstance::ErrorInstance):
     94        (JSC::ErrorInstance::create):
     95        * runtime/ErrorInstance.h:
     96        * runtime/ErrorPrototype.cpp:
     97        (JSC::ErrorPrototype::ErrorPrototype):
     98        * runtime/ErrorPrototype.h:
     99        (JSC::ErrorPrototype::create):
     100        * runtime/ExceptionHelpers.cpp:
     101        (JSC::InterruptedExecutionError::InterruptedExecutionError):
     102        (JSC::InterruptedExecutionError::create):
     103        (JSC::createInterruptedExecutionException):
     104        (JSC::TerminatedExecutionError::TerminatedExecutionError):
     105        (JSC::TerminatedExecutionError::create):
     106        (JSC::createTerminatedExecutionException):
     107        * runtime/Executable.cpp:
     108        (JSC::FunctionExecutable::FunctionExecutable):
     109        (JSC::FunctionExecutable::fromGlobalCode):
     110        * runtime/Executable.h:
     111        (JSC::ExecutableBase::create):
     112        (JSC::NativeExecutable::create):
     113        (JSC::ScriptExecutable::ScriptExecutable):
     114        (JSC::EvalExecutable::create):
     115        (JSC::ProgramExecutable::create):
     116        (JSC::FunctionExecutable::create):
     117        (JSC::FunctionExecutable::make):
     118        * runtime/FunctionConstructor.cpp:
     119        (JSC::constructFunctionSkippingEvalEnabledCheck):
     120        * runtime/FunctionConstructor.h:
     121        (JSC::FunctionConstructor::create):
     122        * runtime/FunctionPrototype.cpp:
     123        (JSC::FunctionPrototype::addFunctionProperties):
     124        * runtime/FunctionPrototype.h:
     125        (JSC::FunctionPrototype::create):
     126        * runtime/GetterSetter.h:
     127        (JSC::GetterSetter::create):
     128        * runtime/JSAPIValueWrapper.h:
     129        (JSC::JSAPIValueWrapper::create):
     130        (JSC::jsAPIValueWrapper):
     131        * runtime/JSActivation.cpp:
     132        (JSC::JSActivation::argumentsGetter):
     133        * runtime/JSActivation.h:
     134        (JSC::JSActivation::create):
     135        * runtime/JSArray.h:
     136        (JSC::JSArray::create):
     137        * runtime/JSCell.h:
     138        (JSC::JSCell::allocateCell):
     139        * runtime/JSFunction.h:
     140        (JSC::JSFunction::create):
     141        * runtime/JSGlobalObject.cpp:
     142        (JSC::JSGlobalObject::init):
     143        (JSC::JSGlobalObject::reset):
     144        * runtime/JSGlobalObject.h:
     145        (JSC::constructEmptyArray):
     146        (JSC::constructArray):
     147        * runtime/JSNotAnObject.h:
     148        (JSC::JSNotAnObject::create):
     149        * runtime/JSONObject.h:
     150        (JSC::JSONObject::create):
     151        * runtime/JSObject.cpp:
     152        (JSC::JSObject::defineGetter):
     153        (JSC::JSObject::defineSetter):
     154        (JSC::putDescriptor):
     155        * runtime/JSObject.h:
     156        (JSC::JSFinalObject::create):
     157        * runtime/JSPropertyNameIterator.cpp:
     158        (JSC::JSPropertyNameIterator::create):
     159        * runtime/JSPropertyNameIterator.h:
     160        (JSC::JSPropertyNameIterator::create):
     161        * runtime/JSString.cpp:
     162        (JSC::JSString::substringFromRope):
     163        (JSC::JSString::replaceCharacter):
     164        (JSC::StringObject::create):
     165        * runtime/JSString.h:
     166        (JSC::RopeBuilder::JSString):
     167        (JSC::RopeBuilder::create):
     168        (JSC::RopeBuilder::createHasOtherOwner):
     169        (JSC::jsSingleCharacterString):
     170        (JSC::jsSingleCharacterSubstring):
     171        (JSC::jsNontrivialString):
     172        (JSC::jsString):
     173        (JSC::jsSubstring):
     174        (JSC::jsOwnedString):
     175        * runtime/JSValue.cpp:
     176        (JSC::JSValue::toObjectSlowCase):
     177        (JSC::JSValue::synthesizeObject):
     178        (JSC::JSValue::synthesizePrototype):
     179        * runtime/Lookup.cpp:
     180        (JSC::setUpStaticFunctionSlot):
     181        * runtime/MathObject.h:
     182        (JSC::MathObject::create):
     183        * runtime/NativeErrorConstructor.cpp:
     184        (JSC::NativeErrorConstructor::NativeErrorConstructor):
     185        * runtime/NativeErrorConstructor.h:
     186        (JSC::NativeErrorConstructor::create):
     187        * runtime/NativeErrorPrototype.h:
     188        (JSC::NativeErrorPrototype::create):
     189        * runtime/NumberConstructor.cpp:
     190        (JSC::constructWithNumberConstructor):
     191        * runtime/NumberConstructor.h:
     192        (JSC::NumberConstructor::create):
     193        * runtime/NumberObject.cpp:
     194        (JSC::constructNumber):
     195        * runtime/NumberObject.h:
     196        (JSC::NumberObject::create):
     197        * runtime/NumberPrototype.h:
     198        (JSC::NumberPrototype::create):
     199        * runtime/ObjectConstructor.h:
     200        (JSC::ObjectConstructor::create):
     201        * runtime/ObjectPrototype.h:
     202        (JSC::ObjectPrototype::create):
     203        * runtime/Operations.h:
     204        (JSC::jsString):
     205        * runtime/RegExp.cpp:
     206        (JSC::RegExp::RegExp):
     207        (JSC::RegExp::createWithoutCaching):
     208        (JSC::RegExp::create):
     209        * runtime/RegExp.h:
     210        * runtime/RegExpCache.cpp:
     211        (JSC::RegExpCache::lookupOrCreate):
     212        * runtime/RegExpConstructor.cpp:
     213        (JSC::RegExpConstructor::arrayOfMatches):
     214        (JSC::constructRegExp):
     215        * runtime/RegExpConstructor.h:
     216        (JSC::RegExpConstructor::create):
     217        * runtime/RegExpMatchesArray.h:
     218        (JSC::RegExpMatchesArray::create):
     219        * runtime/RegExpObject.h:
     220        (JSC::RegExpObject::create):
     221        * runtime/RegExpPrototype.cpp:
     222        (JSC::regExpProtoFuncCompile):
     223        * runtime/RegExpPrototype.h:
     224        (JSC::RegExpPrototype::create):
     225        * runtime/ScopeChain.h:
     226        (JSC::ScopeChainNode::create):
     227        (JSC::ScopeChainNode::push):
     228        * runtime/SmallStrings.cpp:
     229        (JSC::SmallStrings::createEmptyString):
     230        (JSC::SmallStrings::createSingleCharacterString):
     231        * runtime/StringConstructor.cpp:
     232        (JSC::constructWithStringConstructor):
     233        * runtime/StringConstructor.h:
     234        (JSC::StringConstructor::create):
     235        * runtime/StringObject.h:
     236        (JSC::StringObject::create):
     237        * runtime/StringObjectThatMasqueradesAsUndefined.h:
     238        (JSC::StringObjectThatMasqueradesAsUndefined::create):
     239        * runtime/StringPrototype.cpp:
     240        (JSC::stringProtoFuncMatch):
     241        (JSC::stringProtoFuncSearch):
     242        * runtime/StringPrototype.h:
     243        (JSC::StringPrototype::create):
     244        * runtime/Structure.h:
     245        (JSC::Structure::create):
     246        (JSC::Structure::createStructure):
     247        * runtime/StructureChain.h:
     248        (JSC::StructureChain::create):
     249
    12502011-07-17  Ryuan Choi  <ryuan.choi@samsung.com>
    2251
  • trunk/Source/JavaScriptCore/JavaScriptCore.exp

    r91039 r91194  
    168168__ZN3JSC14JSGlobalObject6s_infoE
    169169__ZN3JSC14JSGlobalObjectD2Ev
    170 __ZN3JSC14JSGlobalObjectnwEmPNS_12JSGlobalDataE
    171170__ZN3JSC14MachineThreads16addCurrentThreadEv
    172171__ZN3JSC14SamplingThread4stopEv
     
    264263__ZN3JSC6JSLock9lockCountEv
    265264__ZN3JSC6JSLockC1EPNS_9ExecStateE
    266 __ZN3JSC6RegExp6createEPNS_12JSGlobalDataERKNS_7UStringENS_11RegExpFlagsE
    267265__ZN3JSC6RegExpD1Ev
     266__ZN3JSC6RegExp6createERNS_12JSGlobalDataERKNS_7UStringENS_11RegExpFlagsE
    268267__ZN3JSC7JSArray13visitChildrenERNS_11SlotVisitorE
    269268__ZN3JSC7JSArray15setSubclassDataEPv
  • trunk/Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def

    r91039 r91194  
    44    ??0CString@WTF@@QAE@PBDI@Z
    55    ??0Collator@WTF@@QAE@PBD@Z
    6     ??0DateInstance@JSC@@QAE@PAVExecState@1@PAVStructure@1@N@Z
     6    ??0DateInstance@JSC@@IAE@PAVExecState@1@PAVStructure@1@N@Z
    77    ??0DefaultGCActivityCallback@JSC@@QAE@PAVHeap@1@@Z
    88    ??0DropAllLocks@JSLock@JSC@@QAE@W4JSLockBehavior@2@@Z
    99    ??0DynamicGlobalObjectScope@JSC@@QAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@@Z 
    1010    ??0InternalFunction@JSC@@IAE@PAVJSGlobalData@1@PAVJSGlobalObject@1@PAVStructure@1@ABVIdentifier@1@@Z
    11     ??0JSArray@JSC@@QAE@AAVJSGlobalData@1@PAVStructure@1@@Z
    12     ??0JSArray@JSC@@QAE@AAVJSGlobalData@1@PAVStructure@1@ABVArgList@1@@Z
     11    ??0JSArray@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@@Z
     12    ??0JSArray@JSC@@IAE@AAVJSGlobalData@1@PAVStructure@1@ABVArgList@1@@Z
    1313    ??0JSByteArray@JSC@@QAE@PAVExecState@1@PAVStructure@1@PAVByteArray@WTF@@@Z
    14     ??0JSFunction@JSC@@QAE@PAVExecState@1@PAVJSGlobalObject@1@PAVStructure@1@HABVIdentifier@1@P6I_J0@Z@Z
     14    ??0JSFunction@JSC@@AAE@PAVExecState@1@PAVJSGlobalObject@1@PAVStructure@1@HABVIdentifier@1@P6I_J0@Z@Z
    1515    ??0JSLock@JSC@@QAE@PAVExecState@1@@Z
    1616    ??0JSObjectWithGlobalObject@JSC@@IAE@AAVJSGlobalData@1@PAVJSGlobalObject@1@PAVStructure@1@@Z
     
    1919    ??0Mutex@WTF@@QAE@XZ
    2020    ??0RefCountedLeakCounter@WTF@@QAE@PBD@Z
    21     ??0RegExpObject@JSC@@QAE@PAVJSGlobalObject@1@PAVStructure@1@PAVRegExp@1@@Z
     21    ??0RegExpObject@JSC@@IAE@PAVJSGlobalObject@1@PAVStructure@1@PAVRegExp@1@@Z
    2222    ??0SHA1@WTF@@QAE@XZ
    23     ??0StringObject@JSC@@QAE@PAVExecState@1@PAVStructure@1@ABVUString@1@@Z
     23    ??0StringObject@JSC@@IAE@PAVExecState@1@PAVStructure@1@ABVUString@1@@Z
    2424    ??0Structure@JSC@@AAE@AAVJSGlobalData@1@VJSValue@1@ABVTypeInfo@1@IPBUClassInfo@1@@Z
    2525    ??0ThreadCondition@WTF@@QAE@XZ
     
    4141    ??1WTFThreadData@WTF@@QAE@XZ
    4242    ??1WeakHandleOwner@JSC@@UAE@XZ
    43     ??2JSGlobalObject@JSC@@SAPAXIPAVJSGlobalData@1@@Z
    4443    ??8JSC@@YA_NABVUString@0@0@Z
    4544    ??8WTF@@YA_NABVCString@0@0@Z
     
    10099    ?create@JSGlobalData@JSC@@SA?AV?$PassRefPtr@VJSGlobalData@JSC@@@WTF@@W4ThreadStackType@2@@Z
    101100    ?create@OpaqueJSString@@SA?AV?$PassRefPtr@UOpaqueJSString@@@WTF@@ABVUString@JSC@@@Z
    102     ?create@RegExp@JSC@@SAPAV12@PAVJSGlobalData@2@ABVUString@2@W4RegExpFlags@2@@Z
     101    ?create@RegExp@JSC@@SAPAV12@AAVJSGlobalData@2@ABVUString@2@W4RegExpFlags@2@@Z
    103102    ?createEmptyString@SmallStrings@JSC@@AAEXPAVJSGlobalData@2@@Z
    104103    ?createError@JSC@@YAPAVJSObject@1@PAVExecState@1@ABVUString@1@@Z
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r91095 r91194  
    17381738    ASSERT(needsFullScopeChain());
    17391739    ASSERT(!callFrame->uncheckedR(activationRegister()).jsValue());
    1740     JSActivation* activation = new (callFrame) JSActivation(callFrame, static_cast<FunctionExecutable*>(ownerExecutable()));
     1740    JSActivation* activation = JSActivation::create(callFrame->globalData(), callFrame, static_cast<FunctionExecutable*>(ownerExecutable()));
    17411741    callFrame->uncheckedR(activationRegister()) = JSValue(activation);
    17421742    callFrame->setScopeChain(callFrame->scopeChain()->push(activation));
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp

    r91164 r91194  
    247247        globalObject->removeDirect(*m_globalData, function->ident()); // Newly declared functions overwrite existing properties.
    248248
    249         JSValue value = new (exec) JSFunction(exec, makeFunction(exec, function), scopeChain);
     249        JSValue value = JSFunction::create(exec, makeFunction(exec, function), scopeChain);
    250250        int index = addGlobalVar(function->ident(), false);
    251251        globalObject->registerAt(index).set(*m_globalData, globalObject, value);
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r91095 r91194  
    480480        FunctionExecutable* makeFunction(JSGlobalData* globalData, FunctionBodyNode* body)
    481481        {
    482             return FunctionExecutable::create(globalData, body->ident(), body->source(), body->usesArguments(), body->parameters(), body->isStrictMode(), body->lineNo(), body->lastLine());
     482            return FunctionExecutable::create(*globalData, body->ident(), body->source(), body->usesArguments(), body->parameters(), body->isStrictMode(), body->lineNo(), body->lastLine());
    483483        }
    484484
  • trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp

    r91095 r91194  
    126126    if (dst == generator.ignoredResult())
    127127        return 0;
    128     return generator.emitNewRegExp(generator.finalDestination(dst), RegExp::create(generator.globalData(), m_pattern.ustring(), regExpFlags(m_flags.ustring())));
     128    return generator.emitNewRegExp(generator.finalDestination(dst), RegExp::create(*generator.globalData(), m_pattern.ustring(), regExpFlags(m_flags.ustring())));
    129129}
    130130
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r91164 r91194  
    16801680            goto vm_throw;
    16811681        }
    1682         callFrame->uncheckedR(dst) = JSValue(new (globalData) RegExpObject(callFrame->lexicalGlobalObject(), callFrame->scopeChain()->globalObject->regExpStructure(), regExp));
     1682        callFrame->uncheckedR(dst) = JSValue(RegExpObject::create(globalData, callFrame->lexicalGlobalObject(), callFrame->scopeChain()->globalObject->regExpStructure(), regExp));
    16831683
    16841684        vPC += OPCODE_LENGTH(op_new_regexp);
     
    34313431        }
    34323432        if (!arguments) {
    3433             Arguments* arguments = new (globalData) Arguments(callFrame);
     3433            Arguments* arguments = Arguments::create(globalData, callFrame);
    34343434            callFrame->uncheckedR(argumentsRegister) = JSValue(arguments);
    34353435            callFrame->uncheckedR(unmodifiedArgumentsRegister(argumentsRegister)) = JSValue(arguments);
     
    45614561        int activationReg = vPC[1].u.operand;
    45624562        if (!callFrame->r(activationReg).jsValue()) {
    4563             JSActivation* activation = new (globalData) JSActivation(callFrame, static_cast<FunctionExecutable*>(codeBlock->ownerExecutable()));
     4563            JSActivation* activation = JSActivation::create(globalData, callFrame, static_cast<FunctionExecutable*>(codeBlock->ownerExecutable()));
    45644564            callFrame->r(activationReg) = JSValue(activation);
    45654565            callFrame->setScopeChain(callFrame->scopeChain()->push(activation));
     
    46524652
    46534653        if (!callFrame->r(dst).jsValue()) {
    4654             Arguments* arguments = new (globalData) Arguments(callFrame);
     4654            Arguments* arguments = Arguments::create(globalData, callFrame);
    46554655            callFrame->uncheckedR(dst) = JSValue(arguments);
    46564656            callFrame->uncheckedR(unmodifiedArgumentsRegister(dst)) = JSValue(arguments);
     
    51145114        if (JSValue arguments = functionCallFrame->uncheckedR(argumentsRegister).jsValue())
    51155115            return arguments;
    5116         JSValue arguments = JSValue(new (callFrame) Arguments(functionCallFrame));
     5116        JSValue arguments = JSValue(Arguments::create(callFrame->globalData(), functionCallFrame));
    51175117        functionCallFrame->r(argumentsRegister) = arguments;
    51185118        functionCallFrame->r(realArgumentsRegister) = arguments;
     
    51205120    }
    51215121
    5122     Arguments* arguments = new (functionCallFrame) Arguments(functionCallFrame);
     5122    Arguments* arguments = Arguments::create(functionCallFrame->globalData(), functionCallFrame);
    51235123    arguments->copyRegisters(functionCallFrame->globalData());
    51245124    return arguments;
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r91164 r91194  
    20532053    STUB_INIT_STACK_FRAME(stackFrame);
    20542054
    2055     JSActivation* activation = new (stackFrame.globalData) JSActivation(stackFrame.callFrame, static_cast<FunctionExecutable*>(stackFrame.callFrame->codeBlock()->ownerExecutable()));
     2055    JSActivation* activation = JSActivation::create(stackFrame.callFrame->globalData(), stackFrame.callFrame, static_cast<FunctionExecutable*>(stackFrame.callFrame->codeBlock()->ownerExecutable()));
    20562056    stackFrame.callFrame->setScopeChain(stackFrame.callFrame->scopeChain()->push(activation));
    20572057    return activation;
     
    21012101    STUB_INIT_STACK_FRAME(stackFrame);
    21022102
    2103     Arguments* arguments = new (stackFrame.globalData) Arguments(stackFrame.callFrame);
     2103    Arguments* arguments = Arguments::create(*stackFrame.globalData, stackFrame.callFrame);
    21042104    return JSValue::encode(JSValue(arguments));
    21052105}
     
    21092109    STUB_INIT_STACK_FRAME(stackFrame);
    21102110
    2111     Arguments* arguments = new (stackFrame.globalData) Arguments(stackFrame.callFrame, Arguments::NoParameters);
     2111    Arguments* arguments = Arguments::createNoParameters(*stackFrame.globalData, stackFrame.callFrame);
    21122112    return JSValue::encode(JSValue(arguments));
    21132113}
     
    31613161    }
    31623162
    3163     return new (stackFrame.globalData) RegExpObject(stackFrame.callFrame->lexicalGlobalObject(), stackFrame.callFrame->lexicalGlobalObject()->regExpStructure(), regExp);
     3163    return RegExpObject::create(*stackFrame.globalData, stackFrame.callFrame->lexicalGlobalObject(), stackFrame.callFrame->lexicalGlobalObject()->regExpStructure(), regExp);
    31643164}
    31653165
  • trunk/Source/JavaScriptCore/jsc.cpp

    r89887 r91194  
    144144
    145145class GlobalObject : public JSGlobalObject {
     146private:
     147    GlobalObject(JSGlobalData&, Structure*, const Vector<UString>& arguments);
     148
    146149public:
    147     GlobalObject(JSGlobalData&, Structure*, const Vector<UString>& arguments);
     150    static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
     151    {
     152        return new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure, arguments);
     153    }
    148154    virtual UString className() const { return "global"; }
    149155};
     
    154160    : JSGlobalObject(globalData, structure)
    155161{
    156     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "debug"), functionDebug));
    157     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "print"), functionPrint));
    158     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 0, Identifier(globalExec(), "quit"), functionQuit));
    159     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 0, Identifier(globalExec(), "gc"), functionGC));
     162    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "debug"), functionDebug));
     163    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "print"), functionPrint));
     164    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 0, Identifier(globalExec(), "quit"), functionQuit));
     165    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 0, Identifier(globalExec(), "gc"), functionGC));
    160166#ifndef NDEBUG
    161     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 0, Identifier(globalExec(), "releaseExecutableMemory"), functionReleaseExecutableMemory));
    162 #endif
    163     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "version"), functionVersion));
    164     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "run"), functionRun));
    165     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "load"), functionLoad));
    166     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "checkSyntax"), functionCheckSyntax));
    167     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 0, Identifier(globalExec(), "readline"), functionReadline));
     167    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 0, Identifier(globalExec(), "releaseExecutableMemory"), functionReleaseExecutableMemory));
     168#endif
     169    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "version"), functionVersion));
     170    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "run"), functionRun));
     171    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "load"), functionLoad));
     172    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "checkSyntax"), functionCheckSyntax));
     173    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 0, Identifier(globalExec(), "readline"), functionReadline));
    168174
    169175#if ENABLE(SAMPLING_FLAGS)
    170     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "setSamplingFlags"), functionSetSamplingFlags));
    171     putDirectFunction(globalExec(), new (globalExec()) JSFunction(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "clearSamplingFlags"), functionClearSamplingFlags));
     176    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "setSamplingFlags"), functionSetSamplingFlags));
     177    putDirectFunction(globalExec(), JSFunction::create(globalExec(), this, functionStructure(), 1, Identifier(globalExec(), "clearSamplingFlags"), functionClearSamplingFlags));
    172178#endif
    173179
     
    228234        return JSValue::encode(throwError(exec, createError(exec, "Could not open file.")));
    229235
    230     GlobalObject* globalObject = new (&exec->globalData()) GlobalObject(exec->globalData(), GlobalObject::createStructure(exec->globalData(), jsNull()), Vector<UString>());
     236    GlobalObject* globalObject = GlobalObject::create(exec->globalData(), GlobalObject::createStructure(exec->globalData(), jsNull()), Vector<UString>());
    231237
    232238    StopWatch stopWatch;
     
    553559    parseArguments(argc, argv, options, globalData);
    554560
    555     GlobalObject* globalObject = new (globalData) GlobalObject(*globalData, GlobalObject::createStructure(*globalData, jsNull()), options.arguments);
     561    GlobalObject* globalObject = GlobalObject::create(*globalData, GlobalObject::createStructure(*globalData, jsNull()), options.arguments);
    556562    bool success = runWithScripts(globalObject, options.scripts, options.dump);
    557563    if (options.interactive && success)
  • trunk/Source/JavaScriptCore/runtime/Arguments.h

    r84556 r91194  
    6060    class Arguments : public JSNonFinalObject {
    6161    public:
     62        static Arguments* create(JSGlobalData& globalData, CallFrame* callFrame)
     63        {
     64            return new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame);
     65        }
     66       
     67        static Arguments* createNoParameters(JSGlobalData& globalData, CallFrame* callFrame)
     68        {
     69            return new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame, NoParameters);
     70        }
     71
    6272        // Use an enum because otherwise gcc insists on doing a memory
    6373        // read.
    6474        enum { MaxArguments = 0x10000 };
    6575
     76    private:
    6677        enum NoParametersType { NoParameters };
    67 
     78       
    6879        Arguments(CallFrame*);
    6980        Arguments(CallFrame*, NoParametersType);
     81
     82    public:
    7083        virtual ~Arguments();
    7184
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.cpp

    r86727 r91194  
    8080        if (n != args.at(0).toNumber(exec))
    8181            return throwError(exec, createRangeError(exec, "Array size is not a small enough positive integer."));
    82         return new (exec) JSArray(exec->globalData(), globalObject->arrayStructure(), n, CreateInitialized);
     82        return JSArray::create(exec->globalData(), globalObject->arrayStructure(), n, CreateInitialized);
    8383    }
    8484
    8585    // otherwise the array is constructed with the arguments in it
    86     return new (exec) JSArray(exec->globalData(), globalObject->arrayStructure(), args);
     86    return JSArray::create(exec->globalData(), globalObject->arrayStructure(), args);
    8787}
    8888
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h

    r86727 r91194  
    2929
    3030    class ArrayConstructor : public InternalFunction {
     31    private:
     32        ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*);
     33       
    3134    public:
    32         ArrayConstructor(ExecState*, JSGlobalObject*, Structure*, ArrayPrototype*);
     35        static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrPrototype)
     36        {
     37            return new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(exec, globalObject, structure, arrPrototype);
     38        }
    3339
    3440        static const ClassInfo s_info;
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp

    r88506 r91194  
    583583    }
    584584
    585     JSArray* resObj = new (exec) JSArray(exec->globalData(), exec->lexicalGlobalObject()->arrayStructure(), deleteCount, CreateCompact);
     585    JSArray* resObj = JSArray::create(exec->globalData(), exec->lexicalGlobalObject()->arrayStructure(), deleteCount, CreateCompact);
    586586    JSValue result = resObj;
    587587    JSGlobalData& globalData = exec->globalData();
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h

    r86727 r91194  
    2828
    2929    class ArrayPrototype : public JSArray {
     30    private:
     31        ArrayPrototype(JSGlobalObject*, Structure*);
     32
    3033    public:
    31         explicit ArrayPrototype(JSGlobalObject*, Structure*);
    32 
     34        static ArrayPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     35        {
     36            return new (allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure);
     37        }
     38       
    3339        bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    3440        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.cpp

    r84052 r91194  
    4141JSObject* constructBoolean(ExecState* exec, const ArgList& args)
    4242{
    43     BooleanObject* obj = new (exec) BooleanObject(exec->globalData(), asInternalFunction(exec->callee())->globalObject()->booleanObjectStructure());
     43    BooleanObject* obj = BooleanObject::create(exec->globalData(), asInternalFunction(exec->callee())->globalObject()->booleanObjectStructure());
    4444    obj->setInternalValue(exec->globalData(), jsBoolean(args.at(0).toBoolean(exec)));
    4545    return obj;
     
    7272JSObject* constructBooleanFromImmediateBoolean(ExecState* exec, JSGlobalObject* globalObject, JSValue immediateBooleanValue)
    7373{
    74     BooleanObject* obj = new (exec) BooleanObject(exec->globalData(), globalObject->booleanObjectStructure());
     74    BooleanObject* obj = BooleanObject::create(exec->globalData(), globalObject->booleanObjectStructure());
    7575    obj->setInternalValue(exec->globalData(), immediateBooleanValue);
    7676    return obj;
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h

    r84052 r91194  
    2929
    3030    class BooleanConstructor : public InternalFunction {
     31    private:
     32        BooleanConstructor(ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*);
     33       
    3134    public:
    32         BooleanConstructor(ExecState*, JSGlobalObject*, Structure*, BooleanPrototype*);
     35        static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* boolPrototype)
     36        {
     37            return new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(exec, globalObject, structure, boolPrototype);
     38        }
    3339
    3440    private:
  • trunk/Source/JavaScriptCore/runtime/BooleanObject.h

    r84052 r91194  
    2727
    2828    class BooleanObject : public JSWrapperObject {
     29    protected:
     30        BooleanObject(JSGlobalData&, Structure*);
     31
    2932    public:
    30         explicit BooleanObject(JSGlobalData&, Structure*);
    31 
     33        static BooleanObject* create(JSGlobalData& globalData, Structure* structure)
     34        {
     35            return new (allocateCell<BooleanObject>(globalData.heap)) BooleanObject(globalData, structure);
     36        }
     37       
    3238        static const ClassInfo s_info;
    3339       
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h

    r86727 r91194  
    2727
    2828    class BooleanPrototype : public BooleanObject {
    29     public:
     29    private:
    3030        BooleanPrototype(ExecState*, JSGlobalObject*, Structure*);
    3131
     32    public:
     33        static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     34        {
     35            return new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, globalObject, structure);
     36        }
     37       
    3238        static const ClassInfo s_info;
    3339
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.cpp

    r88587 r91194  
    143143    }
    144144
    145     return new (exec) DateInstance(exec, globalObject->dateStructure(), value);
     145    return DateInstance::create(exec, globalObject->dateStructure(), value);
    146146}
    147147   
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.h

    r86727 r91194  
    2929
    3030    class DateConstructor : public InternalFunction {
     31    private:
     32        DateConstructor(ExecState*, JSGlobalObject*, Structure*, DatePrototype*);
     33       
    3134    public:
    32         DateConstructor(ExecState*, JSGlobalObject*, Structure*, DatePrototype*);
     35        static DateConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
     36        {
     37            return new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(exec, globalObject, structure, datePrototype);
     38        }
    3339
    3440        static const ClassInfo s_info;
  • trunk/Source/JavaScriptCore/runtime/DateInstance.h

    r84052 r91194  
    3131
    3232    class DateInstance : public JSWrapperObject {
     33    protected:
     34        DateInstance(ExecState*, Structure*, double);
     35        DateInstance(ExecState*, Structure*);
     36       
    3337    public:
    34         DateInstance(ExecState*, Structure*, double);
    35         explicit DateInstance(ExecState*, Structure*);
    36 
     38        static DateInstance* create(ExecState* exec, Structure* structure, double date)
     39        {
     40            return new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure, date);
     41        }
     42        static DateInstance* create(ExecState* exec, Structure* structure)
     43        {
     44            return new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
     45        }
     46       
    3747        double internalNumber() const { return internalValue().uncheckedGetNumber(); }
    3848
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.h

    r84052 r91194  
    2929
    3030    class DatePrototype : public DateInstance {
    31     public:
     31    private:
    3232        DatePrototype(ExecState*, JSGlobalObject*, Structure*);
    3333
     34    public:
     35        static DatePrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     36        {
     37            return new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, globalObject, structure);
     38        }
    3439        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    3540        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/Error.cpp

    r84052 r91194  
    4343{
    4444    ASSERT(!message.isEmpty());
    45     return ErrorInstance::create(&globalObject->globalData(), globalObject->errorStructure(), message);
     45    return ErrorInstance::create(globalObject->globalData(), globalObject->errorStructure(), message);
    4646}
    4747
     
    4949{
    5050    ASSERT(!message.isEmpty());
    51     return ErrorInstance::create(&globalObject->globalData(), globalObject->evalErrorConstructor()->errorStructure(), message);
     51    return ErrorInstance::create(globalObject->globalData(), globalObject->evalErrorConstructor()->errorStructure(), message);
    5252}
    5353
     
    5555{
    5656    ASSERT(!message.isEmpty());
    57     return ErrorInstance::create(&globalObject->globalData(), globalObject->rangeErrorConstructor()->errorStructure(), message);
     57    return ErrorInstance::create(globalObject->globalData(), globalObject->rangeErrorConstructor()->errorStructure(), message);
    5858}
    5959
     
    6161{
    6262    ASSERT(!message.isEmpty());
    63     return ErrorInstance::create(&globalObject->globalData(), globalObject->referenceErrorConstructor()->errorStructure(), message);
     63    return ErrorInstance::create(globalObject->globalData(), globalObject->referenceErrorConstructor()->errorStructure(), message);
    6464}
    6565
     
    6767{
    6868    ASSERT(!message.isEmpty());
    69     return ErrorInstance::create(&globalObject->globalData(), globalObject->syntaxErrorConstructor()->errorStructure(), message);
     69    return ErrorInstance::create(globalObject->globalData(), globalObject->syntaxErrorConstructor()->errorStructure(), message);
    7070}
    7171
     
    7373{
    7474    ASSERT(!message.isEmpty());
    75     return ErrorInstance::create(&globalObject->globalData(), globalObject->typeErrorConstructor()->errorStructure(), message);
     75    return ErrorInstance::create(globalObject->globalData(), globalObject->typeErrorConstructor()->errorStructure(), message);
    7676}
    7777
     
    7979{
    8080    ASSERT(!message.isEmpty());
    81     return ErrorInstance::create(&globalObject->globalData(), globalObject->URIErrorConstructor()->errorStructure(), message);
     81    return ErrorInstance::create(globalObject->globalData(), globalObject->URIErrorConstructor()->errorStructure(), message);
    8282}
    8383
     
    167167
    168168class StrictModeTypeErrorFunction : public InternalFunction {
    169 public:
     169private:
    170170    StrictModeTypeErrorFunction(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
    171171        : InternalFunction(&exec->globalData(), globalObject, structure, exec->globalData().propertyNames->emptyIdentifier)
     
    173173    {
    174174    }
     175
     176public:
     177    static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
     178    {
     179        return new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(exec, globalObject, structure, message);
     180    }
    175181   
    176182    static EncodedJSValue JSC_HOST_CALL constructThrowTypeError(ExecState* exec)
     
    206212JSValue createTypeErrorFunction(ExecState* exec, const UString& message)
    207213{
    208     return new (exec) StrictModeTypeErrorFunction(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->internalFunctionStructure(), message);
     214    return StrictModeTypeErrorFunction::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->internalFunctionStructure(), message);
    209215}
    210216
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h

    r84052 r91194  
    3030
    3131    class ErrorConstructor : public InternalFunction {
    32     public:
     32    private:
    3333        ErrorConstructor(ExecState*, JSGlobalObject*, Structure*, ErrorPrototype*);
    3434
     35    public:
     36        static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errPrototype)
     37        {
     38            return new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(exec, globalObject, structure, errPrototype);
     39        }
     40       
    3541    private:
    3642        virtual ConstructType getConstructData(ConstructData&);
  • trunk/Source/JavaScriptCore/runtime/ErrorInstance.cpp

    r88559 r91194  
    2626const ClassInfo ErrorInstance::s_info = { "Error", &JSNonFinalObject::s_info, 0, 0 };
    2727
    28 ErrorInstance::ErrorInstance(JSGlobalData* globalData, Structure* structure)
    29     : JSNonFinalObject(*globalData, structure)
     28ErrorInstance::ErrorInstance(JSGlobalData& globalData, Structure* structure)
     29    : JSNonFinalObject(globalData, structure)
    3030    , m_appendSourceToMessage(false)
    3131{
    3232    ASSERT(inherits(&s_info));
    33     putDirect(*globalData, globalData->propertyNames->message, jsString(globalData, ""), DontEnum);
     33    putDirect(globalData, globalData.propertyNames->message, jsString(&globalData, ""), DontEnum);
    3434}
    3535
    36 ErrorInstance::ErrorInstance(JSGlobalData* globalData, Structure* structure, const UString& message)
    37     : JSNonFinalObject(*globalData, structure)
     36ErrorInstance::ErrorInstance(JSGlobalData& globalData, Structure* structure, const UString& message)
     37    : JSNonFinalObject(globalData, structure)
    3838    , m_appendSourceToMessage(false)
    3939{
    4040    ASSERT(inherits(&s_info));
    41     putDirect(*globalData, globalData->propertyNames->message, jsString(globalData, message), DontEnum);
     41    putDirect(globalData, globalData.propertyNames->message, jsString(&globalData, message), DontEnum);
    4242}
    4343
    44 ErrorInstance* ErrorInstance::create(JSGlobalData* globalData, Structure* structure, const UString& message)
     44ErrorInstance* ErrorInstance::create(JSGlobalData& globalData, Structure* structure, const UString& message)
    4545{
    46     return new (globalData) ErrorInstance(globalData, structure, message);
     46    return new (allocateCell<ErrorInstance>(globalData.heap)) ErrorInstance(globalData, structure, message);
    4747}
    4848
     
    5050{
    5151    if (message.isUndefined())
    52         return new (exec) ErrorInstance(&exec->globalData(), structure);
    53     return new (exec) ErrorInstance(&exec->globalData(), structure, message.toString(exec));
     52        return new (allocateCell<ErrorInstance>(*exec->heap())) ErrorInstance(exec->globalData(), structure);
     53    return new (allocateCell<ErrorInstance>(*exec->heap())) ErrorInstance(exec->globalData(), structure, message.toString(exec));
    5454}
    5555
  • trunk/Source/JavaScriptCore/runtime/ErrorInstance.h

    r84052 r91194  
    3535        }
    3636
    37         static ErrorInstance* create(JSGlobalData*, Structure*, const UString&);
     37        static ErrorInstance* create(JSGlobalData&, Structure*, const UString&);
    3838        static ErrorInstance* create(ExecState*, Structure*, JSValue message);
    3939
     
    4646
    4747    protected:
    48         explicit ErrorInstance(JSGlobalData*, Structure*);
    49         explicit ErrorInstance(JSGlobalData*, Structure*, const UString&);
     48        explicit ErrorInstance(JSGlobalData&, Structure*);
     49        explicit ErrorInstance(JSGlobalData&, Structure*, const UString&);
    5050
    5151        bool m_appendSourceToMessage;
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.cpp

    r91116 r91194  
    5252
    5353ErrorPrototype::ErrorPrototype(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    54     : ErrorInstance(&exec->globalData(), structure)
     54    : ErrorInstance(exec->globalData(), structure)
    5555{
    5656    putDirect(exec->globalData(), exec->propertyNames().name, jsNontrivialString(exec, "Error"), DontEnum);
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h

    r86727 r91194  
    2929
    3030    class ErrorPrototype : public ErrorInstance {
    31     public:
     31    protected:
    3232        ErrorPrototype(ExecState*, JSGlobalObject*, Structure*);
    3333
     34    public:
     35        static ErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     36        {
     37            return new (allocateCell<ErrorPrototype>(*exec->heap())) ErrorPrototype(exec, globalObject, structure);
     38        }
     39       
    3440        static const ClassInfo s_info;
    3541
  • trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp

    r84052 r91194  
    4343
    4444class InterruptedExecutionError : public JSNonFinalObject {
     45private:
     46    InterruptedExecutionError(JSGlobalData& globalData)
     47        : JSNonFinalObject(globalData, globalData.interruptedExecutionErrorStructure.get())
     48    {
     49    }
     50
    4551public:
    46     InterruptedExecutionError(JSGlobalData* globalData)
    47         : JSNonFinalObject(*globalData, globalData->interruptedExecutionErrorStructure.get())
     52    static InterruptedExecutionError* create(JSGlobalData& globalData)
    4853    {
     54        return new (allocateCell<InterruptedExecutionError>(globalData.heap)) InterruptedExecutionError(globalData);
    4955    }
    5056
     
    5662JSObject* createInterruptedExecutionException(JSGlobalData* globalData)
    5763{
    58     return new (globalData) InterruptedExecutionError(globalData);
     64    return InterruptedExecutionError::create(*globalData);
    5965}
    6066
    6167class TerminatedExecutionError : public JSNonFinalObject {
     68private:
     69    TerminatedExecutionError(JSGlobalData& globalData)
     70        : JSNonFinalObject(globalData, globalData.terminatedExecutionErrorStructure.get())
     71    {
     72    }
     73
    6274public:
    63     TerminatedExecutionError(JSGlobalData* globalData)
    64         : JSNonFinalObject(*globalData, globalData->terminatedExecutionErrorStructure.get())
     75    static TerminatedExecutionError* create(JSGlobalData& globalData)
    6576    {
     77        return new (allocateCell<TerminatedExecutionError>(globalData.heap)) TerminatedExecutionError(globalData);
    6678    }
    6779
     
    7385JSObject* createTerminatedExecutionException(JSGlobalData* globalData)
    7486{
    75     return new (globalData) TerminatedExecutionError(globalData);
     87    return TerminatedExecutionError::create(*globalData);
    7688}
    7789
  • trunk/Source/JavaScriptCore/runtime/Executable.cpp

    r91115 r91194  
    9191const ClassInfo FunctionExecutable::s_info = { "FunctionExecutable", &ScriptExecutable::s_info, 0, 0 };
    9292
    93 FunctionExecutable::FunctionExecutable(JSGlobalData* globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool inStrictContext, int firstLine, int lastLine)
    94     : ScriptExecutable(globalData->functionExecutableStructure.get(), globalData, source, inStrictContext)
     93FunctionExecutable::FunctionExecutable(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool inStrictContext, int firstLine, int lastLine)
     94    : ScriptExecutable(globalData.functionExecutableStructure.get(), globalData, source, inStrictContext)
    9595    , m_numCapturedVariables(0)
    9696    , m_forceUsesArguments(forceUsesArguments)
     
    485485    ASSERT(body);
    486486
    487     return FunctionExecutable::create(&exec->globalData(), functionName, body->source(), body->usesArguments(), body->parameters(), body->isStrictMode(), body->lineNo(), body->lastLine());
     487    return FunctionExecutable::create(exec->globalData(), functionName, body->source(), body->usesArguments(), body->parameters(), body->isStrictMode(), body->lineNo(), body->lastLine());
    488488}
    489489
  • trunk/Source/JavaScriptCore/runtime/Executable.h

    r90938 r91194  
    5353        static const int NUM_PARAMETERS_IS_HOST = 0;
    5454        static const int NUM_PARAMETERS_NOT_COMPILED = -1;
    55    
    56     public:
     55
     56    protected:
    5757        ExecutableBase(JSGlobalData& globalData, Structure* structure, int numParameters)
    5858            : JSCell(globalData, structure)
     
    6464            finalizer.leakHandle();
    6565#endif
     66        }
     67       
     68    public:
     69        static ExecutableBase* create(JSGlobalData& globalData, Structure* structure, int numParameters)
     70        {
     71            return new (allocateCell<ExecutableBase>(globalData.heap)) ExecutableBase(globalData, structure, numParameters);
    6672        }
    6773
     
    167173        {
    168174            if (!callThunk)
    169                 return new (&globalData) NativeExecutable(globalData, JITCode(), function, JITCode(), constructor);
    170             return new (&globalData) NativeExecutable(globalData, JITCode::HostFunction(callThunk), function, JITCode::HostFunction(constructThunk), constructor);
     175                return new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, JITCode(), function, JITCode(), constructor);
     176            return new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, JITCode::HostFunction(callThunk), function, JITCode::HostFunction(constructThunk), constructor);
    171177        }
    172178#else
    173179        static NativeExecutable* create(JSGlobalData& globalData, NativeFunction function, NativeFunction constructor)
    174180        {
    175             return new (&globalData) NativeExecutable(globalData, function, constructor);
     181            return new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
    176182        }
    177183#endif
     
    214220    class ScriptExecutable : public ExecutableBase {
    215221    public:
    216         ScriptExecutable(Structure* structure, JSGlobalData* globalData, const SourceCode& source, bool isInStrictContext)
    217             : ExecutableBase(*globalData, structure, NUM_PARAMETERS_NOT_COMPILED)
     222        ScriptExecutable(Structure* structure, JSGlobalData& globalData, const SourceCode& source, bool isInStrictContext)
     223            : ExecutableBase(globalData, structure, NUM_PARAMETERS_NOT_COMPILED)
    218224            , m_source(source)
    219225            , m_features(isInStrictContext ? StrictModeFeature : 0)
    220226        {
    221227#if ENABLE(CODEBLOCK_SAMPLING)
    222             if (SamplingTool* sampler = globalData->interpreter->sampler())
     228            if (SamplingTool* sampler = globalData.interpreter->sampler())
    223229                sampler->notifyOfScope(*globalData, this);
    224230#else
     
    291297        }
    292298
    293         static EvalExecutable* create(ExecState* exec, const SourceCode& source, bool isInStrictContext) { return new (exec) EvalExecutable(exec, source, isInStrictContext); }
     299        static EvalExecutable* create(ExecState* exec, const SourceCode& source, bool isInStrictContext)
     300        {
     301            return new (allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext);
     302        }
    294303
    295304#if ENABLE(JIT)
     
    320329        static ProgramExecutable* create(ExecState* exec, const SourceCode& source)
    321330        {
    322             return new (exec) ProgramExecutable(exec, source);
     331            return new (allocateCell<ProgramExecutable>(*exec->heap())) ProgramExecutable(exec, source);
    323332        }
    324333
     
    373382        static FunctionExecutable* create(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
    374383        {
    375             return new (exec) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine);
    376         }
    377 
    378         static FunctionExecutable* create(JSGlobalData* globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
    379         {
    380             return new (globalData) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine);
     384            return new (allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine);
     385        }
     386
     387        static FunctionExecutable* create(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
     388        {
     389            return new (allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext, firstLine, lastLine);
    381390        }
    382391
    383392        JSFunction* make(ExecState* exec, ScopeChainNode* scopeChain)
    384393        {
    385             return new (exec) JSFunction(exec, this, scopeChain);
     394            return JSFunction::create(exec, this, scopeChain);
    386395        }
    387396       
     
    480489
    481490    private:
    482         FunctionExecutable(JSGlobalData*, const Identifier& name, const SourceCode&, bool forceUsesArguments, FunctionParameters*, bool, int firstLine, int lastLine);
     491        FunctionExecutable(JSGlobalData&, const Identifier& name, const SourceCode&, bool forceUsesArguments, FunctionParameters*, bool, int firstLine, int lastLine);
    483492        FunctionExecutable(ExecState*, const Identifier& name, const SourceCode&, bool forceUsesArguments, FunctionParameters*, bool, int firstLine, int lastLine);
    484493
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.cpp

    r86837 r91194  
    113113    }
    114114
    115     ScopeChainNode* scopeChain = new (exec) ScopeChainNode(0, globalObject, &globalData, globalObject, exec->globalThisValue());
    116     return new (exec) JSFunction(exec, function, scopeChain);
     115    ScopeChainNode* scopeChain = ScopeChainNode::create(exec, 0, globalObject, &globalData, globalObject, exec->globalThisValue());
     116    return JSFunction::create(exec, function, scopeChain);
    117117}
    118118
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.h

    r86100 r91194  
    2929
    3030    class FunctionConstructor : public InternalFunction {
     31    private:
     32        FunctionConstructor(ExecState*, JSGlobalObject*, Structure*, FunctionPrototype*);
     33   
    3134    public:
    32         FunctionConstructor(ExecState*, JSGlobalObject*, Structure*, FunctionPrototype*);
     35        static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* funcPrototype)
     36        {
     37            return new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(exec, globalObject, structure, funcPrototype);
     38        }
    3339
    3440    private:
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.cpp

    r84052 r91194  
    4646void FunctionPrototype::addFunctionProperties(ExecState* exec, JSGlobalObject* globalObject, Structure* functionStructure, JSFunction** callFunction, JSFunction** applyFunction)
    4747{
    48     putDirectFunctionWithoutTransition(exec, new (exec) JSFunction(exec, globalObject, functionStructure, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum);
    49     *applyFunction = new (exec) JSFunction(exec, globalObject, functionStructure, 2, exec->propertyNames().apply, functionProtoFuncApply);
     48    putDirectFunctionWithoutTransition(exec, JSFunction::create(exec, globalObject, functionStructure, 0, exec->propertyNames().toString, functionProtoFuncToString), DontEnum);
     49    *applyFunction = JSFunction::create(exec, globalObject, functionStructure, 2, exec->propertyNames().apply, functionProtoFuncApply);
    5050    putDirectFunctionWithoutTransition(exec, *applyFunction, DontEnum);
    51     *callFunction = new (exec) JSFunction(exec, globalObject, functionStructure, 1, exec->propertyNames().call, functionProtoFuncCall);
     51    *callFunction = JSFunction::create(exec, globalObject, functionStructure, 1, exec->propertyNames().call, functionProtoFuncCall);
    5252    putDirectFunctionWithoutTransition(exec, *callFunction, DontEnum);
    5353}
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.h

    r84052 r91194  
    2727
    2828    class FunctionPrototype : public InternalFunction {
     29    private:
     30        FunctionPrototype(ExecState*, JSGlobalObject*, Structure*);
     31
    2932    public:
    30         FunctionPrototype(ExecState*, JSGlobalObject*, Structure*);
     33        static FunctionPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     34        {
     35            return new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(exec, globalObject, structure);
     36        }
     37       
    3138        void addFunctionProperties(ExecState*, JSGlobalObject*, Structure* functionStructure, JSFunction** callFunction, JSFunction** applyFunction);
    32 
     39       
    3340        static Structure* createStructure(JSGlobalData& globalData, JSValue proto)
    3441        {
  • trunk/Source/JavaScriptCore/runtime/GetterSetter.h

    r86499 r91194  
    3737    class GetterSetter : public JSCell {
    3838        friend class JIT;
    39     public:
     39
     40    private:       
    4041        GetterSetter(ExecState* exec)
    4142            : JSCell(exec->globalData(), exec->globalData().getterSetterStructure.get())
    4243        {
     44        }
     45
     46    public:
     47        static GetterSetter* create(ExecState* exec)
     48        {
     49            return new (allocateCell<GetterSetter>(*exec->heap())) GetterSetter(exec);
    4350        }
    4451
  • trunk/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h

    r86499 r91194  
    4343       
    4444        static const ClassInfo s_info;
     45       
     46        static JSAPIValueWrapper* create(ExecState* exec, JSValue value)
     47        {
     48            return new (allocateCell<JSAPIValueWrapper>(*exec->heap())) JSAPIValueWrapper(exec, value);
     49        }
    4550
    4651    private:
     
    5762    inline JSValue jsAPIValueWrapper(ExecState* exec, JSValue value)
    5863    {
    59         return new (exec) JSAPIValueWrapper(exec, value);
     64        return JSAPIValueWrapper::create(exec, value);
    6065    }
    6166
  • trunk/Source/JavaScriptCore/runtime/JSActivation.cpp

    r87316 r91194  
    221221    int realArgumentsRegister = unmodifiedArgumentsRegister(argumentsRegister);
    222222
    223     JSValue arguments = JSValue(new (callFrame) Arguments(callFrame));
     223    JSValue arguments = JSValue(Arguments::create(callFrame->globalData(), callFrame));
    224224    callFrame->uncheckedR(argumentsRegister) = arguments;
    225225    callFrame->uncheckedR(realArgumentsRegister) = arguments;
  • trunk/Source/JavaScriptCore/runtime/JSActivation.h

    r91095 r91194  
    4141   
    4242    class JSActivation : public JSVariableObject {
     43    private:
    4344        typedef JSVariableObject Base;
     45        JSActivation(CallFrame*, FunctionExecutable*);
     46   
    4447    public:
    45         JSActivation(CallFrame*, FunctionExecutable*);
     48        static JSActivation* create(JSGlobalData& globalData, CallFrame* callFrame, FunctionExecutable* funcExec)
     49        {
     50            return new (allocateCell<JSActivation>(globalData.heap)) JSActivation(callFrame, funcExec);
     51        }
     52
    4653        virtual ~JSActivation();
    4754
  • trunk/Source/JavaScriptCore/runtime/JSArray.h

    r87316 r91194  
    6161        friend class Walker;
    6262
    63     public:
    64         JSArray(VPtrStealingHackType);
    65 
     63    protected:
    6664        explicit JSArray(JSGlobalData&, Structure*);
    6765        JSArray(JSGlobalData&, Structure*, unsigned initialLength, ArrayCreationMode);
    6866        JSArray(JSGlobalData&, Structure*, const ArgList& initialValues);
     67       
     68    public:
     69        JSArray(VPtrStealingHackType);
    6970        virtual ~JSArray();
    7071
     72        static JSArray* create(JSGlobalData& globalData, Structure* structure)
     73        {
     74            return new (allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure);
     75        }
     76       
     77        static JSArray* create(JSGlobalData& globalData, Structure* structure, unsigned initialLength, ArrayCreationMode createMode)
     78        {
     79            return new (allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure, initialLength, createMode);
     80        }
     81       
     82        static JSArray* create(JSGlobalData& globalData, Structure* structure, const ArgList& initialValues)
     83        {
     84            return new (allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure, initialValues);
     85        }
     86       
    7187        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
    7288        virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r91164 r91194  
    382382    }
    383383
     384    template <typename T> void* allocateCell(Heap& heap)
     385    {
     386        return heap.allocate(sizeof(T));
     387    }
     388       
    384389} // namespace JSC
    385390
  • trunk/Source/JavaScriptCore/runtime/JSFunction.h

    r90437 r91194  
    4949        typedef JSObjectWithGlobalObject Base;
    5050
    51     public:
    5251        JSFunction(ExecState*, JSGlobalObject*, Structure*, int length, const Identifier&, NativeFunction);
    5352        JSFunction(ExecState*, JSGlobalObject*, Structure*, int length, const Identifier&, NativeExecutable*);
    5453        JSFunction(ExecState*, FunctionExecutable*, ScopeChainNode*);
     54       
     55    public:
     56        static JSFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, int length, const Identifier& ident, NativeFunction nativeFunc)
     57        {
     58            return new (allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, globalObject, structure, length, ident, nativeFunc);
     59        }
     60        static JSFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, int length, const Identifier& ident, NativeExecutable* nativeExec)
     61        {
     62            return new (allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, globalObject, structure, length, ident, nativeExec);
     63        }
     64        static JSFunction* create(ExecState* exec, FunctionExecutable* funcExec, ScopeChainNode* scopeChain)
     65        {
     66            return new (allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, funcExec, scopeChain);
     67        }
     68       
    5569        virtual ~JSFunction();
    5670
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r89465 r91194  
    125125
    126126    m_globalData = Heap::heap(this)->globalData();
    127     m_globalScopeChain.set(*m_globalData, this, new (m_globalData.get()) ScopeChainNode(0, this, m_globalData.get(), this, thisValue));
     127    m_globalScopeChain.set(*m_globalData, this, ScopeChainNode::create(0, this, m_globalData.get(), this, thisValue));
    128128
    129129    JSGlobalObject::globalExec()->init(0, 0, m_globalScopeChain.get(), CallFrame::noCaller(), 0, 0);
     
    188188    ExecState* exec = JSGlobalObject::globalExec();
    189189
    190     m_functionPrototype.set(exec->globalData(), this, new (exec) FunctionPrototype(exec, this, FunctionPrototype::createStructure(exec->globalData(), jsNull()))); // The real prototype will be set once ObjectPrototype is created.
     190    m_functionPrototype.set(exec->globalData(), this, FunctionPrototype::create(exec, this, FunctionPrototype::createStructure(exec->globalData(), jsNull()))); // The real prototype will be set once ObjectPrototype is created.
    191191    m_functionStructure.set(exec->globalData(), this, JSFunction::createStructure(exec->globalData(), m_functionPrototype.get()));
    192192    m_internalFunctionStructure.set(exec->globalData(), this, InternalFunction::createStructure(exec->globalData(), m_functionPrototype.get()));
     
    196196    m_callFunction.set(exec->globalData(), this, callFunction);
    197197    m_applyFunction.set(exec->globalData(), this, applyFunction);
    198     m_objectPrototype.set(exec->globalData(), this, new (exec) ObjectPrototype(exec, this, ObjectPrototype::createStructure(exec->globalData(), jsNull())));
     198    m_objectPrototype.set(exec->globalData(), this, ObjectPrototype::create(exec, this, ObjectPrototype::createStructure(exec->globalData(), jsNull())));
    199199    m_functionPrototype->structure()->setPrototypeWithoutTransition(exec->globalData(), m_objectPrototype.get());
    200200
     
    207207    m_callbackObjectStructure.set(exec->globalData(), this, JSCallbackObject<JSObjectWithGlobalObject>::createStructure(exec->globalData(), m_objectPrototype.get()));
    208208
    209     m_arrayPrototype.set(exec->globalData(), this, new (exec) ArrayPrototype(this, ArrayPrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
     209    m_arrayPrototype.set(exec->globalData(), this, ArrayPrototype::create(exec, this, ArrayPrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
    210210    m_arrayStructure.set(exec->globalData(), this, JSArray::createStructure(exec->globalData(), m_arrayPrototype.get()));
    211211    m_regExpMatchesArrayStructure.set(exec->globalData(), this, RegExpMatchesArray::createStructure(exec->globalData(), m_arrayPrototype.get()));
    212212
    213     m_stringPrototype.set(exec->globalData(), this, new (exec) StringPrototype(exec, this, StringPrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
     213    m_stringPrototype.set(exec->globalData(), this, StringPrototype::create(exec, this, StringPrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
    214214    m_stringObjectStructure.set(exec->globalData(), this, StringObject::createStructure(exec->globalData(), m_stringPrototype.get()));
    215215
    216     m_booleanPrototype.set(exec->globalData(), this, new (exec) BooleanPrototype(exec, this, BooleanPrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
     216    m_booleanPrototype.set(exec->globalData(), this, BooleanPrototype::create(exec, this, BooleanPrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
    217217    m_booleanObjectStructure.set(exec->globalData(), this, BooleanObject::createStructure(exec->globalData(), m_booleanPrototype.get()));
    218218
    219     m_numberPrototype.set(exec->globalData(), this, new (exec) NumberPrototype(exec, this, NumberPrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
     219    m_numberPrototype.set(exec->globalData(), this, NumberPrototype::create(exec, this, NumberPrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
    220220    m_numberObjectStructure.set(exec->globalData(), this, NumberObject::createStructure(exec->globalData(), m_numberPrototype.get()));
    221221
    222     m_datePrototype.set(exec->globalData(), this, new (exec) DatePrototype(exec, this, DatePrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
     222    m_datePrototype.set(exec->globalData(), this, DatePrototype::create(exec, this, DatePrototype::createStructure(exec->globalData(), m_objectPrototype.get())));
    223223    m_dateStructure.set(exec->globalData(), this, DateInstance::createStructure(exec->globalData(), m_datePrototype.get()));
    224224
    225     RegExp* emptyRegex = RegExp::create(&exec->globalData(), "", NoFlags);
     225    RegExp* emptyRegex = RegExp::create(exec->globalData(), "", NoFlags);
    226226   
    227     m_regExpPrototype.set(exec->globalData(), this, new (exec) RegExpPrototype(exec, this, RegExpPrototype::createStructure(exec->globalData(), m_objectPrototype.get()), emptyRegex));
     227    m_regExpPrototype.set(exec->globalData(), this, RegExpPrototype::create(exec, this, RegExpPrototype::createStructure(exec->globalData(), m_objectPrototype.get()), emptyRegex));
    228228    m_regExpStructure.set(exec->globalData(), this, RegExpObject::createStructure(exec->globalData(), m_regExpPrototype.get()));
    229229
    230230    m_methodCallDummy.set(exec->globalData(), this, constructEmptyObject(exec));
    231231
    232     ErrorPrototype* errorPrototype = new (exec) ErrorPrototype(exec, this, ErrorPrototype::createStructure(exec->globalData(), m_objectPrototype.get()));
     232    ErrorPrototype* errorPrototype = ErrorPrototype::create(exec, this, ErrorPrototype::createStructure(exec->globalData(), m_objectPrototype.get()));
    233233    m_errorStructure.set(exec->globalData(), this, ErrorInstance::createStructure(exec->globalData(), errorPrototype));
    234234
    235235    // Constructors
    236236
    237     JSCell* objectConstructor = new (exec) ObjectConstructor(exec, this, ObjectConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_objectPrototype.get());
    238     JSCell* functionConstructor = new (exec) FunctionConstructor(exec, this, FunctionConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_functionPrototype.get());
    239     JSCell* arrayConstructor = new (exec) ArrayConstructor(exec, this, ArrayConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_arrayPrototype.get());
    240     JSCell* stringConstructor = new (exec) StringConstructor(exec, this, StringConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_stringPrototype.get());
    241     JSCell* booleanConstructor = new (exec) BooleanConstructor(exec, this, BooleanConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_booleanPrototype.get());
    242     JSCell* numberConstructor = new (exec) NumberConstructor(exec, this, NumberConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_numberPrototype.get());
    243     JSCell* dateConstructor = new (exec) DateConstructor(exec, this, DateConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_datePrototype.get());
    244 
    245     m_regExpConstructor.set(exec->globalData(), this, new (exec) RegExpConstructor(exec, this, RegExpConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_regExpPrototype.get()));
    246 
    247     m_errorConstructor.set(exec->globalData(), this, new (exec) ErrorConstructor(exec, this, ErrorConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), errorPrototype));
     237    JSCell* objectConstructor = ObjectConstructor::create(exec, this, ObjectConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_objectPrototype.get());
     238    JSCell* functionConstructor = FunctionConstructor::create(exec, this, FunctionConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_functionPrototype.get());
     239    JSCell* arrayConstructor = ArrayConstructor::create(exec, this, ArrayConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_arrayPrototype.get());
     240    JSCell* stringConstructor = StringConstructor::create(exec, this, StringConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_stringPrototype.get());
     241    JSCell* booleanConstructor = BooleanConstructor::create(exec, this, BooleanConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_booleanPrototype.get());
     242    JSCell* numberConstructor = NumberConstructor::create(exec, this, NumberConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_numberPrototype.get());
     243    JSCell* dateConstructor = DateConstructor::create(exec, this, DateConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_datePrototype.get());
     244
     245    m_regExpConstructor.set(exec->globalData(), this, RegExpConstructor::create(exec, this, RegExpConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), m_regExpPrototype.get()));
     246
     247    m_errorConstructor.set(exec->globalData(), this, ErrorConstructor::create(exec, this, ErrorConstructor::createStructure(exec->globalData(), m_functionPrototype.get()), errorPrototype));
    248248
    249249    Structure* nativeErrorPrototypeStructure = NativeErrorPrototype::createStructure(exec->globalData(), errorPrototype);
    250250    Structure* nativeErrorStructure = NativeErrorConstructor::createStructure(exec->globalData(), m_functionPrototype.get());
    251     m_evalErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "EvalError"));
    252     m_rangeErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "RangeError"));
    253     m_referenceErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "ReferenceError"));
    254     m_syntaxErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "SyntaxError"));
    255     m_typeErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "TypeError"));
    256     m_URIErrorConstructor.set(exec->globalData(), this, new (exec) NativeErrorConstructor(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "URIError"));
     251    m_evalErrorConstructor.set(exec->globalData(), this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "EvalError"));
     252    m_rangeErrorConstructor.set(exec->globalData(), this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "RangeError"));
     253    m_referenceErrorConstructor.set(exec->globalData(), this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "ReferenceError"));
     254    m_syntaxErrorConstructor.set(exec->globalData(), this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "SyntaxError"));
     255    m_typeErrorConstructor.set(exec->globalData(), this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "TypeError"));
     256    m_URIErrorConstructor.set(exec->globalData(), this, NativeErrorConstructor::create(exec, this, nativeErrorStructure, nativeErrorPrototypeStructure, "URIError"));
    257257
    258258    m_objectPrototype->putDirectFunctionWithoutTransition(exec->globalData(), exec->propertyNames().constructor, objectConstructor, DontEnum);
     
    282282    putDirectFunctionWithoutTransition(exec->globalData(), Identifier(exec, "URIError"), m_URIErrorConstructor.get(), DontEnum);
    283283
    284     m_evalFunction.set(exec->globalData(), this, new (exec) JSFunction(exec, this, m_functionStructure.get(), 1, exec->propertyNames().eval, globalFuncEval));
     284    m_evalFunction.set(exec->globalData(), this, JSFunction::create(exec, this, m_functionStructure.get(), 1, exec->propertyNames().eval, globalFuncEval));
    285285    putDirectFunctionWithoutTransition(exec, m_evalFunction.get(), DontEnum);
    286286
    287287    GlobalPropertyInfo staticGlobals[] = {
    288         GlobalPropertyInfo(Identifier(exec, "Math"), new (exec) MathObject(exec, this, MathObject::createStructure(exec->globalData(), m_objectPrototype.get())), DontEnum | DontDelete),
     288        GlobalPropertyInfo(Identifier(exec, "Math"), MathObject::create(exec, this, MathObject::createStructure(exec->globalData(), m_objectPrototype.get())), DontEnum | DontDelete),
    289289        GlobalPropertyInfo(Identifier(exec, "NaN"), jsNaN(), DontEnum | DontDelete | ReadOnly),
    290290        GlobalPropertyInfo(Identifier(exec, "Infinity"), jsNumber(std::numeric_limits<double>::infinity()), DontEnum | DontDelete | ReadOnly),
    291291        GlobalPropertyInfo(Identifier(exec, "undefined"), jsUndefined(), DontEnum | DontDelete | ReadOnly),
    292         GlobalPropertyInfo(Identifier(exec, "JSON"), new (exec) JSONObject(this, JSONObject::createStructure(exec->globalData(), m_objectPrototype.get())), DontEnum | DontDelete)
     292        GlobalPropertyInfo(Identifier(exec, "JSON"), JSONObject::create(exec, this, JSONObject::createStructure(exec->globalData(), m_objectPrototype.get())), DontEnum | DontDelete)
    293293    };
    294294    addStaticGlobals(staticGlobals, WTF_ARRAY_LENGTH(staticGlobals));
     
    396396}
    397397
    398 void* JSGlobalObject::operator new(size_t size, JSGlobalData* globalData)
    399 {
    400     return globalData->heap.allocate(size);
    401 }
    402 
    403398void JSGlobalObject::addStaticGlobals(GlobalPropertyInfo* globals, int count)
    404399{
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r89465 r91194  
    123123
    124124    public:
    125         void* operator new(size_t, JSGlobalData*);
    126 
    127125        explicit JSGlobalObject(JSGlobalData& globalData, Structure* structure)
    128126            : JSVariableObject(globalData, structure, &m_symbolTable, 0)
     
    288286
    289287        void setRegisters(WriteBarrier<Unknown>* registers, PassOwnArrayPtr<WriteBarrier<Unknown> > registerArray, size_t count);
    290 
    291         void* operator new(size_t); // can only be allocated with JSGlobalData
    292288    };
    293289
     
    379375    inline JSArray* constructEmptyArray(ExecState* exec, JSGlobalObject* globalObject)
    380376    {
    381         return new (exec) JSArray(exec->globalData(), globalObject->arrayStructure());
     377        return JSArray::create(exec->globalData(), globalObject->arrayStructure());
    382378    }
    383379   
     
    389385    inline JSArray* constructEmptyArray(ExecState* exec, JSGlobalObject* globalObject, unsigned initialLength)
    390386    {
    391         return new (exec) JSArray(exec->globalData(), globalObject->arrayStructure(), initialLength, CreateInitialized);
     387        return JSArray::create(exec->globalData(), globalObject->arrayStructure(), initialLength, CreateInitialized);
    392388    }
    393389
     
    401397        MarkedArgumentBuffer values;
    402398        values.append(singleItemValue);
    403         return new (exec) JSArray(exec->globalData(), globalObject->arrayStructure(), values);
     399        return JSArray::create(exec->globalData(), globalObject->arrayStructure(), values);
    404400    }
    405401
     
    411407    inline JSArray* constructArray(ExecState* exec, JSGlobalObject* globalObject, const ArgList& values)
    412408    {
    413         return new (exec) JSArray(exec->globalData(), globalObject->arrayStructure(), values);
     409        return JSArray::create(exec->globalData(), globalObject->arrayStructure(), values);
    414410    }
    415411
  • trunk/Source/JavaScriptCore/runtime/JSNotAnObject.h

    r84052 r91194  
    3838    // any operations performed on the result of a failed toObject call.
    3939    class JSNotAnObject : public JSNonFinalObject {
    40     public:
     40    private:
    4141        JSNotAnObject(ExecState* exec)
    4242            : JSNonFinalObject(exec->globalData(), exec->globalData().notAnObjectStructure.get())
    4343        {
     44        }
     45       
     46    public:
     47        static JSNotAnObject* create(ExecState* exec)
     48        {
     49            return new (allocateCell<JSNotAnObject>(*exec->heap())) JSNotAnObject(exec);
    4450        }
    4551
  • trunk/Source/JavaScriptCore/runtime/JSONObject.h

    r86499 r91194  
    3434
    3535    class JSONObject : public JSObjectWithGlobalObject {
    36     public:
     36    private:
    3737        JSONObject(JSGlobalObject*, Structure*);
    3838
     39    public:
     40        static JSONObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     41        {
     42            return new (allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure);
     43        }
     44       
    3945        static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
    4046        {
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r91095 r91194  
    325325    JSGlobalData& globalData = exec->globalData();
    326326    PutPropertySlot slot;
    327     GetterSetter* getterSetter = new (exec) GetterSetter(exec);
     327    GetterSetter* getterSetter = GetterSetter::create(exec);
    328328    putDirectInternal(globalData, propertyName, getterSetter, attributes | Getter, true, slot);
    329329
     
    350350
    351351    PutPropertySlot slot;
    352     GetterSetter* getterSetter = new (exec) GetterSetter(exec);
     352    GetterSetter* getterSetter = GetterSetter::create(exec);
    353353    putDirectInternal(exec->globalData(), propertyName, getterSetter, attributes | Setter, true, slot);
    354354
     
    636636    if (descriptor.isGenericDescriptor() || descriptor.isDataDescriptor()) {
    637637        if (descriptor.isGenericDescriptor() && oldDescriptor.isAccessorDescriptor()) {
    638             GetterSetter* accessor = new (exec) GetterSetter(exec);
     638            GetterSetter* accessor = GetterSetter::create(exec);
    639639            if (oldDescriptor.getter()) {
    640640                attributes |= Getter;
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r90950 r91194  
    360360        static JSFinalObject* create(ExecState* exec, Structure* structure)
    361361        {
    362             return new (exec) JSFinalObject(exec->globalData(), structure);
     362            return new (allocateCell<JSFinalObject>(*exec->heap())) JSFinalObject(exec->globalData(), structure);
    363363        }
    364364
  • trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp

    r87316 r91194  
    6262        !o->structure()->typeInfo().overridesGetPropertyNames())
    6363        numCacheableSlots = o->structure()->propertyStorageSize();
    64 
    65     JSPropertyNameIterator* jsPropertyNameIterator = new (exec) JSPropertyNameIterator(exec, propertyNames.data(), numCacheableSlots);
     64   
     65    JSPropertyNameIterator* jsPropertyNameIterator = new (allocateCell<JSPropertyNameIterator>(*exec->heap())) JSPropertyNameIterator(exec, propertyNames.data(), numCacheableSlots);
    6666
    6767    if (o->structure()->isDictionary())
  • trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.h

    r86499 r91194  
    4545    public:
    4646        static JSPropertyNameIterator* create(ExecState*, JSObject*);
     47        static JSPropertyNameIterator* create(ExecState* exec, PropertyNameArrayData* propertyNameArrayData, size_t numCacheableSlot)
     48        {
     49            return new (allocateCell<JSPropertyNameIterator>(*exec->heap())) JSPropertyNameIterator(exec, propertyNameArrayData, numCacheableSlot);
     50        }
    4751       
    4852        static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r84934 r91194  
    200200    }
    201201    if (substringFiberCount == 1)
    202         return new (globalData) JSString(globalData, substringFibers[0]);
     202        return JSString::create(*globalData, substringFibers[0]);
    203203    if (substringFiberCount == 2)
    204         return new (globalData) JSString(globalData, substringFibers[0], substringFibers[1]);
    205     return new (globalData) JSString(globalData, substringFibers[0], substringFibers[1], substringFibers[2]);
     204        return JSString::create(*globalData, substringFibers[0], substringFibers[1]);
     205    return JSString::create(*globalData, substringFibers[0], substringFibers[1], substringFibers[2]);
    206206}
    207207
     
    255255
    256256    JSGlobalData* globalData = &exec->globalData();
    257     return JSValue(new (globalData) JSString(globalData, builder.release()));
     257    return JSValue(JSString::create(*globalData, builder.release()));
    258258}
    259259
     
    299299inline StringObject* StringObject::create(ExecState* exec, JSGlobalObject* globalObject, JSString* string)
    300300{
    301     return new (exec) StringObject(exec->globalData(), globalObject->stringObjectStructure(), string);
     301    return new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), globalObject->stringObjectStructure(), string);
    302302}
    303303
  • trunk/Source/JavaScriptCore/runtime/JSString.h

    r91095 r91194  
    181181                Vector<WorkItem, 16> m_workQueue;
    182182        };
    183 
    184         ALWAYS_INLINE JSString(JSGlobalData* globalData, const UString& value)
    185             : JSCell(*globalData, globalData->stringStructure.get())
     183       
     184    private:
     185        ALWAYS_INLINE JSString(JSGlobalData& globalData, const UString& value)
     186            : JSCell(globalData, globalData.stringStructure.get())
    186187            , m_length(value.length())
    187188            , m_value(value)
     
    193194
    194195        enum HasOtherOwnerType { HasOtherOwner };
    195         JSString(JSGlobalData* globalData, const UString& value, HasOtherOwnerType)
    196             : JSCell(*globalData, globalData->stringStructure.get())
     196        JSString(JSGlobalData& globalData, const UString& value, HasOtherOwnerType)
     197            : JSCell(globalData, globalData.stringStructure.get())
    197198            , m_length(value.length())
    198199            , m_value(value)
     
    201202            ASSERT(!m_value.isNull());
    202203        }
    203         JSString(JSGlobalData* globalData, PassRefPtr<StringImpl> value, HasOtherOwnerType)
    204             : JSCell(*globalData, globalData->stringStructure.get())
     204        JSString(JSGlobalData& globalData, PassRefPtr<StringImpl> value, HasOtherOwnerType)
     205            : JSCell(globalData, globalData.stringStructure.get())
    205206            , m_length(value->length())
    206207            , m_value(value)
     
    209210            ASSERT(!m_value.isNull());
    210211        }
    211         JSString(JSGlobalData* globalData, PassRefPtr<RopeImpl> rope)
    212             : JSCell(*globalData, globalData->stringStructure.get())
     212        JSString(JSGlobalData& globalData, PassRefPtr<RopeImpl> rope)
     213            : JSCell(globalData, globalData.stringStructure.get())
    213214            , m_length(rope->length())
    214215            , m_fiberCount(1)
     
    218219        // This constructor constructs a new string by concatenating s1 & s2.
    219220        // This should only be called with fiberCount <= 3.
    220         JSString(JSGlobalData* globalData, unsigned fiberCount, JSString* s1, JSString* s2)
    221             : JSCell(*globalData, globalData->stringStructure.get())
     221        JSString(JSGlobalData& globalData, unsigned fiberCount, JSString* s1, JSString* s2)
     222            : JSCell(globalData, globalData.stringStructure.get())
    222223            , m_length(s1->length() + s2->length())
    223224            , m_fiberCount(fiberCount)
     
    231232        // This constructor constructs a new string by concatenating s1 & s2.
    232233        // This should only be called with fiberCount <= 3.
    233         JSString(JSGlobalData* globalData, unsigned fiberCount, JSString* s1, const UString& u2)
    234             : JSCell(*globalData, globalData->stringStructure.get())
     234        JSString(JSGlobalData& globalData, unsigned fiberCount, JSString* s1, const UString& u2)
     235            : JSCell(globalData, globalData.stringStructure.get())
    235236            , m_length(s1->length() + u2.length())
    236237            , m_fiberCount(fiberCount)
     
    244245        // This constructor constructs a new string by concatenating s1 & s2.
    245246        // This should only be called with fiberCount <= 3.
    246         JSString(JSGlobalData* globalData, unsigned fiberCount, const UString& u1, JSString* s2)
    247             : JSCell(*globalData, globalData->stringStructure.get())
     247        JSString(JSGlobalData& globalData, unsigned fiberCount, const UString& u1, JSString* s2)
     248            : JSCell(globalData, globalData.stringStructure.get())
    248249            , m_length(u1.length() + s2->length())
    249250            , m_fiberCount(fiberCount)
     
    272273
    273274        // This constructor constructs a new string by concatenating u1 & u2.
    274         JSString(JSGlobalData* globalData, const UString& u1, const UString& u2)
    275             : JSCell(*globalData, globalData->stringStructure.get())
     275        JSString(JSGlobalData& globalData, const UString& u1, const UString& u2)
     276            : JSCell(globalData, globalData.stringStructure.get())
    276277            , m_length(u1.length() + u2.length())
    277278            , m_fiberCount(2)
     
    284285
    285286        // This constructor constructs a new string by concatenating u1, u2 & u3.
    286         JSString(JSGlobalData* globalData, const UString& u1, const UString& u2, const UString& u3)
    287             : JSCell(*globalData, globalData->stringStructure.get())
     287        JSString(JSGlobalData& globalData, const UString& u1, const UString& u2, const UString& u3)
     288            : JSCell(globalData, globalData.stringStructure.get())
    288289            , m_length(u1.length() + u2.length() + u3.length())
    289290            , m_fiberCount(s_maxInternalRopeLength)
     
    294295            appendStringInConstruct(index, u3);
    295296            ASSERT(index <= s_maxInternalRopeLength);
     297        }
     298
     299    public:
     300        static JSString* create(JSGlobalData& globalData, const UString& value)
     301        {
     302            return new (allocateCell<JSString>(globalData.heap)) JSString(globalData, value);
     303        }
     304        static JSString* createHasOtherOwner(JSGlobalData& globalData, const UString& value)
     305        {
     306            return new (allocateCell<JSString>(globalData.heap)) JSString(globalData, value, HasOtherOwner);
     307        }
     308        static JSString* createHasOtherOwner(JSGlobalData& globalData, PassRefPtr<StringImpl> value)
     309        {
     310            return new (allocateCell<JSString>(globalData.heap)) JSString(globalData, value, HasOtherOwner);
     311        }
     312        static JSString* create(JSGlobalData& globalData, PassRefPtr<RopeImpl> rope)
     313        {
     314            return new (allocateCell<JSString>(globalData.heap)) JSString(globalData, rope);
     315        }
     316        static JSString* create(JSGlobalData& globalData, unsigned fiberCount, JSString* s1, JSString* s2)
     317        {
     318            return new (allocateCell<JSString>(globalData.heap)) JSString(globalData, fiberCount, s1, s2);
     319        }
     320        static JSString* create(JSGlobalData& globalData, unsigned fiberCount, JSString* s1, const UString& u2)
     321        {
     322            return new (allocateCell<JSString>(globalData.heap)) JSString(globalData, fiberCount, s1, u2);
     323        }
     324        static JSString* create(JSGlobalData& globalData, unsigned fiberCount, const UString& u1, JSString* s2)
     325        {
     326            return new (allocateCell<JSString>(globalData.heap)) JSString(globalData, fiberCount, u1, s2);
     327        }
     328        static JSString* create(ExecState* exec, JSValue v1, JSValue v2, JSValue v3)
     329        {
     330            return new (allocateCell<JSString>(*exec->heap())) JSString(exec, v1, v2, v3);
     331        }
     332        static JSString* create(JSGlobalData& globalData, const UString& u1, const UString& u2)
     333        {
     334            return new (allocateCell<JSString>(globalData.heap)) JSString(globalData, u1, u2);
     335        }
     336        static JSString* create(JSGlobalData& globalData, const UString& u1, const UString& u2, const UString& u3)
     337        {
     338            return new (allocateCell<JSString>(globalData.heap)) JSString(globalData, u1, u2, u3);
    296339        }
    297340
     
    443486        if (c <= maxSingleCharacterString)
    444487            return globalData->smallStrings.singleCharacterString(globalData, c);
    445         return fixupVPtr(globalData, new (globalData) JSString(globalData, UString(&c, 1)));
     488        return fixupVPtr(globalData, JSString::create(*globalData, UString(&c, 1)));
    446489    }
    447490
     
    453496        if (c <= maxSingleCharacterString)
    454497            return globalData->smallStrings.singleCharacterString(globalData, c);
    455         return fixupVPtr(globalData, new (globalData) JSString(globalData, UString(StringImpl::create(s.impl(), offset, 1))));
     498        return fixupVPtr(globalData, JSString::create(*globalData, UString(StringImpl::create(s.impl(), offset, 1))));
    456499    }
    457500
     
    461504        ASSERT(s[0]);
    462505        ASSERT(s[1]);
    463         return fixupVPtr(globalData, new (globalData) JSString(globalData, s));
     506        return fixupVPtr(globalData, JSString::create(*globalData, s));
    464507    }
    465508
     
    467510    {
    468511        ASSERT(s.length() > 1);
    469         return fixupVPtr(globalData, new (globalData) JSString(globalData, s));
     512        return fixupVPtr(globalData, JSString::create(*globalData, s));
    470513    }
    471514
     
    489532                return globalData->smallStrings.singleCharacterString(globalData, c);
    490533        }
    491         return fixupVPtr(globalData, new (globalData) JSString(globalData, s));
     534        return fixupVPtr(globalData, JSString::create(*globalData, s));
    492535    }
    493536
     
    517560                return globalData->smallStrings.singleCharacterString(globalData, c);
    518561        }
    519         return fixupVPtr(globalData, new (globalData) JSString(globalData, UString(StringImpl::create(s.impl(), offset, length)), JSString::HasOtherOwner));
     562        return fixupVPtr(globalData, JSString::createHasOtherOwner(*globalData, UString(StringImpl::create(s.impl(), offset, length))));
    520563    }
    521564
     
    530573                return globalData->smallStrings.singleCharacterString(globalData, c);
    531574        }
    532         return fixupVPtr(globalData, new (globalData) JSString(globalData, s, JSString::HasOtherOwner));
     575        return fixupVPtr(globalData, JSString::createHasOtherOwner(*globalData, s));
    533576    }
    534577
  • trunk/Source/JavaScriptCore/runtime/JSValue.cpp

    r88587 r91194  
    6666    ASSERT(isUndefinedOrNull());
    6767    throwError(exec, createNotAnObjectError(exec, *this));
    68     return new (exec) JSNotAnObject(exec);
     68    return JSNotAnObject::create(exec);
    6969}
    7070
     
    9191    ASSERT(isUndefinedOrNull());
    9292    throwError(exec, createNotAnObjectError(exec, *this));
    93     return new (exec) JSNotAnObject(exec);
     93    return JSNotAnObject::create(exec);
    9494}
    9595
     
    104104    ASSERT(isUndefinedOrNull());
    105105    throwError(exec, createNotAnObjectError(exec, *this));
    106     return new (exec) JSNotAnObject(exec);
     106    return JSNotAnObject::create(exec);
    107107}
    108108
  • trunk/Source/JavaScriptCore/runtime/Lookup.cpp

    r88604 r91194  
    8181#if ENABLE(JIT)
    8282        if (entry->generator())
    83             function = new (exec) JSFunction(exec, globalObject, globalObject->functionStructure(), entry->functionLength(), propertyName, exec->globalData().getHostFunction(entry->function(), entry->generator()));
     83            function = JSFunction::create(exec, globalObject, globalObject->functionStructure(), entry->functionLength(), propertyName, exec->globalData().getHostFunction(entry->function(), entry->generator()));
    8484        else
    8585#endif
    86             function = new (exec) JSFunction(exec, globalObject, globalObject->functionStructure(), entry->functionLength(), propertyName, entry->function());
     86            function = JSFunction::create(exec, globalObject, globalObject->functionStructure(), entry->functionLength(), propertyName, entry->function());
    8787
    8888        thisObj->putDirectFunction(exec->globalData(), propertyName, function, entry->attributes());
  • trunk/Source/JavaScriptCore/runtime/MathObject.h

    r84052 r91194  
    2727
    2828    class MathObject : public JSObjectWithGlobalObject {
    29     public:
     29    private:
    3030        MathObject(ExecState*, JSGlobalObject*, Structure*);
    3131
     32    public:
     33        static MathObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     34        {
     35            return new (allocateCell<MathObject>(*exec->heap())) MathObject(exec, globalObject, structure);
     36        }
    3237        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
    3338        virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&);
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.cpp

    r86499 r91194  
    3838    ASSERT(inherits(&s_info));
    3939
    40     NativeErrorPrototype* prototype = new (exec) NativeErrorPrototype(exec, globalObject, prototypeStructure, nameAndMessage, this);
     40    NativeErrorPrototype* prototype = NativeErrorPrototype::create(exec, globalObject, prototypeStructure, nameAndMessage, this);
    4141
    4242    putDirect(exec->globalData(), exec->propertyNames().length, jsNumber(1), DontDelete | ReadOnly | DontEnum); // ECMA 15.11.7.5
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h

    r84556 r91194  
    3131
    3232    class NativeErrorConstructor : public InternalFunction {
    33     public:
     33    private:
    3434        NativeErrorConstructor(ExecState*, JSGlobalObject*, Structure*, Structure* prototypeStructure, const UString&);
    3535
     36    public:
     37        static NativeErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& nameAndMessage)
     38        {
     39            return new (allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(exec, globalObject, structure, prototypeStructure, nameAndMessage);
     40        }
     41       
    3642        static const ClassInfo s_info;
    3743
  • trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.h

    r91116 r91194  
    2828
    2929    class NativeErrorPrototype : public ErrorPrototype {
     30    private:
     31        NativeErrorPrototype(ExecState*, JSGlobalObject*, Structure*, const UString&, NativeErrorConstructor*);
     32   
    3033    public:
    31         NativeErrorPrototype(ExecState*, JSGlobalObject*, Structure*, const UString&, NativeErrorConstructor*);
     34        static NativeErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& nameAndMessage, NativeErrorConstructor* constructor)
     35        {
     36            return new (allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, globalObject, structure, nameAndMessage, constructor);
     37        }
    3238    };
    3339
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.cpp

    r88587 r91194  
    105105static EncodedJSValue JSC_HOST_CALL constructWithNumberConstructor(ExecState* exec)
    106106{
    107     NumberObject* object = new (exec) NumberObject(exec->globalData(), asInternalFunction(exec->callee())->globalObject()->numberObjectStructure());
     107    NumberObject* object = NumberObject::create(exec->globalData(), asInternalFunction(exec->callee())->globalObject()->numberObjectStructure());
    108108    double n = exec->argumentCount() ? exec->argument(0).toNumber(exec) : 0;
    109109    object->setInternalValue(exec->globalData(), jsNumber(n));
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.h

    r84052 r91194  
    2929
    3030    class NumberConstructor : public InternalFunction {
     31    private:
     32        NumberConstructor(ExecState*, JSGlobalObject*, Structure*, NumberPrototype*);
     33       
    3134    public:
    32         NumberConstructor(ExecState*, JSGlobalObject*, Structure*, NumberPrototype*);
     35        static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numPrototype)
     36        {
     37            return new (allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(exec, globalObject, structure, numPrototype);
     38        }
    3339
    3440        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/NumberObject.cpp

    r84052 r91194  
    4545NumberObject* constructNumber(ExecState* exec, JSGlobalObject* globalObject, JSValue number)
    4646{
    47     NumberObject* object = new (exec) NumberObject(exec->globalData(), globalObject->numberObjectStructure());
     47    NumberObject* object = NumberObject::create(exec->globalData(), globalObject->numberObjectStructure());
    4848    object->setInternalValue(exec->globalData(), number);
    4949    return object;
  • trunk/Source/JavaScriptCore/runtime/NumberObject.h

    r84052 r91194  
    2727
    2828    class NumberObject : public JSWrapperObject {
     29    protected:
     30        NumberObject(JSGlobalData&, Structure*);
     31
    2932    public:
    30         explicit NumberObject(JSGlobalData&, Structure*);
     33        static NumberObject* create(JSGlobalData& globalData, Structure* structure)
     34        {
     35            return new (allocateCell<NumberObject>(globalData.heap)) NumberObject(globalData, structure);
     36        }
    3137
    3238        static const ClassInfo s_info;
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.h

    r86727 r91194  
    2727
    2828    class NumberPrototype : public NumberObject {
    29     public:
     29    private:
    3030        NumberPrototype(ExecState*, JSGlobalObject*, Structure*);
    3131
     32    public:
     33        static NumberPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     34        {
     35            return new (allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, globalObject, structure);
     36        }
     37       
    3238        static const ClassInfo s_info;
    3339
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h

    r84052 r91194  
    2929
    3030    class ObjectConstructor : public InternalFunction {
     31    private:
     32        ObjectConstructor(ExecState*, JSGlobalObject*, Structure*, ObjectPrototype*);
     33   
    3134    public:
    32         ObjectConstructor(ExecState*, JSGlobalObject*, Structure*, ObjectPrototype*);
     35        static ObjectConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objPrototype)
     36        {
     37            return new (allocateCell<ObjectConstructor>(*exec->heap())) ObjectConstructor(exec, globalObject, structure, objPrototype);
     38        }
    3339
    3440        virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h

    r86727 r91194  
    2727
    2828    class ObjectPrototype : public JSNonFinalObject {
     29    private:
     30        ObjectPrototype(ExecState*, JSGlobalObject*, Structure*);
     31
    2932    public:
    30         ObjectPrototype(ExecState*, JSGlobalObject*, Structure*);
     33        static ObjectPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     34        {
     35            return new (allocateCell<ObjectPrototype>(*exec->heap())) ObjectPrototype(exec, globalObject, structure);
     36        }
    3137
    3238        static const ClassInfo s_info;
  • trunk/Source/JavaScriptCore/runtime/Operations.h

    r90401 r91194  
    5050
    5151        if (fiberCount <= JSString::s_maxInternalRopeLength)
    52             return new (globalData) JSString(globalData, fiberCount, s1, s2);
     52            return JSString::create(*globalData, fiberCount, s1, s2);
    5353
    5454        JSString::RopeBuilder ropeBuilder(fiberCount);
     
    5757        ropeBuilder.append(s1);
    5858        ropeBuilder.append(s2);
    59         return new (globalData) JSString(globalData, ropeBuilder.release());
     59        return JSString::create(*globalData, ropeBuilder.release());
    6060    }
    6161
     
    7575
    7676        if (fiberCount <= JSString::s_maxInternalRopeLength)
    77             return new (globalData) JSString(globalData, fiberCount, u1, s2);
     77            return JSString::create(*globalData, fiberCount, u1, s2);
    7878
    7979        JSString::RopeBuilder ropeBuilder(fiberCount);
     
    8282        ropeBuilder.append(u1);
    8383        ropeBuilder.append(s2);
    84         return new (globalData) JSString(globalData, ropeBuilder.release());
     84        return JSString::create(*globalData, ropeBuilder.release());
    8585    }
    8686
     
    100100
    101101        if (fiberCount <= JSString::s_maxInternalRopeLength)
    102             return new (globalData) JSString(globalData, fiberCount, s1, u2);
     102            return JSString::create(*globalData, fiberCount, s1, u2);
    103103
    104104        JSString::RopeBuilder ropeBuilder(fiberCount);
     
    107107        ropeBuilder.append(s1);
    108108        ropeBuilder.append(u2);
    109         return new (globalData) JSString(globalData, ropeBuilder.release());
     109        return JSString::create(*globalData, ropeBuilder.release());
    110110    }
    111111
     
    122122
    123123        JSGlobalData* globalData = &exec->globalData();
    124         return new (globalData) JSString(globalData, u1, u2);
     124        return JSString::create(*globalData, u1, u2);
    125125    }
    126126
     
    143143
    144144        JSGlobalData* globalData = &exec->globalData();
    145         return new (globalData) JSString(globalData, u1, u2, u3);
     145        return JSString::create(*globalData, u1, u2, u3);
    146146    }
    147147
     
    161161        JSGlobalData* globalData = &exec->globalData();
    162162        if (fiberCount == 3)
    163             return new (globalData) JSString(exec, strings[0].jsValue(), strings[1].jsValue(), strings[2].jsValue());
     163            return JSString::create(exec, strings[0].jsValue(), strings[1].jsValue(), strings[2].jsValue());
    164164
    165165        JSString::RopeBuilder ropeBuilder(fiberCount);
     
    186186            return throwOutOfMemoryError(exec);
    187187
    188         return new (globalData) JSString(globalData, ropeBuilder.release());
     188        return JSString::create(*globalData, ropeBuilder.release());
    189189    }
    190190
     
    233233
    234234        JSGlobalData* globalData = &exec->globalData();
    235         return new (globalData) JSString(globalData, ropeBuilder.release());
     235        return JSString::create(*globalData, ropeBuilder.release());
    236236    }
    237237
  • trunk/Source/JavaScriptCore/runtime/RegExp.cpp

    r90415 r91194  
    7777};
    7878
    79 RegExp::RegExp(JSGlobalData* globalData, const UString& patternString, RegExpFlags flags)
    80     : JSCell(*globalData, globalData->regExpStructure.get())
     79RegExp::RegExp(JSGlobalData& globalData, const UString& patternString, RegExpFlags flags)
     80    : JSCell(globalData, globalData.regExpStructure.get())
    8181    , m_state(NotCompiled)
    8282    , m_patternString(patternString)
     
    100100}
    101101
    102 RegExp* RegExp::create(JSGlobalData* globalData, const UString& patternString, RegExpFlags flags)
    103 {
    104     return globalData->regExpCache()->lookupOrCreate(patternString, flags);
     102RegExp* RegExp::createWithoutCaching(JSGlobalData& globalData, const UString& patternString, RegExpFlags flags)
     103{
     104    return new (allocateCell<RegExp>(globalData.heap)) RegExp(globalData, patternString, flags);
     105}
     106
     107RegExp* RegExp::create(JSGlobalData& globalData, const UString& patternString, RegExpFlags flags)
     108{
     109    return globalData.regExpCache()->lookupOrCreate(patternString, flags);
    105110}
    106111
  • trunk/Source/JavaScriptCore/runtime/RegExp.h

    r90415 r91194  
    3939    class RegExp : public JSCell {
    4040    public:
    41         static RegExp* create(JSGlobalData*, const UString& pattern, RegExpFlags);
     41        static RegExp* create(JSGlobalData&, const UString& pattern, RegExpFlags);
    4242        ~RegExp();
    4343
     
    7676    private:
    7777        friend class RegExpCache;
    78         RegExp(JSGlobalData* globalData, const UString& pattern, RegExpFlags);
     78        RegExp(JSGlobalData&, const UString&, RegExpFlags);
     79
     80        static RegExp* createWithoutCaching(JSGlobalData&, const UString&, RegExpFlags);
    7981
    8082        enum RegExpState {
  • trunk/Source/JavaScriptCore/runtime/RegExpCache.cpp

    r87529 r91194  
    3939    if (result != m_weakCache.end())
    4040        return result->second.get();
    41     RegExp* regExp = new (m_globalData) RegExp(m_globalData, patternString, flags);
     41    RegExp* regExp = RegExp::createWithoutCaching(*m_globalData, patternString, flags);
    4242#if ENABLE(REGEXP_TRACING)
    4343    m_globalData->addRegExpToTrace(regExp);
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.cpp

    r89946 r91194  
    154154JSObject* RegExpConstructor::arrayOfMatches(ExecState* exec) const
    155155{
    156     return new (exec) RegExpMatchesArray(exec, d.get());
     156    return RegExpMatchesArray::create(exec, d.get());
    157157}
    158158
     
    305305        if (callAsConstructor) {
    306306            RegExp* regExp = static_cast<RegExpObject*>(asObject(arg0))->regExp();
    307             return new (exec) RegExpObject(globalObject, globalObject->regExpStructure(), regExp);
     307            return RegExpObject::create(exec, globalObject, globalObject->regExpStructure(), regExp);
    308308        }
    309309        return asObject(arg0);
     
    323323    }
    324324
    325     RegExp* regExp = RegExp::create(&exec->globalData(), pattern, flags);
     325    RegExp* regExp = RegExp::create(exec->globalData(), pattern, flags);
    326326    if (!regExp->isValid())
    327327        return throwError(exec, createSyntaxError(exec, regExp->errorMessage()));
    328     return new (exec) RegExpObject(exec->lexicalGlobalObject(), globalObject->regExpStructure(), regExp);
     328    return RegExpObject::create(exec, exec->lexicalGlobalObject(), globalObject->regExpStructure(), regExp);
    329329}
    330330
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h

    r89946 r91194  
    5757
    5858    class RegExpConstructor : public InternalFunction {
     59    private:
     60        RegExpConstructor(ExecState*, JSGlobalObject*, Structure*, RegExpPrototype*);
     61
    5962    public:
    60         RegExpConstructor(ExecState*, JSGlobalObject*, Structure*, RegExpPrototype*);
     63        static RegExpConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)
     64        {
     65            return new (allocateCell<RegExpConstructor>(*exec->heap())) RegExpConstructor(exec, globalObject, structure, regExpPrototype);
     66        }
    6167
    6268        static Structure* createStructure(JSGlobalData& globalData, JSValue prototype)
  • trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h

    r55262 r91194  
    2626
    2727    class RegExpMatchesArray : public JSArray {
     28    private:
     29        RegExpMatchesArray(ExecState*, RegExpConstructorPrivate*);
     30
    2831    public:
    29         RegExpMatchesArray(ExecState*, RegExpConstructorPrivate*);
     32        static RegExpMatchesArray* create(ExecState* exec, RegExpConstructorPrivate* ctorPrivate)
     33        {
     34            return new (allocateCell<RegExpMatchesArray>(*exec->heap())) RegExpMatchesArray(exec, ctorPrivate);
     35        }
    3036        virtual ~RegExpMatchesArray();
    3137
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.h

    r87346 r91194  
    2828   
    2929    class RegExpObject : public JSObjectWithGlobalObject {
     30    protected:
     31        RegExpObject(JSGlobalObject*, Structure*, RegExp*);
     32
    3033    public:
     34        static RegExpObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
     35        {
     36            return new (allocateCell<RegExpObject>(*exec->heap())) RegExpObject(globalObject, structure, regExp);
     37        }
     38       
     39        static RegExpObject* create(JSGlobalData& globalData, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
     40        {
     41            return new (allocateCell<RegExpObject>(globalData.heap)) RegExpObject(globalObject, structure, regExp);
     42        }
     43       
    3144        typedef JSObjectWithGlobalObject Base;
    3245
    33         RegExpObject(JSGlobalObject*, Structure*, RegExp*);
    3446        virtual ~RegExpObject();
    3547
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.cpp

    r89895 r91194  
    123123                return throwVMError(exec, createSyntaxError(exec, "Invalid flags supplied to RegExp constructor."));
    124124        }
    125         regExp = RegExp::create(&exec->globalData(), pattern, flags);
     125        regExp = RegExp::create(exec->globalData(), pattern, flags);
    126126    }
    127127
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h

    r87346 r91194  
    2828
    2929    class RegExpPrototype : public RegExpObject {
    30     public:
     30    protected:
    3131        RegExpPrototype(ExecState*, JSGlobalObject*, Structure*, RegExp*);
    3232
     33    public:
     34        static RegExpPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
     35        {
     36            return new (allocateCell<RegExpPrototype>(*exec->heap())) RegExpPrototype(exec, globalObject, structure, regExp);
     37        }
     38       
    3339        static const ClassInfo s_info;
    3440
  • trunk/Source/JavaScriptCore/runtime/ScopeChain.h

    r89077 r91194  
    3535   
    3636    class ScopeChainNode : public JSCell {
    37     public:
     37    private:
    3838        ScopeChainNode(ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSGlobalObject* globalObject, JSObject* globalThis)
    3939            : JSCell(*globalData, globalData->scopeChainNodeStructure.get())
     
    4848        }
    4949
     50    public:
     51        static ScopeChainNode* create(ExecState* exec, ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSGlobalObject* globalObject, JSObject* globalThis)
     52        {
     53            return new (allocateCell<ScopeChainNode>(*exec->heap())) ScopeChainNode(next, object, globalData, globalObject, globalThis);
     54        }
     55        static ScopeChainNode* create(ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSGlobalObject* globalObject, JSObject* globalThis)
     56        {
     57            return new (allocateCell<ScopeChainNode>(globalData->heap)) ScopeChainNode(next, object, globalData, globalObject, globalThis);
     58        }
     59       
    5060        JSGlobalData* globalData;
    5161        WriteBarrier<ScopeChainNode> next;
     
    7787    {
    7888        ASSERT(o);
    79         return new (globalData) ScopeChainNode(this, o, globalData, globalObject.get(), globalThis.get());
     89        return ScopeChainNode::create(this, o, globalData, globalObject.get(), globalThis.get());
    8090    }
    8191
  • trunk/Source/JavaScriptCore/runtime/SmallStrings.cpp

    r87448 r91194  
    107107{
    108108    ASSERT(!m_emptyString);
    109     m_emptyString = new (globalData) JSString(globalData, "", JSString::HasOtherOwner);
     109    m_emptyString = JSString::createHasOtherOwner(*globalData, "");
    110110}
    111111
     
    115115        m_storage = adoptPtr(new SmallStringsStorage);
    116116    ASSERT(!m_singleCharacterStrings[character]);
    117     m_singleCharacterStrings[character] = new (globalData) JSString(globalData, PassRefPtr<StringImpl>(m_storage->rep(character)), JSString::HasOtherOwner);
     117    m_singleCharacterStrings[character] = JSString::createHasOtherOwner(*globalData, PassRefPtr<StringImpl>(m_storage->rep(character)));
    118118}
    119119
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.cpp

    r86727 r91194  
    8888    JSGlobalObject* globalObject = asInternalFunction(exec->callee())->globalObject();
    8989    if (!exec->argumentCount())
    90         return JSValue::encode(new (exec) StringObject(exec, globalObject->stringObjectStructure()));
    91     return JSValue::encode(new (exec) StringObject(exec, globalObject->stringObjectStructure(), exec->argument(0).toString(exec)));
     90        return JSValue::encode(StringObject::create(exec, globalObject->stringObjectStructure()));
     91    return JSValue::encode(StringObject::create(exec, globalObject->stringObjectStructure(), exec->argument(0).toString(exec)));
    9292}
    9393
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.h

    r86727 r91194  
    2929
    3030    class StringConstructor : public InternalFunction {
     31    private:
     32        StringConstructor(ExecState*, JSGlobalObject*, Structure*, StringPrototype*);
     33       
    3134    public:
    32         StringConstructor(ExecState*, JSGlobalObject*, Structure*, StringPrototype*);
     35        static StringConstructor* create(ExecState* exec, JSGlobalObject* globalObject , Structure* structure, StringPrototype* strPrototype)
     36        {
     37            return new (allocateCell<StringConstructor>(*exec->heap())) StringConstructor(exec, globalObject, structure, strPrototype);
     38        }
    3339
    3440        static const ClassInfo s_info;
  • trunk/Source/JavaScriptCore/runtime/StringObject.h

    r84052 r91194  
    2828
    2929    class StringObject : public JSWrapperObject {
    30     public:
     30    protected:
    3131        StringObject(ExecState*, Structure*);
    3232        StringObject(ExecState*, Structure*, const UString&);
    33 
     33               
     34    public:
     35        static StringObject* create(ExecState* exec, Structure* structure)
     36        {
     37            return new (allocateCell<StringObject>(*exec->heap())) StringObject(exec, structure); 
     38        }
     39        static StringObject* create(ExecState* exec, Structure* structure, const UString& str)
     40        {
     41            return new (allocateCell<StringObject>(*exec->heap())) StringObject(exec, structure, str); 
     42        }
    3443        static StringObject* create(ExecState*, JSGlobalObject*, JSString*);
     44       
    3545
    3646        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/StringObjectThatMasqueradesAsUndefined.h

    r84052 r91194  
    3333        static StringObjectThatMasqueradesAsUndefined* create(ExecState* exec, const UString& string)
    3434        {
    35             return new (exec) StringObjectThatMasqueradesAsUndefined(exec,
     35            return new (allocateCell<StringObjectThatMasqueradesAsUndefined>(*exec->heap())) StringObjectThatMasqueradesAsUndefined(exec,
    3636                createStructure(exec->globalData(), exec->lexicalGlobalObject()->stringPrototype()), string);
    3737        }
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.cpp

    r87445 r91194  
    616616         *  replaced with the result of the expression new RegExp(regexp).
    617617         */
    618         reg = RegExp::create(&exec->globalData(), a0.toString(exec), NoFlags);
     618        reg = RegExp::create(exec->globalData(), a0.toString(exec), NoFlags);
    619619    }
    620620    RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
     
    665665         *  replaced with the result of the expression new RegExp(regexp).
    666666         */
    667         reg = RegExp::create(&exec->globalData(), a0.toString(exec), NoFlags);
     667        reg = RegExp::create(exec->globalData(), a0.toString(exec), NoFlags);
    668668    }
    669669    RegExpConstructor* regExpConstructor = exec->lexicalGlobalObject()->regExpConstructor();
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.h

    r84052 r91194  
    2929
    3030    class StringPrototype : public StringObject {
     31    private:
     32        StringPrototype(ExecState*, JSGlobalObject*, Structure*);
     33
    3134    public:
    32         StringPrototype(ExecState*, JSGlobalObject*, Structure*);
     35        static StringPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
     36        {
     37            return new (allocateCell<StringPrototype>(*exec->heap())) StringPrototype(exec, globalObject, structure);
     38        }
    3339
    3440        virtual bool getOwnPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&);
  • trunk/Source/JavaScriptCore/runtime/Structure.h

    r91095 r91194  
    6464            ASSERT(globalData.structureStructure);
    6565            ASSERT(classInfo);
    66             return new (&globalData) Structure(globalData, prototype, typeInfo, anonymousSlotCount, classInfo);
     66            return new (allocateCell<Structure>(globalData.heap)) Structure(globalData, prototype, typeInfo, anonymousSlotCount, classInfo);
    6767        }
    6868
     
    158158        {
    159159            ASSERT(!globalData.structureStructure);
    160             return new (&globalData) Structure(globalData);
     160            return new (allocateCell<Structure>(globalData.heap)) Structure(globalData);
    161161        }
    162162       
     
    171171        {
    172172            ASSERT(globalData.structureStructure);
    173             return new (&globalData) Structure(globalData, structure);
     173            return new (allocateCell<Structure>(globalData.heap)) Structure(globalData, structure);
    174174        }
    175175       
  • trunk/Source/JavaScriptCore/runtime/StructureChain.h

    r86499 r91194  
    4343
    4444    public:
    45         static StructureChain* create(JSGlobalData& globalData, Structure* head) { return new (&globalData) StructureChain(globalData, globalData.structureChainStructure.get(), head); }
     45        static StructureChain* create(JSGlobalData& globalData, Structure* head) { return new (allocateCell<StructureChain>(globalData.heap)) StructureChain(globalData, globalData.structureChainStructure.get(), head); }
    4646        WriteBarrier<Structure>* head() { return m_vector.get(); }
    4747        void visitChildren(SlotVisitor&);
  • trunk/Source/WebCore/ChangeLog

    r91192 r91194  
     12011-07-18  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Refactor JSC to replace JSCell::operator new with static create method
     4        https://bugs.webkit.org/show_bug.cgi?id=64466
     5
     6        Reviewed by Oliver Hunt (oliver@apple.com) and Darin Adler (darin@apple.com).
     7
     8        First step in a longer refactoring process to remove the use of
     9        operator new overloading in order to allocate GC objects and to replace
     10        this method with static create methods for each individual type of heap-allocated
     11        JS object.  This particular patch only deals with replacing uses of
     12        operator new within JSC proper.  Future patches will remove it from the
     13        parts that interface with the DOM.  Due to the DOM's continued dependence
     14        on it, operator new has not actually been removed from JSCell.
     15
     16        * bindings/js/JSDOMBinding.cpp:
     17        (WebCore::jsDateOrNull):
     18        (WebCore::objectToStringFunctionGetter):
     19        * bindings/js/JSDOMWindowCustom.cpp:
     20        (WebCore::nonCachingStaticFunctionGetter):
     21        * bindings/js/JSHistoryCustom.cpp:
     22        (WebCore::nonCachingStaticBackFunctionGetter):
     23        (WebCore::nonCachingStaticForwardFunctionGetter):
     24        (WebCore::nonCachingStaticGoFunctionGetter):
     25        * bindings/js/JSLocationCustom.cpp:
     26        (WebCore::nonCachingStaticReplaceFunctionGetter):
     27        (WebCore::nonCachingStaticReloadFunctionGetter):
     28        (WebCore::nonCachingStaticAssignFunctionGetter):
     29        * bindings/js/SerializedScriptValue.cpp:
     30        (WebCore::CloneDeserializer::readTerminal):
     31        * bridge/qt/qt_runtime.cpp:
     32        (JSC::Bindings::convertQVariantToValue):
     33
    1342011-07-18  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
    235
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp

    r90154 r91194  
    157157    if (!isfinite(value))
    158158        return jsNull();
    159     return new (exec) DateInstance(exec, exec->lexicalGlobalObject()->dateStructure(), value);
     159    return DateInstance::create(exec, exec->lexicalGlobalObject()->dateStructure(), value);
    160160}
    161161
     
    308308JSValue objectToStringFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
    309309{
    310     return new (exec) JSFunction(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 0, propertyName, objectProtoFuncToString);
     310    return JSFunction::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 0, propertyName, objectProtoFuncToString);
    311311}
    312312
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r87197 r91194  
    8989JSValue nonCachingStaticFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
    9090{
    91     return new (exec) JSFunction(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), length, propertyName, nativeFunction);
     91    return JSFunction::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), length, propertyName, nativeFunction);
    9292}
    9393
  • trunk/Source/WebCore/bindings/js/JSHistoryCustom.cpp

    r85484 r91194  
    4141static JSValue nonCachingStaticBackFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
    4242{
    43     return new (exec) JSFunction(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 0, propertyName, jsHistoryPrototypeFunctionBack);
     43    return JSFunction::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 0, propertyName, jsHistoryPrototypeFunctionBack);
    4444}
    4545
    4646static JSValue nonCachingStaticForwardFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
    4747{
    48     return new (exec) JSFunction(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 0, propertyName, jsHistoryPrototypeFunctionForward);
     48    return JSFunction::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 0, propertyName, jsHistoryPrototypeFunctionForward);
    4949}
    5050
    5151static JSValue nonCachingStaticGoFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
    5252{
    53     return new (exec) JSFunction(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 1, propertyName, jsHistoryPrototypeFunctionGo);
     53    return JSFunction::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 1, propertyName, jsHistoryPrototypeFunctionGo);
    5454}
    5555
  • trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp

    r79611 r91194  
    3333static JSValue nonCachingStaticReplaceFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
    3434{
    35     return new (exec) JSFunction(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 1, propertyName, jsLocationPrototypeFunctionReplace);
     35    return JSFunction::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 1, propertyName, jsLocationPrototypeFunctionReplace);
    3636}
    3737
    3838static JSValue nonCachingStaticReloadFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
    3939{
    40     return new (exec) JSFunction(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 0, propertyName, jsLocationPrototypeFunctionReload);
     40    return JSFunction::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 0, propertyName, jsLocationPrototypeFunctionReload);
    4141}
    4242
    4343static JSValue nonCachingStaticAssignFunctionGetter(ExecState* exec, JSValue, const Identifier& propertyName)
    4444{
    45     return new (exec) JSFunction(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 1, propertyName, jsLocationPrototypeFunctionAssign);
     45    return JSFunction::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->functionStructure(), 1, propertyName, jsLocationPrototypeFunctionAssign);
    4646}
    4747
  • trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp

    r89653 r91194  
    10871087            if (!read(d))
    10881088                return JSValue();
    1089             return new (m_exec) DateInstance(m_exec, m_globalObject->dateStructure(), d);
     1089            return DateInstance::create(m_exec, m_globalObject->dateStructure(), d);
    10901090        }
    10911091        case FileTag: {
     
    11671167            RegExpFlags reFlags = regExpFlags(flags->ustring());
    11681168            ASSERT(reFlags != InvalidFlags);
    1169             RegExp* regExp = RegExp::create(&m_exec->globalData(), pattern->ustring(), reFlags);
    1170             return new (m_exec) RegExpObject(m_exec->lexicalGlobalObject(), m_globalObject->regExpStructure(), regExp);
     1169            RegExp* regExp = RegExp::create(m_exec->globalData(), pattern->ustring(), reFlags);
     1170            return RegExpObject::create(m_exec, m_exec->lexicalGlobalObject(), m_globalObject->regExpStructure(), regExp);
    11711171        }
    11721172        case ObjectReferenceTag: {
  • trunk/Source/WebCore/bridge/qt/qt_runtime.cpp

    r89830 r91194  
    874874            RegExpFlags flags = (re.caseSensitivity() == Qt::CaseInsensitive) ? FlagIgnoreCase : NoFlags;
    875875
    876             JSC::RegExp* regExp = JSC::RegExp::create(&exec->globalData(), pattern, flags);
     876            JSC::RegExp* regExp = JSC::RegExp::create(exec->globalData(), pattern, flags);
    877877            if (regExp->isValid())
    878                 return new (exec) RegExpObject(exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->regExpStructure(), regExp);
     878                return RegExpObject::create(exec, exec->lexicalGlobalObject(), exec->lexicalGlobalObject()->regExpStructure(), regExp);
    879879            return jsNull();
    880880        }
     
    909909        double ms = gregorianDateTimeToMS(exec, dt, time.msec(), /*inputIsUTC*/ false);
    910910
    911         return new (exec) DateInstance(exec, exec->lexicalGlobalObject()->dateStructure(), trunc(ms));
     911        return DateInstance::create(exec, exec->lexicalGlobalObject()->dateStructure(), trunc(ms));
    912912    }
    913913
Note: See TracChangeset for help on using the changeset viewer.