Changeset 103243 in webkit


Ignore:
Timestamp:
Dec 19, 2011 9:45:13 AM (12 years ago)
Author:
ggaren@apple.com
Message:

Placement new does an unnecessary NULL check
https://bugs.webkit.org/show_bug.cgi?id=74676

Reviewed by Sam Weinig.

Source/JavaScriptCore:

We can define our own version, which skips the NULL check.

Not a measurable speedup, but code inspection shows better code generated,
and I believe this is a step toward turning off -fomit-frame-pointer.

  • API/JSCallbackConstructor.h:

(JSC::JSCallbackConstructor::create):

  • API/JSCallbackFunction.h:

(JSC::JSCallbackFunction::create): Use the NotNull version of placement
new to skip the NULL check.

  • API/JSCallbackObject.h: Removed a conflicting, unnecessaray placement new.

(JSC::JSCallbackObject::create):

  • debugger/DebuggerActivation.h:

(JSC::DebuggerActivation::create):

  • heap/HandleHeap.cpp:

(JSC::HandleHeap::grow):

  • heap/HandleHeap.h:

(JSC::HandleHeap::allocate):

  • heap/MarkedBlock.cpp:

(JSC::MarkedBlock::create):
(JSC::MarkedBlock::recycle):

  • jit/JITCode.h:

(JSC::JITCode::clear):

  • jsc.cpp:

(GlobalObject::create):

  • profiler/CallIdentifier.h:
  • runtime/Arguments.h:

(JSC::Arguments::create):

  • runtime/ArrayConstructor.h:

(JSC::ArrayConstructor::create):

  • runtime/ArrayPrototype.h:

(JSC::ArrayPrototype::create):

  • runtime/BooleanConstructor.h:

(JSC::BooleanConstructor::create):

  • runtime/BooleanObject.h:

(JSC::BooleanObject::create):

  • runtime/BooleanPrototype.h:

(JSC::BooleanPrototype::create):

  • runtime/DateConstructor.h:

(JSC::DateConstructor::create):

  • runtime/DateInstance.h:

(JSC::DateInstance::create):

  • runtime/DatePrototype.h:

(JSC::DatePrototype::create):

  • runtime/Error.h:

(JSC::StrictModeTypeErrorFunction::create):

  • runtime/ErrorConstructor.h:

(JSC::ErrorConstructor::create):

  • runtime/ErrorInstance.h:

(JSC::ErrorInstance::create):

  • runtime/ErrorPrototype.h:

(JSC::ErrorPrototype::create):

  • runtime/ExceptionHelpers.h:

(JSC::InterruptedExecutionError::create):
(JSC::TerminatedExecutionError::create):

  • runtime/Executable.h:

(JSC::NativeExecutable::create):
(JSC::EvalExecutable::create):
(JSC::ProgramExecutable::create):
(JSC::FunctionExecutable::create):

  • runtime/FunctionConstructor.h:

(JSC::FunctionConstructor::create):

  • runtime/FunctionPrototype.h:

(JSC::FunctionPrototype::create):

  • runtime/GetterSetter.h:

(JSC::GetterSetter::create):

  • runtime/JSAPIValueWrapper.h:

(JSC::JSAPIValueWrapper::create):

  • runtime/JSActivation.h:

(JSC::JSActivation::create):

  • runtime/JSArray.h:

(JSC::JSArray::create):

  • runtime/JSBoundFunction.cpp:

(JSC::JSBoundFunction::create):

  • runtime/JSByteArray.h:

(JSC::JSByteArray::create): Use the NotNull version of placement
new to skip the NULL check.

  • runtime/JSCell.h: Removed a conflicting, unnecessaray placement new.
  • runtime/JSFunction.cpp:

(JSC::JSFunction::create):

  • runtime/JSFunction.h:

(JSC::JSFunction::create):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::create):

  • runtime/JSGlobalThis.h:

(JSC::JSGlobalThis::create):

  • runtime/JSNotAnObject.h:

(JSC::JSNotAnObject::create):

  • runtime/JSONObject.h:

(JSC::JSONObject::create):

  • runtime/JSObject.h:

(JSC::JSFinalObject::create):

  • runtime/JSPropertyNameIterator.cpp:

(JSC::JSPropertyNameIterator::create):

  • runtime/JSPropertyNameIterator.h:

(JSC::JSPropertyNameIterator::create):

  • runtime/JSStaticScopeObject.h:

(JSC::JSStaticScopeObject::create):

  • runtime/JSString.cpp:

(JSC::StringObject::create):

  • runtime/JSString.h:

(JSC::RopeBuilder::createNull):
(JSC::RopeBuilder::create):
(JSC::RopeBuilder::createHasOtherOwner):

  • runtime/MathObject.h:

(JSC::MathObject::create):

  • runtime/NativeErrorConstructor.h:

(JSC::NativeErrorConstructor::create):

  • runtime/NativeErrorPrototype.h:

(JSC::NativeErrorPrototype::create):

  • runtime/NumberConstructor.h:

(JSC::NumberConstructor::create):

  • 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/RegExp.cpp:

(JSC::RegExp::createWithoutCaching):

  • runtime/RegExpConstructor.h:

(JSC::RegExpConstructor::create):

  • runtime/RegExpMatchesArray.h:

(JSC::RegExpMatchesArray::create):

  • runtime/RegExpObject.h:

(JSC::RegExpObject::create):

  • runtime/RegExpPrototype.h:

(JSC::RegExpPrototype::create):

  • runtime/ScopeChain.h:

(JSC::ScopeChainNode::create):

  • runtime/StrictEvalActivation.h:

(JSC::StrictEvalActivation::create):

  • runtime/StringConstructor.h:

(JSC::StringConstructor::create):

  • runtime/StringObject.h:

(JSC::StringObject::create):

  • runtime/StringPrototype.h:

(JSC::StringPrototype::create):

  • runtime/Structure.h:

(JSC::Structure::create):
(JSC::Structure::createStructure):

  • runtime/StructureChain.h:

(JSC::StructureChain::create):

  • testRegExp.cpp:

(GlobalObject::create):

  • wtf/BitVector.cpp:

(WTF::BitVector::OutOfLineBits::create): Use the NotNull version of placement
new to skip the NULL check.

  • wtf/BumpPointerAllocator.h:

(WTF::BumpPointerPool::create): Standardized spacing to make grep easier.

  • wtf/ByteArray.cpp:

(WTF::ByteArray::create):

  • wtf/Deque.h:

(WTF::::append):
(WTF::::prepend): Use NotNull, as above.

  • wtf/FastAllocBase.h: Added a placement new, since this class would otherwise

hide the name of the global placement new.

(WTF::fastNew): Standardized spacing. Most of these functions don't need
NotNull, since they check for NULL, and the optimizer can see that.

  • wtf/HashTable.h:
  • wtf/HashTraits.h:

(WTF::SimpleClassHashTraits::constructDeletedValue):

  • wtf/MetaAllocator.cpp:

(WTF::MetaAllocator::allocFreeSpaceNode): NotNull, as above.

  • wtf/StdLibExtras.h:

(throw): This is our NotNull placement new. Declaring that we throw is
the C++ way to say that operator new will not return NULL.

  • wtf/ThreadSpecific.h:

(WTF::T):

  • wtf/Vector.h:

(WTF::::append):
(WTF::::tryAppend):
(WTF::::uncheckedAppend):
(WTF::::insert):

  • wtf/text/AtomicStringHash.h:
  • wtf/text/StringImpl.cpp:

(WTF::StringImpl::createUninitialized):
(WTF::StringImpl::reallocate):

  • wtf/text/StringImpl.h:

(WTF::StringImpl::tryCreateUninitialized):

  • wtf/text/StringStatics.cpp:

(WTF::AtomicString::init): Use NotNull, as above.

  • yarr/YarrInterpreter.cpp:

(JSC::Yarr::Interpreter::allocDisjunctionContext):
(JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
(JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext): Standardized
spacing for easy grep.

Source/WebCore:

  • bindings/js/JSImageConstructor.h:

(WebCore::JSImageConstructor::create):

  • bindings/scripts/CodeGeneratorJS.pm:

(GenerateHeader):
(GenerateConstructorDeclaration):

  • bridge/c/CRuntimeObject.h:

(JSC::Bindings::CRuntimeObject::create):

  • bridge/c/c_instance.cpp:

(JSC::Bindings::CRuntimeMethod::create):

  • bridge/jni/jsc/JavaInstanceJSC.cpp:

(JavaRuntimeMethod::create):

  • bridge/jni/jsc/JavaRuntimeObject.h:

(JSC::Bindings::JavaRuntimeObject::create):

  • bridge/objc/ObjCRuntimeObject.h:

(JSC::Bindings::ObjCRuntimeObject::create):

  • bridge/objc/objc_instance.mm:

(ObjCRuntimeMethod::create):

  • bridge/objc/objc_runtime.h:

(JSC::Bindings::ObjcFallbackObjectImp::create):

  • bridge/runtime_array.h:

(JSC::RuntimeArray::create):

  • bridge/runtime_method.h:

(JSC::RuntimeMethod::create):

  • bridge/runtime_object.h:

(JSC::Bindings::RuntimeObject::create):

  • dom/Document.h:

(WebCore::FormElementKeyHashTraits::constructDeletedValue): Use NotNull
placement new, as in JavaScriptCore.

  • platform/PODArena.h:

(WebCore::PODArena::allocateObject): No need to check for NULL explicitly,
since that's the built-in behavior of placement new.

  • platform/graphics/FontCache.cpp:

(WebCore::FontDataCacheKeyTraits::constructDeletedValue):

  • platform/graphics/IntRectHash.h:
  • platform/graphics/IntSizeHash.h: More NotNull.
  • rendering/RenderObject.h: Declaring that we throw is the C++ way to say

that operator new will not return NULL.

Location:
trunk/Source
Files:
112 edited

Legend:

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

    r103083 r103243  
    3838    static JSCallbackConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, JSObjectCallAsConstructorCallback callback)
    3939    {
    40         JSCallbackConstructor* constructor = new (allocateCell<JSCallbackConstructor>(*exec->heap())) JSCallbackConstructor(globalObject, structure, classRef, callback);
     40        JSCallbackConstructor* constructor = new (NotNull, allocateCell<JSCallbackConstructor>(*exec->heap())) JSCallbackConstructor(globalObject, structure, classRef, callback);
    4141        constructor->finishCreation(globalObject, classRef);
    4242        return constructor;
  • trunk/Source/JavaScriptCore/API/JSCallbackFunction.h

    r97097 r103243  
    4242    static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
    4343    {
    44         JSCallbackFunction* function = new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, callback);
     44        JSCallbackFunction* function = new (NotNull, allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, callback);
    4545        function->finishCreation(exec->globalData(), name);
    4646        return function;
  • trunk/Source/JavaScriptCore/API/JSCallbackObject.h

    r103083 r103243  
    120120    JSCallbackObject(ExecState*, 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 Parent is a template argument, so we just duplicate the same
    124     // functionality here.
    125     void* operator new(size_t, void* ptr) { return ptr; }
    126122
    127123    void finishCreation(ExecState*);
     
    134130    {
    135131        ASSERT_UNUSED(globalObject, !structure->globalObject() || structure->globalObject() == globalObject);
    136         JSCallbackObject* callbackObject = new (allocateCell<JSCallbackObject>(*exec->heap())) JSCallbackObject(exec, structure, classRef, data);
     132        JSCallbackObject* callbackObject = new (NotNull, allocateCell<JSCallbackObject>(*exec->heap())) JSCallbackObject(exec, structure, classRef, data);
    137133        callbackObject->finishCreation(exec);
    138134        return callbackObject;
     
    140136    static JSCallbackObject* create(JSGlobalData& globalData, JSClassRef classRef, Structure* structure)
    141137    {
    142         JSCallbackObject* callbackObject = new (allocateCell<JSCallbackObject>(globalData.heap)) JSCallbackObject(globalData, classRef, structure);
     138        JSCallbackObject* callbackObject = new (NotNull, allocateCell<JSCallbackObject>(globalData.heap)) JSCallbackObject(globalData, classRef, structure);
    143139        callbackObject->finishCreation(globalData);
    144140        return callbackObject;
  • trunk/Source/JavaScriptCore/ChangeLog

    r103240 r103243  
     12011-12-15  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Placement new does an unnecessary NULL check
     4        https://bugs.webkit.org/show_bug.cgi?id=74676
     5
     6        Reviewed by Sam Weinig.
     7
     8        We can define our own version, which skips the NULL check.
     9       
     10        Not a measurable speedup, but code inspection shows better code generated,
     11        and I believe this is a step toward turning off -fomit-frame-pointer.
     12
     13        * API/JSCallbackConstructor.h:
     14        (JSC::JSCallbackConstructor::create):
     15        * API/JSCallbackFunction.h:
     16        (JSC::JSCallbackFunction::create): Use the NotNull version of placement
     17        new to skip the NULL check.
     18
     19        * API/JSCallbackObject.h: Removed a conflicting, unnecessaray placement new.
     20
     21        (JSC::JSCallbackObject::create):
     22        * debugger/DebuggerActivation.h:
     23        (JSC::DebuggerActivation::create):
     24        * heap/HandleHeap.cpp:
     25        (JSC::HandleHeap::grow):
     26        * heap/HandleHeap.h:
     27        (JSC::HandleHeap::allocate):
     28        * heap/MarkedBlock.cpp:
     29        (JSC::MarkedBlock::create):
     30        (JSC::MarkedBlock::recycle):
     31        * jit/JITCode.h:
     32        (JSC::JITCode::clear):
     33        * jsc.cpp:
     34        (GlobalObject::create):
     35        * profiler/CallIdentifier.h:
     36        * runtime/Arguments.h:
     37        (JSC::Arguments::create):
     38        * runtime/ArrayConstructor.h:
     39        (JSC::ArrayConstructor::create):
     40        * runtime/ArrayPrototype.h:
     41        (JSC::ArrayPrototype::create):
     42        * runtime/BooleanConstructor.h:
     43        (JSC::BooleanConstructor::create):
     44        * runtime/BooleanObject.h:
     45        (JSC::BooleanObject::create):
     46        * runtime/BooleanPrototype.h:
     47        (JSC::BooleanPrototype::create):
     48        * runtime/DateConstructor.h:
     49        (JSC::DateConstructor::create):
     50        * runtime/DateInstance.h:
     51        (JSC::DateInstance::create):
     52        * runtime/DatePrototype.h:
     53        (JSC::DatePrototype::create):
     54        * runtime/Error.h:
     55        (JSC::StrictModeTypeErrorFunction::create):
     56        * runtime/ErrorConstructor.h:
     57        (JSC::ErrorConstructor::create):
     58        * runtime/ErrorInstance.h:
     59        (JSC::ErrorInstance::create):
     60        * runtime/ErrorPrototype.h:
     61        (JSC::ErrorPrototype::create):
     62        * runtime/ExceptionHelpers.h:
     63        (JSC::InterruptedExecutionError::create):
     64        (JSC::TerminatedExecutionError::create):
     65        * runtime/Executable.h:
     66        (JSC::NativeExecutable::create):
     67        (JSC::EvalExecutable::create):
     68        (JSC::ProgramExecutable::create):
     69        (JSC::FunctionExecutable::create):
     70        * runtime/FunctionConstructor.h:
     71        (JSC::FunctionConstructor::create):
     72        * runtime/FunctionPrototype.h:
     73        (JSC::FunctionPrototype::create):
     74        * runtime/GetterSetter.h:
     75        (JSC::GetterSetter::create):
     76        * runtime/JSAPIValueWrapper.h:
     77        (JSC::JSAPIValueWrapper::create):
     78        * runtime/JSActivation.h:
     79        (JSC::JSActivation::create):
     80        * runtime/JSArray.h:
     81        (JSC::JSArray::create):
     82        * runtime/JSBoundFunction.cpp:
     83        (JSC::JSBoundFunction::create):
     84        * runtime/JSByteArray.h:
     85        (JSC::JSByteArray::create): Use the NotNull version of placement
     86        new to skip the NULL check.
     87
     88        * runtime/JSCell.h: Removed a conflicting, unnecessaray placement new.
     89
     90        * runtime/JSFunction.cpp:
     91        (JSC::JSFunction::create):
     92        * runtime/JSFunction.h:
     93        (JSC::JSFunction::create):
     94        * runtime/JSGlobalObject.h:
     95        (JSC::JSGlobalObject::create):
     96        * runtime/JSGlobalThis.h:
     97        (JSC::JSGlobalThis::create):
     98        * runtime/JSNotAnObject.h:
     99        (JSC::JSNotAnObject::create):
     100        * runtime/JSONObject.h:
     101        (JSC::JSONObject::create):
     102        * runtime/JSObject.h:
     103        (JSC::JSFinalObject::create):
     104        * runtime/JSPropertyNameIterator.cpp:
     105        (JSC::JSPropertyNameIterator::create):
     106        * runtime/JSPropertyNameIterator.h:
     107        (JSC::JSPropertyNameIterator::create):
     108        * runtime/JSStaticScopeObject.h:
     109        (JSC::JSStaticScopeObject::create):
     110        * runtime/JSString.cpp:
     111        (JSC::StringObject::create):
     112        * runtime/JSString.h:
     113        (JSC::RopeBuilder::createNull):
     114        (JSC::RopeBuilder::create):
     115        (JSC::RopeBuilder::createHasOtherOwner):
     116        * runtime/MathObject.h:
     117        (JSC::MathObject::create):
     118        * runtime/NativeErrorConstructor.h:
     119        (JSC::NativeErrorConstructor::create):
     120        * runtime/NativeErrorPrototype.h:
     121        (JSC::NativeErrorPrototype::create):
     122        * runtime/NumberConstructor.h:
     123        (JSC::NumberConstructor::create):
     124        * runtime/NumberObject.h:
     125        (JSC::NumberObject::create):
     126        * runtime/NumberPrototype.h:
     127        (JSC::NumberPrototype::create):
     128        * runtime/ObjectConstructor.h:
     129        (JSC::ObjectConstructor::create):
     130        * runtime/ObjectPrototype.h:
     131        (JSC::ObjectPrototype::create):
     132        * runtime/RegExp.cpp:
     133        (JSC::RegExp::createWithoutCaching):
     134        * runtime/RegExpConstructor.h:
     135        (JSC::RegExpConstructor::create):
     136        * runtime/RegExpMatchesArray.h:
     137        (JSC::RegExpMatchesArray::create):
     138        * runtime/RegExpObject.h:
     139        (JSC::RegExpObject::create):
     140        * runtime/RegExpPrototype.h:
     141        (JSC::RegExpPrototype::create):
     142        * runtime/ScopeChain.h:
     143        (JSC::ScopeChainNode::create):
     144        * runtime/StrictEvalActivation.h:
     145        (JSC::StrictEvalActivation::create):
     146        * runtime/StringConstructor.h:
     147        (JSC::StringConstructor::create):
     148        * runtime/StringObject.h:
     149        (JSC::StringObject::create):
     150        * runtime/StringPrototype.h:
     151        (JSC::StringPrototype::create):
     152        * runtime/Structure.h:
     153        (JSC::Structure::create):
     154        (JSC::Structure::createStructure):
     155        * runtime/StructureChain.h:
     156        (JSC::StructureChain::create):
     157        * testRegExp.cpp:
     158        (GlobalObject::create):
     159        * wtf/BitVector.cpp:
     160        (WTF::BitVector::OutOfLineBits::create): Use the NotNull version of placement
     161        new to skip the NULL check.
     162
     163        * wtf/BumpPointerAllocator.h:
     164        (WTF::BumpPointerPool::create): Standardized spacing to make grep easier.
     165
     166        * wtf/ByteArray.cpp:
     167        (WTF::ByteArray::create):
     168        * wtf/Deque.h:
     169        (WTF::::append):
     170        (WTF::::prepend): Use NotNull, as above.
     171
     172        * wtf/FastAllocBase.h: Added a placement new, since this class would otherwise
     173        hide the name of the global placement new.
     174
     175        (WTF::fastNew): Standardized spacing. Most of these functions don't need
     176        NotNull, since they check for NULL, and the optimizer can see that.
     177
     178        * wtf/HashTable.h:
     179        * wtf/HashTraits.h:
     180        (WTF::SimpleClassHashTraits::constructDeletedValue):
     181        * wtf/MetaAllocator.cpp:
     182        (WTF::MetaAllocator::allocFreeSpaceNode): NotNull, as above.
     183
     184        * wtf/StdLibExtras.h:
     185        (throw): This is our NotNull placement new. Declaring that we throw is
     186        the C++ way to say that operator new will not return NULL.
     187
     188        * wtf/ThreadSpecific.h:
     189        (WTF::T):
     190        * wtf/Vector.h:
     191        (WTF::::append):
     192        (WTF::::tryAppend):
     193        (WTF::::uncheckedAppend):
     194        (WTF::::insert):
     195        * wtf/text/AtomicStringHash.h:
     196        * wtf/text/StringImpl.cpp:
     197        (WTF::StringImpl::createUninitialized):
     198        (WTF::StringImpl::reallocate):
     199        * wtf/text/StringImpl.h:
     200        (WTF::StringImpl::tryCreateUninitialized):
     201        * wtf/text/StringStatics.cpp:
     202        (WTF::AtomicString::init): Use NotNull, as above.
     203
     204        * yarr/YarrInterpreter.cpp:
     205        (JSC::Yarr::Interpreter::allocDisjunctionContext):
     206        (JSC::Yarr::Interpreter::ParenthesesDisjunctionContext::ParenthesesDisjunctionContext):
     207        (JSC::Yarr::Interpreter::allocParenthesesDisjunctionContext): Standardized
     208        spacing for easy grep.
     209
    12102011-12-19  Eric Carlson  <eric.carlson@apple.com>
    2211
  • trunk/Source/JavaScriptCore/debugger/DebuggerActivation.h

    r103083 r103243  
    3737        static DebuggerActivation* create(JSGlobalData& globalData, JSObject* object)
    3838        {
    39             DebuggerActivation* activation = new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData);
     39            DebuggerActivation* activation = new (NotNull, allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData);
    4040            activation->finishCreation(globalData, object);
    4141            return activation;
  • trunk/Source/JavaScriptCore/heap/HandleHeap.cpp

    r95901 r103243  
    5757    for (int i = m_blockStack.blockLength - 1; i >= 0; --i) {
    5858        Node* node = &block[i];
    59         new (node) Node(this);
     59        new (NotNull, node) Node(this);
    6060        m_freeList.push(node);
    6161    }
  • trunk/Source/JavaScriptCore/heap/HandleHeap.h

    r95901 r103243  
    159159
    160160    Node* node = m_freeList.pop();
    161     new (node) Node(this);
     161    new (NotNull, node) Node(this);
    162162    m_immediateList.push(node);
    163163    return toHandle(node);
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp

    r103083 r103243  
    3838    if (!static_cast<bool>(allocation))
    3939        CRASH();
    40     return new (allocation.base()) MarkedBlock(allocation, heap, cellSize);
     40    return new (NotNull, allocation.base()) MarkedBlock(allocation, heap, cellSize);
    4141}
    4242
    4343MarkedBlock* MarkedBlock::recycle(MarkedBlock* block, size_t cellSize)
    4444{
    45     return new (block) MarkedBlock(block->m_allocation, block->m_heap, cellSize);
     45    return new (NotNull, block) MarkedBlock(block->m_allocation, block->m_heap, cellSize);
    4646}
    4747
  • trunk/Source/JavaScriptCore/jit/JITCode.h

    r99787 r103243  
    148148        {
    149149            m_ref.~CodeRef();
    150             new (&m_ref) CodeRef();
     150            new (NotNull, &m_ref) CodeRef();
    151151        }
    152152
  • trunk/Source/JavaScriptCore/jsc.cpp

    r102953 r103243  
    157157    static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
    158158    {
    159         GlobalObject* object = new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure);
     159        GlobalObject* object = new (NotNull, allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure);
    160160        object->finishCreation(globalData, arguments);
    161161        return object;
  • trunk/Source/JavaScriptCore/profiler/CallIdentifier.h

    r95901 r103243  
    8888        static void constructDeletedValue(JSC::CallIdentifier& slot)
    8989        {
    90             new (&slot) JSC::CallIdentifier(JSC::UString(), JSC::UString(), std::numeric_limits<unsigned>::max());
     90            new (NotNull, &slot) JSC::CallIdentifier(JSC::UString(), JSC::UString(), std::numeric_limits<unsigned>::max());
    9191        }
    9292        static bool isDeletedValue(const JSC::CallIdentifier& value)
  • trunk/Source/JavaScriptCore/runtime/Arguments.h

    r102545 r103243  
    6060        static Arguments* create(JSGlobalData& globalData, CallFrame* callFrame)
    6161        {
    62             Arguments* arguments = new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame);
     62            Arguments* arguments = new (NotNull, allocateCell<Arguments>(globalData.heap)) Arguments(callFrame);
    6363            arguments->finishCreation(callFrame);
    6464            return arguments;
  • trunk/Source/JavaScriptCore/runtime/ArrayConstructor.h

    r99754 r103243  
    3434        static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
    3535        {
    36             ArrayConstructor* constructor = new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(globalObject, structure);
     36            ArrayConstructor* constructor = new (NotNull, allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(globalObject, structure);
    3737            constructor->finishCreation(exec, arrayPrototype);
    3838            return constructor;
  • trunk/Source/JavaScriptCore/runtime/ArrayPrototype.h

    r99754 r103243  
    3636        static ArrayPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3737        {
    38             ArrayPrototype* prototype = new (allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure);
     38            ArrayPrototype* prototype = new (NotNull, allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure);
    3939            prototype->finishCreation(globalObject);
    4040            return prototype;
  • trunk/Source/JavaScriptCore/runtime/BooleanConstructor.h

    r98203 r103243  
    3434        static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
    3535        {
    36             BooleanConstructor* constructor = new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(globalObject, structure);
     36            BooleanConstructor* constructor = new (NotNull, allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(globalObject, structure);
    3737            constructor->finishCreation(exec, booleanPrototype);
    3838            return constructor;
  • trunk/Source/JavaScriptCore/runtime/BooleanObject.h

    r94929 r103243  
    3636        static BooleanObject* create(JSGlobalData& globalData, Structure* structure)
    3737        {
    38             BooleanObject* boolean = new (allocateCell<BooleanObject>(globalData.heap)) BooleanObject(globalData, structure);
     38            BooleanObject* boolean = new (NotNull, allocateCell<BooleanObject>(globalData.heap)) BooleanObject(globalData, structure);
    3939            boolean->finishCreation(globalData);
    4040            return boolean;
  • trunk/Source/JavaScriptCore/runtime/BooleanPrototype.h

    r99754 r103243  
    3232        static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3333        {
    34             BooleanPrototype* prototype = new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, structure);
     34            BooleanPrototype* prototype = new (NotNull, allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, structure);
    3535            prototype->finishCreation(exec, globalObject);
    3636            return prototype;
  • trunk/Source/JavaScriptCore/runtime/DateConstructor.h

    r99754 r103243  
    3434        static DateConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
    3535        {
    36             DateConstructor* constructor = new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(globalObject, structure);
     36            DateConstructor* constructor = new (NotNull, allocateCell<DateConstructor>(*exec->heap())) DateConstructor(globalObject, structure);
    3737            constructor->finishCreation(exec, datePrototype);
    3838            return constructor;
  • trunk/Source/JavaScriptCore/runtime/DateInstance.h

    r103083 r103243  
    4343        static DateInstance* create(ExecState* exec, Structure* structure, double date)
    4444        {
    45             DateInstance* instance = new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
     45            DateInstance* instance = new (NotNull, allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
    4646            instance->finishCreation(exec->globalData(), date);
    4747            return instance;
     
    5050        static DateInstance* create(ExecState* exec, Structure* structure)
    5151        {
    52             DateInstance* instance = new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
     52            DateInstance* instance = new (NotNull, allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
    5353            instance->finishCreation(exec->globalData());
    5454            return instance;
  • trunk/Source/JavaScriptCore/runtime/DatePrototype.h

    r99754 r103243  
    3737        static DatePrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3838        {
    39             DatePrototype* prototype = new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, structure);
     39            DatePrototype* prototype = new (NotNull, allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, structure);
    4040            prototype->finishCreation(exec, globalObject);
    4141            return prototype;
  • trunk/Source/JavaScriptCore/runtime/Error.h

    r103083 r103243  
    9090        static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
    9191        {
    92             StrictModeTypeErrorFunction* function = new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);
     92            StrictModeTypeErrorFunction* function = new (NotNull, allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);
    9393            function->finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier);
    9494            return function;
  • trunk/Source/JavaScriptCore/runtime/ErrorConstructor.h

    r98203 r103243  
    3535        static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)
    3636        {
    37             ErrorConstructor* constructor = new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(globalObject, structure);
     37            ErrorConstructor* constructor = new (NotNull, allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(globalObject, structure);
    3838            constructor->finishCreation(exec, errorPrototype);
    3939            return constructor;
  • trunk/Source/JavaScriptCore/runtime/ErrorInstance.h

    r98747 r103243  
    3939        static ErrorInstance* create(JSGlobalData& globalData, Structure* structure, const UString& message)
    4040        {
    41             ErrorInstance* instance = new (allocateCell<ErrorInstance>(globalData.heap)) ErrorInstance(globalData, structure);
     41            ErrorInstance* instance = new (NotNull, allocateCell<ErrorInstance>(globalData.heap)) ErrorInstance(globalData, structure);
    4242            instance->finishCreation(globalData, message);
    4343            return instance;
     
    4646        {
    4747            if (message.isUndefined()) {
    48                 ErrorInstance* instance = new (allocateCell<ErrorInstance>(*exec->heap())) ErrorInstance(exec->globalData(), structure);
     48                ErrorInstance* instance = new (NotNull, allocateCell<ErrorInstance>(*exec->heap())) ErrorInstance(exec->globalData(), structure);
    4949                instance->finishCreation(exec->globalData(), UString("", 0));
    5050                return instance;
  • trunk/Source/JavaScriptCore/runtime/ErrorPrototype.h

    r99754 r103243  
    3434        static ErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3535        {
    36             ErrorPrototype* prototype = new (allocateCell<ErrorPrototype>(*exec->heap())) ErrorPrototype(exec, structure);
     36            ErrorPrototype* prototype = new (NotNull, allocateCell<ErrorPrototype>(*exec->heap())) ErrorPrototype(exec, structure);
    3737            prototype->finishCreation(exec, globalObject);
    3838            return prototype;
  • trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.h

    r98932 r103243  
    7070    static InterruptedExecutionError* create(JSGlobalData& globalData)
    7171    {
    72         InterruptedExecutionError* error = new (allocateCell<InterruptedExecutionError>(globalData.heap)) InterruptedExecutionError(globalData);
     72        InterruptedExecutionError* error = new (NotNull, allocateCell<InterruptedExecutionError>(globalData.heap)) InterruptedExecutionError(globalData);
    7373        error->finishCreation(globalData);
    7474        return error;
     
    9797    static TerminatedExecutionError* create(JSGlobalData& globalData)
    9898    {
    99         TerminatedExecutionError* error = new (allocateCell<TerminatedExecutionError>(globalData.heap)) TerminatedExecutionError(globalData);
     99        TerminatedExecutionError* error = new (NotNull, allocateCell<TerminatedExecutionError>(globalData.heap)) TerminatedExecutionError(globalData);
    100100        error->finishCreation(globalData);
    101101        return error;
  • trunk/Source/JavaScriptCore/runtime/Executable.h

    r103083 r103243  
    187187            NativeExecutable* executable;
    188188            if (!callThunk) {
    189                 executable = new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
     189                executable = new (NotNull, allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
    190190                executable->finishCreation(globalData, JITCode(), JITCode(), intrinsic);
    191191            } else {
    192                 executable = new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
     192                executable = new (NotNull, allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
    193193                executable->finishCreation(globalData, JITCode::HostFunction(callThunk), JITCode::HostFunction(constructThunk), intrinsic);
    194194            }
     
    202202        {
    203203            ASSERT(!globalData.canUseJIT());
    204             NativeExecutable* executable = new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
     204            NativeExecutable* executable = new (NotNull, allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
    205205            executable->finishCreation(globalData);
    206206            globalData.heap.addFinalizer(executable, &finalize);
     
    349349        static EvalExecutable* create(ExecState* exec, const SourceCode& source, bool isInStrictContext)
    350350        {
    351             EvalExecutable* executable = new (allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext);
     351            EvalExecutable* executable = new (NotNull, allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext);
    352352            executable->finishCreation(exec->globalData());
    353353            exec->globalData().heap.addFinalizer(executable, &finalize);
     
    390390        static ProgramExecutable* create(ExecState* exec, const SourceCode& source)
    391391        {
    392             ProgramExecutable* executable = new (allocateCell<ProgramExecutable>(*exec->heap())) ProgramExecutable(exec, source);
     392            ProgramExecutable* executable = new (NotNull, allocateCell<ProgramExecutable>(*exec->heap())) ProgramExecutable(exec, source);
    393393            executable->finishCreation(exec->globalData());
    394394            exec->globalData().heap.addFinalizer(executable, &finalize);
     
    459459        static FunctionExecutable* create(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
    460460        {
    461             FunctionExecutable* executable = new (allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext);
     461            FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext);
    462462            executable->finishCreation(exec->globalData(), name, firstLine, lastLine);
    463463            exec->globalData().heap.addFinalizer(executable, &finalize);
     
    467467        static FunctionExecutable* create(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
    468468        {
    469             FunctionExecutable* executable = new (allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext);
     469            FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext);
    470470            executable->finishCreation(globalData, name, firstLine, lastLine);
    471471            globalData.heap.addFinalizer(executable, &finalize);
  • trunk/Source/JavaScriptCore/runtime/FunctionConstructor.h

    r99167 r103243  
    3838        static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)
    3939        {
    40             FunctionConstructor* constructor = new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(globalObject, structure);
     40            FunctionConstructor* constructor = new (NotNull, allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(globalObject, structure);
    4141            constructor->finishCreation(exec, functionPrototype);
    4242            return constructor;
  • trunk/Source/JavaScriptCore/runtime/FunctionPrototype.h

    r97097 r103243  
    3232        static FunctionPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3333        {
    34             FunctionPrototype* prototype = new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(globalObject, structure);
     34            FunctionPrototype* prototype = new (NotNull, allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(globalObject, structure);
    3535            prototype->finishCreation(exec, exec->propertyNames().nullIdentifier);
    3636            return prototype;
  • trunk/Source/JavaScriptCore/runtime/GetterSetter.h

    r96346 r103243  
    4949        static GetterSetter* create(ExecState* exec)
    5050        {
    51             GetterSetter* getterSetter = new (allocateCell<GetterSetter>(*exec->heap())) GetterSetter(exec);
     51            GetterSetter* getterSetter = new (NotNull, allocateCell<GetterSetter>(*exec->heap())) GetterSetter(exec);
    5252            getterSetter->finishCreation(exec->globalData());
    5353            return getterSetter;
  • trunk/Source/JavaScriptCore/runtime/JSAPIValueWrapper.h

    r97620 r103243  
    4747        static JSAPIValueWrapper* create(ExecState* exec, JSValue value)
    4848        {
    49             JSAPIValueWrapper* wrapper = new (allocateCell<JSAPIValueWrapper>(*exec->heap())) JSAPIValueWrapper(exec);
     49            JSAPIValueWrapper* wrapper = new (NotNull, allocateCell<JSAPIValueWrapper>(*exec->heap())) JSAPIValueWrapper(exec);
    5050            wrapper->finishCreation(exec, value);
    5151            return wrapper;
  • trunk/Source/JavaScriptCore/runtime/JSActivation.h

    r102545 r103243  
    4949        static JSActivation* create(JSGlobalData& globalData, CallFrame* callFrame, FunctionExecutable* funcExec)
    5050        {
    51             JSActivation* activation = new (allocateCell<JSActivation>(globalData.heap)) JSActivation(callFrame, funcExec);
     51            JSActivation* activation = new (NotNull, allocateCell<JSActivation>(globalData.heap)) JSActivation(callFrame, funcExec);
    5252            activation->finishCreation(callFrame);
    5353            return activation;
  • trunk/Source/JavaScriptCore/runtime/JSArray.h

    r103083 r103243  
    7777        static JSArray* create(JSGlobalData& globalData, Structure* structure)
    7878        {
    79             JSArray* array = new (allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure);
     79            JSArray* array = new (NotNull, allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure);
    8080            array->finishCreation(globalData);
    8181            return array;
     
    8484        static JSArray* create(JSGlobalData& globalData, Structure* structure, unsigned initialLength, ArrayCreationMode createMode)
    8585        {
    86             JSArray* array = new (allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure);
     86            JSArray* array = new (NotNull, allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure);
    8787            array->finishCreation(globalData, initialLength, createMode);
    8888            return array;
     
    9191        static JSArray* create(JSGlobalData& globalData, Structure* structure, const ArgList& initialValues)
    9292        {
    93             JSArray* array = new (allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure);
     93            JSArray* array = new (NotNull, allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure);
    9494            array->finishCreation(globalData, initialValues);
    9595            return array;
     
    9898        static JSArray* create(JSGlobalData& globalData, Structure* structure, const JSValue* values, size_t length)
    9999        {
    100             JSArray* array = new (allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure);
     100            JSArray* array = new (NotNull, allocateCell<JSArray>(globalData.heap)) JSArray(globalData, structure);
    101101            array->finishCreation(globalData, values, length);
    102102            return array;
  • trunk/Source/JavaScriptCore/runtime/JSBoundFunction.cpp

    r103083 r103243  
    8383
    8484    NativeExecutable* executable = exec->globalData().getHostFunction(boundFunctionCall, canConstruct ? boundFunctionConstruct : callHostFunctionAsConstructor);
    85     JSBoundFunction* function = new (allocateCell<JSBoundFunction>(*exec->heap())) JSBoundFunction(exec, globalObject, globalObject->boundFunctionStructure(), targetFunction, boundThis, boundArgs);
     85    JSBoundFunction* function = new (NotNull, allocateCell<JSBoundFunction>(*exec->heap())) JSBoundFunction(exec, globalObject, globalObject->boundFunctionStructure(), targetFunction, boundThis, boundArgs);
    8686
    8787    function->finishCreation(exec, executable, length, name);
  • trunk/Source/JavaScriptCore/runtime/JSByteArray.h

    r103083 r103243  
    8282        static JSByteArray* create(ExecState* exec, Structure* structure, ByteArray* storage)
    8383        {
    84             JSByteArray* array = new (allocateCell<JSByteArray>(*exec->heap())) JSByteArray(exec, structure, storage);
     84            JSByteArray* array = new (NotNull, allocateCell<JSByteArray>(*exec->heap())) JSByteArray(exec, structure, storage);
    8585            array->finishCreation(exec);
    8686            return array;
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r103083 r103243  
    6666        JSCell(CreatingEarlyCellTag);
    6767
    68     public:
    69         void* operator new(size_t, void* placementNewDestination) { return placementNewDestination; } // Used for initialization after GC allocation.
    70 
    7168    protected:
    7269        JSCell(JSGlobalData&, Structure*);
  • trunk/Source/JavaScriptCore/runtime/JSFunction.cpp

    r103083 r103243  
    6161{
    6262    NativeExecutable* executable = exec->globalData().getHostFunction(nativeFunction, nativeConstructor);
    63     JSFunction* function = new (allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, globalObject, globalObject->functionStructure());
     63    JSFunction* function = new (NotNull, allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, globalObject, globalObject->functionStructure());
    6464    // Can't do this during initialization because getHostFunction might do a GC allocation.
    6565    function->finishCreation(exec, executable, length, name);
     
    6969JSFunction* JSFunction::create(ExecState* exec, JSGlobalObject* globalObject, int length, const Identifier& name, NativeExecutable* nativeExecutable)
    7070{
    71     JSFunction* function = new (allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, globalObject, globalObject->functionStructure());
     71    JSFunction* function = new (NotNull, allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, globalObject, globalObject->functionStructure());
    7272    function->finishCreation(exec, nativeExecutable, length, name);
    7373    return function;
  • trunk/Source/JavaScriptCore/runtime/JSFunction.h

    r103083 r103243  
    5959        static JSFunction* create(ExecState* exec, FunctionExecutable* executable, ScopeChainNode* scopeChain)
    6060        {
    61             JSFunction* function = new (allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, executable, scopeChain);
     61            JSFunction* function = new (NotNull, allocateCell<JSFunction>(*exec->heap())) JSFunction(exec, executable, scopeChain);
    6262            ASSERT(function->structure()->globalObject());
    6363            function->finishCreation(exec, executable, scopeChain);
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r103083 r103243  
    161161        static JSGlobalObject* create(JSGlobalData& globalData, Structure* structure)
    162162        {
    163             JSGlobalObject* globalObject = new (allocateCell<JSGlobalObject>(globalData.heap)) JSGlobalObject(globalData, structure);
     163            JSGlobalObject* globalObject = new (NotNull, allocateCell<JSGlobalObject>(globalData.heap)) JSGlobalObject(globalData, structure);
    164164            globalObject->finishCreation(globalData);
    165165            return globalObject;
  • trunk/Source/JavaScriptCore/runtime/JSGlobalThis.h

    r98909 r103243  
    3737    static JSGlobalThis* create(JSGlobalData& globalData, Structure* structure)
    3838    {
    39         JSGlobalThis* globalThis = new (allocateCell<JSGlobalThis>(globalData.heap)) JSGlobalThis(globalData, structure);
     39        JSGlobalThis* globalThis = new (NotNull, allocateCell<JSGlobalThis>(globalData.heap)) JSGlobalThis(globalData, structure);
    4040        globalThis->finishCreation(globalData);
    4141        return globalThis;
  • trunk/Source/JavaScriptCore/runtime/JSNotAnObject.h

    r99754 r103243  
    4949        static JSNotAnObject* create(ExecState* exec)
    5050        {
    51             JSNotAnObject* object = new (allocateCell<JSNotAnObject>(*exec->heap())) JSNotAnObject(exec);
     51            JSNotAnObject* object = new (NotNull, allocateCell<JSNotAnObject>(*exec->heap())) JSNotAnObject(exec);
    5252            object->finishCreation(exec->globalData());
    5353            return object;
  • trunk/Source/JavaScriptCore/runtime/JSONObject.h

    r99754 r103243  
    3939        static JSONObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    4040        {
    41             JSONObject* object = new (allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure);
     41            JSONObject* object = new (NotNull, allocateCell<JSONObject>(*exec->heap())) JSONObject(globalObject, structure);
    4242            object->finishCreation(globalObject);
    4343            return object;
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r103083 r103243  
    346346        static JSFinalObject* create(ExecState* exec, Structure* structure)
    347347        {
    348             JSFinalObject* finalObject = new (allocateCell<JSFinalObject>(*exec->heap())) JSFinalObject(exec->globalData(), structure);
     348            JSFinalObject* finalObject = new (NotNull, allocateCell<JSFinalObject>(*exec->heap())) JSFinalObject(exec->globalData(), structure);
    349349            finalObject->finishCreation(exec->globalData());
    350350            return finalObject;
  • trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.cpp

    r103083 r103243  
    5959        numCacheableSlots = o->structure()->propertyStorageSize();
    6060   
    61     JSPropertyNameIterator* jsPropertyNameIterator = new (allocateCell<JSPropertyNameIterator>(*exec->heap())) JSPropertyNameIterator(exec, propertyNames.data(), numCacheableSlots);
     61    JSPropertyNameIterator* jsPropertyNameIterator = new (NotNull, allocateCell<JSPropertyNameIterator>(*exec->heap())) JSPropertyNameIterator(exec, propertyNames.data(), numCacheableSlots);
    6262    jsPropertyNameIterator->finishCreation(exec, propertyNames.data());
    6363
  • trunk/Source/JavaScriptCore/runtime/JSPropertyNameIterator.h

    r103083 r103243  
    4949        static JSPropertyNameIterator* create(ExecState* exec, PropertyNameArrayData* propertyNameArrayData, size_t numCacheableSlot)
    5050        {
    51             JSPropertyNameIterator* iterator = new (allocateCell<JSPropertyNameIterator>(*exec->heap())) JSPropertyNameIterator(exec, propertyNameArrayData, numCacheableSlot);
     51            JSPropertyNameIterator* iterator = new (NotNull, allocateCell<JSPropertyNameIterator>(*exec->heap())) JSPropertyNameIterator(exec, propertyNameArrayData, numCacheableSlot);
    5252            iterator->finishCreation(exec, propertyNameArrayData);
    5353            return iterator;
  • trunk/Source/JavaScriptCore/runtime/JSStaticScopeObject.h

    r103083 r103243  
    3737        static JSStaticScopeObject* create(ExecState* exec, const Identifier& identifier, JSValue value, unsigned attributes)
    3838        {
    39             JSStaticScopeObject* scopeObject = new (allocateCell<JSStaticScopeObject>(*exec->heap())) JSStaticScopeObject(exec);
     39            JSStaticScopeObject* scopeObject = new (NotNull, allocateCell<JSStaticScopeObject>(*exec->heap())) JSStaticScopeObject(exec);
    4040            scopeObject->finishCreation(exec, identifier, value, attributes);
    4141            return scopeObject;
  • trunk/Source/JavaScriptCore/runtime/JSString.cpp

    r103083 r103243  
    245245inline StringObject* StringObject::create(ExecState* exec, JSGlobalObject* globalObject, JSString* string)
    246246{
    247     StringObject* object = new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), globalObject->stringObjectStructure());
     247    StringObject* object = new (NotNull, allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), globalObject->stringObjectStructure());
    248248    object->finishCreation(exec->globalData(), string);
    249249    return object;
  • trunk/Source/JavaScriptCore/runtime/JSString.h

    r103083 r103243  
    164164        static JSString* createNull(JSGlobalData& globalData)
    165165        {
    166             JSString* newString = new (allocateCell<JSString>(globalData.heap)) JSString(globalData);
     166            JSString* newString = new (NotNull, allocateCell<JSString>(globalData.heap)) JSString(globalData);
    167167            newString->finishCreation(globalData);
    168168            return newString;
     
    175175            size_t length = value->length();
    176176            size_t cost = value->cost();
    177             JSString* newString = new (allocateCell<JSString>(globalData.heap)) JSString(globalData, value);
     177            JSString* newString = new (NotNull, allocateCell<JSString>(globalData.heap)) JSString(globalData, value);
    178178            newString->finishCreation(globalData, length, cost);
    179179            return newString;
     
    181181        static JSString* create(JSGlobalData& globalData, JSString* s1, JSString* s2)
    182182        {
    183             JSString* newString = new (allocateCell<JSString>(globalData.heap)) JSString(globalData);
     183            JSString* newString = new (NotNull, allocateCell<JSString>(globalData.heap)) JSString(globalData);
    184184            newString->finishCreation(globalData, s1, s2);
    185185            return newString;
     
    187187        static JSString* create(JSGlobalData& globalData, JSString* s1, JSString* s2, JSString* s3)
    188188        {
    189             JSString* newString = new (allocateCell<JSString>(globalData.heap)) JSString(globalData);
     189            JSString* newString = new (NotNull, allocateCell<JSString>(globalData.heap)) JSString(globalData);
    190190            newString->finishCreation(globalData, s1, s2, s3);
    191191            return newString;
     
    195195            ASSERT(value);
    196196            size_t length = value->length();
    197             JSString* newString = new (allocateCell<JSString>(globalData.heap)) JSString(globalData, value);
     197            JSString* newString = new (NotNull, allocateCell<JSString>(globalData.heap)) JSString(globalData, value);
    198198            newString->finishCreation(globalData, length);
    199199            return newString;
  • trunk/Source/JavaScriptCore/runtime/MathObject.h

    r99754 r103243  
    3535        static MathObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3636        {
    37             MathObject* object = new (allocateCell<MathObject>(*exec->heap())) MathObject(globalObject, structure);
     37            MathObject* object = new (NotNull, allocateCell<MathObject>(*exec->heap())) MathObject(globalObject, structure);
    3838            object->finishCreation(exec, globalObject);
    3939            return object;
  • trunk/Source/JavaScriptCore/runtime/NativeErrorConstructor.h

    r98203 r103243  
    3737        static NativeErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, Structure* prototypeStructure, const UString& name)
    3838        {
    39             NativeErrorConstructor* constructor = new (allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(globalObject, structure);
     39            NativeErrorConstructor* constructor = new (NotNull, allocateCell<NativeErrorConstructor>(*exec->heap())) NativeErrorConstructor(globalObject, structure);
    4040            constructor->finishCreation(exec, globalObject, prototypeStructure, name);
    4141            return constructor;
  • trunk/Source/JavaScriptCore/runtime/NativeErrorPrototype.h

    r95108 r103243  
    3636        static NativeErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& name, NativeErrorConstructor* constructor)
    3737        {
    38             NativeErrorPrototype* prototype = new (allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, structure);
     38            NativeErrorPrototype* prototype = new (NotNull, allocateCell<NativeErrorPrototype>(*exec->heap())) NativeErrorPrototype(exec, structure);
    3939            prototype->finishCreation(exec, globalObject, name, constructor);
    4040            return prototype;
  • trunk/Source/JavaScriptCore/runtime/NumberConstructor.h

    r99754 r103243  
    3434        static NumberConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, NumberPrototype* numberPrototype)
    3535        {
    36             NumberConstructor* constructor = new (allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(globalObject, structure);
     36            NumberConstructor* constructor = new (NotNull, allocateCell<NumberConstructor>(*exec->heap())) NumberConstructor(globalObject, structure);
    3737            constructor->finishCreation(exec, numberPrototype);
    3838            return constructor;
  • trunk/Source/JavaScriptCore/runtime/NumberObject.h

    r96673 r103243  
    3636        static NumberObject* create(JSGlobalData& globalData, Structure* structure)
    3737        {
    38             NumberObject* number = new (allocateCell<NumberObject>(globalData.heap)) NumberObject(globalData, structure);
     38            NumberObject* number = new (NotNull, allocateCell<NumberObject>(globalData.heap)) NumberObject(globalData, structure);
    3939            number->finishCreation(globalData);
    4040            return number;
  • trunk/Source/JavaScriptCore/runtime/NumberPrototype.h

    r99754 r103243  
    3232        static NumberPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3333        {
    34             NumberPrototype* prototype = new (allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, structure);
     34            NumberPrototype* prototype = new (NotNull, allocateCell<NumberPrototype>(*exec->heap())) NumberPrototype(exec, structure);
    3535            prototype->finishCreation(exec, globalObject);
    3636            return prototype;
  • trunk/Source/JavaScriptCore/runtime/ObjectConstructor.h

    r99754 r103243  
    3434        static ObjectConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ObjectPrototype* objectPrototype)
    3535        {
    36             ObjectConstructor* constructor = new (allocateCell<ObjectConstructor>(*exec->heap())) ObjectConstructor(globalObject, structure);
     36            ObjectConstructor* constructor = new (NotNull, allocateCell<ObjectConstructor>(*exec->heap())) ObjectConstructor(globalObject, structure);
    3737            constructor->finishCreation(exec, objectPrototype);
    3838            return constructor;
  • trunk/Source/JavaScriptCore/runtime/ObjectPrototype.h

    r99754 r103243  
    3232        static ObjectPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
    3333        {
    34             ObjectPrototype* prototype = new (allocateCell<ObjectPrototype>(*exec->heap())) ObjectPrototype(exec, structure);
     34            ObjectPrototype* prototype = new (NotNull, allocateCell<ObjectPrototype>(*exec->heap())) ObjectPrototype(exec, structure);
    3535            prototype->finishCreation(exec->globalData(), globalObject);
    3636            return prototype;
  • trunk/Source/JavaScriptCore/runtime/RegExp.cpp

    r103083 r103243  
    260260RegExp* RegExp::createWithoutCaching(JSGlobalData& globalData, const UString& patternString, RegExpFlags flags)
    261261{
    262     RegExp* regExp = new (allocateCell<RegExp>(globalData.heap)) RegExp(globalData, patternString, flags);
     262    RegExp* regExp = new (NotNull, allocateCell<RegExp>(globalData.heap)) RegExp(globalData, patternString, flags);
    263263    regExp->finishCreation(globalData);
    264264    return regExp;
  • trunk/Source/JavaScriptCore/runtime/RegExpConstructor.h

    r103083 r103243  
    6262        static RegExpConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExpPrototype* regExpPrototype)
    6363        {
    64             RegExpConstructor* constructor = new (allocateCell<RegExpConstructor>(*exec->heap())) RegExpConstructor(globalObject, structure);
     64            RegExpConstructor* constructor = new (NotNull, allocateCell<RegExpConstructor>(*exec->heap())) RegExpConstructor(globalObject, structure);
    6565            constructor->finishCreation(exec, regExpPrototype);
    6666            return constructor;
  • trunk/Source/JavaScriptCore/runtime/RegExpMatchesArray.h

    r103083 r103243  
    3434        static RegExpMatchesArray* create(ExecState* exec, RegExpConstructorPrivate* ctorPrivate)
    3535        {
    36             RegExpMatchesArray* regExp = new (allocateCell<RegExpMatchesArray>(*exec->heap())) RegExpMatchesArray(exec);
     36            RegExpMatchesArray* regExp = new (NotNull, allocateCell<RegExpMatchesArray>(*exec->heap())) RegExpMatchesArray(exec);
    3737            regExp->finishCreation(exec->globalData(), ctorPrivate);
    3838            return regExp;
  • trunk/Source/JavaScriptCore/runtime/RegExpObject.h

    r103083 r103243  
    3333        static RegExpObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
    3434        {
    35             RegExpObject* object = new (allocateCell<RegExpObject>(*exec->heap())) RegExpObject(globalObject, structure, regExp);
     35            RegExpObject* object = new (NotNull, allocateCell<RegExpObject>(*exec->heap())) RegExpObject(globalObject, structure, regExp);
    3636            object->finishCreation(globalObject);
    3737            return object;
     
    4040        static RegExpObject* create(JSGlobalData& globalData, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
    4141        {
    42             RegExpObject* object = new (allocateCell<RegExpObject>(globalData.heap)) RegExpObject(globalObject, structure, regExp);
     42            RegExpObject* object = new (NotNull, allocateCell<RegExpObject>(globalData.heap)) RegExpObject(globalObject, structure, regExp);
    4343            object->finishCreation(globalObject);
    4444            return object;
  • trunk/Source/JavaScriptCore/runtime/RegExpPrototype.h

    r99754 r103243  
    3333        static RegExpPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, RegExp* regExp)
    3434        {
    35             RegExpPrototype* prototype = new (allocateCell<RegExpPrototype>(*exec->heap())) RegExpPrototype(globalObject, structure, regExp);
     35            RegExpPrototype* prototype = new (NotNull, allocateCell<RegExpPrototype>(*exec->heap())) RegExpPrototype(globalObject, structure, regExp);
    3636            prototype->finishCreation(globalObject);
    3737            return prototype;
  • trunk/Source/JavaScriptCore/runtime/ScopeChain.h

    r103083 r103243  
    5858        static ScopeChainNode* create(ExecState* exec, ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSGlobalObject* globalObject, JSObject* globalThis)
    5959        {
    60             ScopeChainNode* node = new (allocateCell<ScopeChainNode>(*exec->heap())) ScopeChainNode(next, object, globalData, globalObject, globalThis);
     60            ScopeChainNode* node = new (NotNull, allocateCell<ScopeChainNode>(*exec->heap())) ScopeChainNode(next, object, globalData, globalObject, globalThis);
    6161            node->finishCreation(globalData, globalObject);
    6262            return node;
     
    6464        static ScopeChainNode* create(ScopeChainNode* next, JSObject* object, JSGlobalData* globalData, JSGlobalObject* globalObject, JSObject* globalThis)
    6565        {
    66             ScopeChainNode* node = new (allocateCell<ScopeChainNode>(globalData->heap)) ScopeChainNode(next, object, globalData, globalObject, globalThis);
     66            ScopeChainNode* node = new (NotNull, allocateCell<ScopeChainNode>(globalData->heap)) ScopeChainNode(next, object, globalData, globalObject, globalThis);
    6767            node->finishCreation(globalData, globalObject);
    6868            return node;
  • trunk/Source/JavaScriptCore/runtime/StrictEvalActivation.h

    r98593 r103243  
    3737    static StrictEvalActivation* create(ExecState* exec)
    3838    {
    39         StrictEvalActivation* activation = new (allocateCell<StrictEvalActivation>(*exec->heap())) StrictEvalActivation(exec);
     39        StrictEvalActivation* activation = new (NotNull, allocateCell<StrictEvalActivation>(*exec->heap())) StrictEvalActivation(exec);
    4040        activation->finishCreation(exec->globalData());
    4141        return activation;
  • trunk/Source/JavaScriptCore/runtime/StringConstructor.h

    r99754 r103243  
    3434        static StringConstructor* create(ExecState* exec, JSGlobalObject* globalObject , Structure* structure, StringPrototype* stringPrototype)
    3535        {
    36             StringConstructor* constructor = new (allocateCell<StringConstructor>(*exec->heap())) StringConstructor(globalObject, structure);
     36            StringConstructor* constructor = new (NotNull, allocateCell<StringConstructor>(*exec->heap())) StringConstructor(globalObject, structure);
    3737            constructor->finishCreation(exec, stringPrototype);
    3838            return constructor;
  • trunk/Source/JavaScriptCore/runtime/StringObject.h

    r103083 r103243  
    3434        {
    3535            JSString* string = jsEmptyString(exec);
    36             StringObject* object = new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure); 
     36            StringObject* object = new (NotNull, allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure); 
    3737            object->finishCreation(exec->globalData(), string);
    3838            return object;
     
    4040        static StringObject* create(ExecState* exec, Structure* structure, JSString* string)
    4141        {
    42             StringObject* object = new (allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure);
     42            StringObject* object = new (NotNull, allocateCell<StringObject>(*exec->heap())) StringObject(exec->globalData(), structure);
    4343            object->finishCreation(exec->globalData(), string);
    4444            return object;
  • trunk/Source/JavaScriptCore/runtime/StringPrototype.h

    r99754 r103243  
    3838        {
    3939            JSString* empty = jsEmptyString(exec);
    40             StringPrototype* prototype = new (allocateCell<StringPrototype>(*exec->heap())) StringPrototype(exec, structure);
     40            StringPrototype* prototype = new (NotNull, allocateCell<StringPrototype>(*exec->heap())) StringPrototype(exec, structure);
    4141            prototype->finishCreation(exec, globalObject, empty);
    4242            return prototype;
  • trunk/Source/JavaScriptCore/runtime/Structure.h

    r103083 r103243  
    6161            ASSERT(globalData.structureStructure);
    6262            ASSERT(classInfo);
    63             Structure* structure = new (allocateCell<Structure>(globalData.heap)) Structure(globalData, globalObject, prototype, typeInfo, classInfo);
     63            Structure* structure = new (NotNull, allocateCell<Structure>(globalData.heap)) Structure(globalData, globalObject, prototype, typeInfo, classInfo);
    6464            structure->finishCreation(globalData);
    6565            return structure;
     
    189189        {
    190190            ASSERT(!globalData.structureStructure);
    191             Structure* structure = new (allocateCell<Structure>(globalData.heap)) Structure(globalData);
     191            Structure* structure = new (NotNull, allocateCell<Structure>(globalData.heap)) Structure(globalData);
    192192            structure->finishCreation(globalData, CreatingEarlyCell);
    193193            return structure;
     
    204204        {
    205205            ASSERT(globalData.structureStructure);
    206             Structure* newStructure = new (allocateCell<Structure>(globalData.heap)) Structure(globalData, structure);
     206            Structure* newStructure = new (NotNull, allocateCell<Structure>(globalData.heap)) Structure(globalData, structure);
    207207            newStructure->finishCreation(globalData);
    208208            return newStructure;
  • trunk/Source/JavaScriptCore/runtime/StructureChain.h

    r103083 r103243  
    4848        static StructureChain* create(JSGlobalData& globalData, Structure* head)
    4949        {
    50             StructureChain* chain = new (allocateCell<StructureChain>(globalData.heap)) StructureChain(globalData, globalData.structureChainStructure.get());
     50            StructureChain* chain = new (NotNull, allocateCell<StructureChain>(globalData.heap)) StructureChain(globalData, globalData.structureChainStructure.get());
    5151            chain->finishCreation(globalData, head);
    5252            return chain;
  • trunk/Source/JavaScriptCore/testRegExp.cpp

    r102917 r103243  
    118118    static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
    119119    {
    120         return new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure, arguments);
     120        return new (NotNull, allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure, arguments);
    121121    }
    122122
  • trunk/Source/JavaScriptCore/wtf/BitVector.cpp

    r101639 r103243  
    7777    numBits = (numBits + bitsInPointer() - 1) & ~(bitsInPointer() - 1);
    7878    size_t size = sizeof(OutOfLineBits) + sizeof(uintptr_t) * (numBits / bitsInPointer());
    79     OutOfLineBits* result = new (fastMalloc(size)) OutOfLineBits(numBits);
     79    OutOfLineBits* result = new (NotNull, fastMalloc(size)) OutOfLineBits(numBits);
    8080    return result;
    8181}
  • trunk/Source/JavaScriptCore/wtf/BumpPointerAllocator.h

    r95901 r103243  
    122122        PageAllocation allocation = PageAllocation::allocate(poolSize);
    123123        if (!!allocation)
    124             return new(allocation) BumpPointerPool(allocation);
     124            return new (allocation) BumpPointerPool(allocation);
    125125        return 0;
    126126    }
  • trunk/Source/JavaScriptCore/wtf/ByteArray.cpp

    r97876 r103243  
    3535    unsigned char* buffer = new unsigned char[size + OBJECT_OFFSETOF(ByteArray, m_data)];
    3636    ASSERT((reinterpret_cast<size_t>(buffer) & 3) == 0);
    37     return adoptRef(new (buffer) ByteArray(size));
     37    return adoptRef(new (NotNull, buffer) ByteArray(size));
    3838}
    3939
  • trunk/Source/JavaScriptCore/wtf/Deque.h

    r99929 r103243  
    455455        checkValidity();
    456456        expandCapacityIfNeeded();
    457         new (&m_buffer.buffer()[m_end]) T(value);
     457        new (NotNull, &m_buffer.buffer()[m_end]) T(value);
    458458        if (m_end == m_buffer.capacity() - 1)
    459459            m_end = 0;
     
    472472        else
    473473            --m_start;
    474         new (&m_buffer.buffer()[m_start]) T(value);
     474        new (NotNull, &m_buffer.buffer()[m_start]) T(value);
    475475        checkValidity();
    476476    }
  • trunk/Source/JavaScriptCore/wtf/FastAllocBase.h

    r95901 r103243  
    9191#include "Assertions.h"
    9292#include "FastMalloc.h"
     93#include "StdLibExtras.h"
    9394#include "TypeTraits.h"
    9495
     
    123124         ::WTF::fastFree(p); \
    124125    } \
     126    void* operator new(size_t, NotNullTag, void* location) \
     127    { \
     128        ASSERT(location); \
     129        return location; \
     130    } \
    125131private: \
    126132typedef int ThisIsHereToForceASemicolonAfterThisMacro
     
    139145
    140146        fastMallocMatchValidateMalloc(p, Internal::AllocTypeFastNew);
    141         return ::new(p) T;
     147        return ::new (p) T;
    142148    }
    143149
     
    151157
    152158        fastMallocMatchValidateMalloc(p, Internal::AllocTypeFastNew);
    153         return ::new(p) T(arg1);
     159        return ::new (p) T(arg1);
    154160    }
    155161
     
    163169
    164170        fastMallocMatchValidateMalloc(p, Internal::AllocTypeFastNew);
    165         return ::new(p) T(arg1, arg2);
     171        return ::new (p) T(arg1, arg2);
    166172    }
    167173
     
    175181
    176182        fastMallocMatchValidateMalloc(p, Internal::AllocTypeFastNew);
    177         return ::new(p) T(arg1, arg2, arg3);
     183        return ::new (p) T(arg1, arg2, arg3);
    178184    }
    179185
     
    187193
    188194        fastMallocMatchValidateMalloc(p, Internal::AllocTypeFastNew);
    189         return ::new(p) T(arg1, arg2, arg3, arg4);
     195        return ::new (p) T(arg1, arg2, arg3, arg4);
    190196    }
    191197
     
    199205
    200206        fastMallocMatchValidateMalloc(p, Internal::AllocTypeFastNew);
    201         return ::new(p) T(arg1, arg2, arg3, arg4, arg5);
     207        return ::new (p) T(arg1, arg2, arg3, arg4, arg5);
    202208    }
    203209
     
    245251
    246252                for (T* pObject = p, *pObjectEnd = pObject + count; pObject != pObjectEnd; ++pObject)
    247                     ::new(pObject) T;
     253                    ::new (pObject) T;
    248254
    249255                return p;
     
    287293
    288294                for (T* pT = a.t, *pTEnd = pT + count; pT != pTEnd; ++pT)
    289                     ::new(pT) T;
     295                    ::new (pT) T;
    290296
    291297                return a.t;
  • trunk/Source/JavaScriptCore/wtf/HashTable.h

    r102483 r103243  
    642642        template<typename Traits, typename Value> static void initialize(Value& bucket)
    643643        {
    644             new (&bucket) Value(Traits::emptyValue());
     644            new (NotNull, &bucket) Value(Traits::emptyValue());
    645645        }
    646646    };
  • trunk/Source/JavaScriptCore/wtf/HashTraits.h

    r102410 r103243  
    2323
    2424#include "HashFunctions.h"
     25#include "StdLibExtras.h"
    2526#include "TypeTraits.h"
    2627#include <utility>
     
    106107    template<typename T> struct SimpleClassHashTraits : GenericHashTraits<T> {
    107108        static const bool emptyValueIsZero = true;
    108         static void constructDeletedValue(T& slot) { new (&slot) T(HashTableDeletedValue); }
     109        static void constructDeletedValue(T& slot) { new (NotNull, &slot) T(HashTableDeletedValue); }
    109110        static bool isDeletedValue(const T& value) { return value.isHashTableDeletedValue(); }
    110111    };
  • trunk/Source/JavaScriptCore/wtf/MetaAllocator.cpp

    r96936 r103243  
    398398    m_mallocBalance++;
    399399#endif
    400     return new (fastMalloc(sizeof(FreeSpaceNode))) FreeSpaceNode(0, 0);
     400    return new (NotNull, fastMalloc(sizeof(FreeSpaceNode))) FreeSpaceNode(0, 0);
    401401}
    402402
  • trunk/Source/JavaScriptCore/wtf/StdLibExtras.h

    r97675 r103243  
    276276} // namespace WTF
    277277
     278// This version of placement new omits a 0 check.
     279enum NotNullTag { NotNull };
     280inline void* operator new(size_t, NotNullTag, void* location)
     281{
     282    ASSERT(location);
     283    return location;
     284}
     285
    278286using WTF::binarySearch;
    279287using WTF::bitwise_cast;
  • trunk/Source/JavaScriptCore/wtf/ThreadSpecific.h

    r101483 r103243  
    254254        ptr = static_cast<T*>(fastZeroedMalloc(sizeof(T)));
    255255        set(ptr);
    256         new (ptr) T;
     256        new (NotNull, ptr) T;
    257257    }
    258258    return ptr;
  • trunk/Source/JavaScriptCore/wtf/Vector.h

    r99733 r103243  
    7575        {
    7676            for (T* cur = begin; cur != end; ++cur)
    77                 new (cur) T;
     77                new (NotNull, cur) T;
    7878        }
    7979    };
     
    9797        {
    9898            while (src != srcEnd) {
    99                 new (dst) T(*src);
     99                new (NotNull, dst) T(*src);
    100100#if COMPILER(SUNCC) && __SUNPRO_CC <= 0x590
    101101                const_cast<T*>(src)->~T(); // Work around obscure SunCC 12 compiler bug.
     
    116116                    --srcEnd;
    117117                    --dstEnd;
    118                     new (dstEnd) T(*srcEnd);
     118                    new (NotNull, dstEnd) T(*srcEnd);
    119119                    srcEnd->~T();
    120120                }
     
    145145        {
    146146            while (src != srcEnd) {
    147                 new (dst) T(*src);
     147                new (NotNull, dst) T(*src);
    148148                ++dst;
    149149                ++src;
     
    170170        {
    171171            while (dst != dstEnd) {
    172                 new (dst) T(val);
     172                new (NotNull, dst) T(val);
    173173                ++dst;
    174174            }
     
    928928        T* dest = end();
    929929        for (size_t i = 0; i < dataSize; ++i)
    930             new (&dest[i]) T(data[i]);
     930            new (NotNull, &dest[i]) T(data[i]);
    931931        m_size = newSize;
    932932    }
     
    946946        T* dest = end();
    947947        for (size_t i = 0; i < dataSize; ++i)
    948             new (&dest[i]) T(data[i]);
     948            new (NotNull, &dest[i]) T(data[i]);
    949949        m_size = newSize;
    950950        return true;
     
    968968        // however, because it subverts implicit conversions, so a better
    969969        // one is needed.
    970         new (end()) T(static_cast<T>(*ptr));
     970        new (NotNull, end()) T(static_cast<T>(*ptr));
    971971#else
    972         new (end()) T(*ptr);
     972        new (NotNull, end()) T(*ptr);
    973973#endif
    974974        ++m_size;
     
    983983        ASSERT(size() < capacity());
    984984        const U* ptr = &val;
    985         new (end()) T(*ptr);
     985        new (NotNull, end()) T(*ptr);
    986986        ++m_size;
    987987    }
     
    10111011        TypeOperations::moveOverlapping(spot, end(), spot + dataSize);
    10121012        for (size_t i = 0; i < dataSize; ++i)
    1013             new (&spot[i]) T(data[i]);
     1013            new (NotNull, &spot[i]) T(data[i]);
    10141014        m_size = newSize;
    10151015    }
     
    10271027        T* spot = begin() + position;
    10281028        TypeOperations::moveOverlapping(spot, end(), spot + 1);
    1029         new (spot) T(*data);
     1029        new (NotNull, spot) T(*data);
    10301030        ++m_size;
    10311031    }
  • trunk/Source/JavaScriptCore/wtf/text/AtomicStringHash.h

    r95901 r103243  
    5252    template<> struct HashTraits<WTF::AtomicString> : GenericHashTraits<WTF::AtomicString> {
    5353        static const bool emptyValueIsZero = true;
    54         static void constructDeletedValue(WTF::AtomicString& slot) { new (&slot) WTF::AtomicString(HashTableDeletedValue); }
     54        static void constructDeletedValue(WTF::AtomicString& slot) { new (NotNull, &slot) WTF::AtomicString(HashTableDeletedValue); }
    5555        static bool isDeletedValue(const WTF::AtomicString& slot) { return slot.isHashTableDeletedValue(); }
    5656    };
  • trunk/Source/JavaScriptCore/wtf/text/StringImpl.cpp

    r102631 r103243  
    9090
    9191    data = reinterpret_cast<LChar*>(string + 1);
    92     return adoptRef(new (string) StringImpl(length, Force8BitConstructor));
     92    return adoptRef(new (NotNull, string) StringImpl(length, Force8BitConstructor));
    9393}
    9494
     
    109109
    110110    data = reinterpret_cast<UChar*>(string + 1);
    111     return adoptRef(new (string) StringImpl(length));
     111    return adoptRef(new (NotNull, string) StringImpl(length));
    112112}
    113113
     
    131131
    132132    data = reinterpret_cast<LChar*>(string + 1);
    133     return adoptRef(new (string) StringImpl(length, Force8BitConstructor));
     133    return adoptRef(new (NotNull, string) StringImpl(length, Force8BitConstructor));
    134134}
    135135
     
    153153
    154154    data = reinterpret_cast<UChar*>(string + 1);
    155     return adoptRef(new (string) StringImpl(length));
     155    return adoptRef(new (NotNull, string) StringImpl(length));
    156156}
    157157
  • trunk/Source/JavaScriptCore/wtf/text/StringImpl.h

    r102692 r103243  
    248248
    249249        if (sizeof(T) == sizeof(char))
    250             return adoptRef(new(resultImpl) StringImpl(length, Force8BitConstructor));
    251 
    252         return adoptRef(new(resultImpl) StringImpl(length));
     250            return adoptRef(new (NotNull, resultImpl) StringImpl(length, Force8BitConstructor));
     251
     252        return adoptRef(new (NotNull, resultImpl) StringImpl(length));
    253253    }
    254254
  • trunk/Source/JavaScriptCore/wtf/text/StringStatics.cpp

    r102849 r103243  
    6969
    7070        // Use placement new to initialize the globals.
    71         new ((void*)&nullAtom) AtomicString;
    72         new ((void*)&emptyAtom) AtomicString("");
    73         new ((void*)&textAtom) AtomicString("#text");
    74         new ((void*)&commentAtom) AtomicString("#comment");
    75         new ((void*)&starAtom) AtomicString("*");
    76         new ((void*)&xmlAtom) AtomicString("xml");
    77         new ((void*)&xmlnsAtom) AtomicString("xmlns");
     71        new (NotNull, (void*)&nullAtom) AtomicString;
     72        new (NotNull, (void*)&emptyAtom) AtomicString("");
     73        new (NotNull, (void*)&textAtom) AtomicString("#text");
     74        new (NotNull, (void*)&commentAtom) AtomicString("#comment");
     75        new (NotNull, (void*)&starAtom) AtomicString("*");
     76        new (NotNull, (void*)&xmlAtom) AtomicString("xml");
     77        new (NotNull, (void*)&xmlnsAtom) AtomicString("xmlns");
    7878
    7979        initialized = true;
  • trunk/Source/JavaScriptCore/yarr/YarrInterpreter.cpp

    r100523 r103243  
    111111        if (!allocatorPool)
    112112            CRASH();
    113         return new(allocatorPool->alloc(size)) DisjunctionContext();
     113        return new (allocatorPool->alloc(size)) DisjunctionContext();
    114114    }
    115115
     
    132132            }
    133133
    134             new(getDisjunctionContext(term)) DisjunctionContext();
     134            new (getDisjunctionContext(term)) DisjunctionContext();
    135135        }
    136136
     
    161161        if (!allocatorPool)
    162162            CRASH();
    163         return new(allocatorPool->alloc(size)) ParenthesesDisjunctionContext(output, term);
     163        return new (allocatorPool->alloc(size)) ParenthesesDisjunctionContext(output, term);
    164164    }
    165165
  • trunk/Source/WebCore/ChangeLog

    r103242 r103243  
     12011-12-15  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Placement new does an unnecessary NULL check
     4        https://bugs.webkit.org/show_bug.cgi?id=74676
     5
     6        Reviewed by Sam Weinig.
     7
     8        * bindings/js/JSImageConstructor.h:
     9        (WebCore::JSImageConstructor::create):
     10        * bindings/scripts/CodeGeneratorJS.pm:
     11        (GenerateHeader):
     12        (GenerateConstructorDeclaration):
     13        * bridge/c/CRuntimeObject.h:
     14        (JSC::Bindings::CRuntimeObject::create):
     15        * bridge/c/c_instance.cpp:
     16        (JSC::Bindings::CRuntimeMethod::create):
     17        * bridge/jni/jsc/JavaInstanceJSC.cpp:
     18        (JavaRuntimeMethod::create):
     19        * bridge/jni/jsc/JavaRuntimeObject.h:
     20        (JSC::Bindings::JavaRuntimeObject::create):
     21        * bridge/objc/ObjCRuntimeObject.h:
     22        (JSC::Bindings::ObjCRuntimeObject::create):
     23        * bridge/objc/objc_instance.mm:
     24        (ObjCRuntimeMethod::create):
     25        * bridge/objc/objc_runtime.h:
     26        (JSC::Bindings::ObjcFallbackObjectImp::create):
     27        * bridge/runtime_array.h:
     28        (JSC::RuntimeArray::create):
     29        * bridge/runtime_method.h:
     30        (JSC::RuntimeMethod::create):
     31        * bridge/runtime_object.h:
     32        (JSC::Bindings::RuntimeObject::create):
     33        * dom/Document.h:
     34        (WebCore::FormElementKeyHashTraits::constructDeletedValue): Use NotNull
     35        placement new, as in JavaScriptCore.
     36
     37        * platform/PODArena.h:
     38        (WebCore::PODArena::allocateObject): No need to check for NULL explicitly,
     39        since that's the built-in behavior of placement new.
     40
     41        * platform/graphics/FontCache.cpp:
     42        (WebCore::FontDataCacheKeyTraits::constructDeletedValue):
     43        * platform/graphics/IntRectHash.h:
     44        * platform/graphics/IntSizeHash.h: More NotNull.
     45
     46        * rendering/RenderObject.h: Declaring that we throw is the C++ way to say
     47        that operator new will not return NULL.
     48
    1492011-12-19  Eric Carlson  <eric.carlson@apple.com>
    250
  • trunk/Source/WebCore/bindings/js/JSImageConstructor.h

    r98203 r103243  
    3232        static JSImageConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
    3333        {
    34             JSImageConstructor* constructor = new (JSC::allocateCell<JSImageConstructor>(*exec->heap())) JSImageConstructor(structure, globalObject);
     34            JSImageConstructor* constructor = new (NotNull, JSC::allocateCell<JSImageConstructor>(*exec->heap())) JSImageConstructor(structure, globalObject);
    3535            constructor->finishCreation(exec, globalObject);
    3636            return constructor;
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm

    r103221 r103243  
    746746        push(@headerContent, "    static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl, JSDOMWindowShell* windowShell)\n");
    747747        push(@headerContent, "    {\n");
    748         push(@headerContent, "        $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl, windowShell);\n");
     748        push(@headerContent, "        $className* ptr = new (NotNull, JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl, windowShell);\n");
    749749        push(@headerContent, "        ptr->finishCreation(globalData, windowShell);\n");
    750750        push(@headerContent, "        return ptr;\n");
     
    753753        push(@headerContent, "    static $className* create(JSC::JSGlobalData& globalData, JSC::Structure* structure, PassRefPtr<$implType> impl)\n");
    754754        push(@headerContent, "    {\n");
    755         push(@headerContent, "        $className* ptr = new (JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl);\n");
     755        push(@headerContent, "        $className* ptr = new (NotNull, JSC::allocateCell<$className>(globalData.heap)) ${className}(globalData, structure, impl);\n");
    756756        push(@headerContent, "        ptr->finishCreation(globalData);\n");
    757757        push(@headerContent, "        return ptr;\n");
     
    761761        push(@headerContent, "    static $className* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<$implType> impl)\n");
    762762        push(@headerContent, "    {\n");
    763         push(@headerContent, "        $className* ptr = new (JSC::allocateCell<$className>(globalObject->globalData().heap)) $className(structure, globalObject, impl);\n");
     763        push(@headerContent, "        $className* ptr = new (NotNull, JSC::allocateCell<$className>(globalObject->globalData().heap)) $className(structure, globalObject, impl);\n");
    764764        push(@headerContent, "        ptr->finishCreation(globalObject->globalData());\n");
    765765        push(@headerContent, "        return ptr;\n");
     
    10661066    push(@headerContent, "    static ${className}Prototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)\n");
    10671067    push(@headerContent, "    {\n");
    1068     push(@headerContent, "        ${className}Prototype* ptr = new (JSC::allocateCell<${className}Prototype>(globalData.heap)) ${className}Prototype(globalData, globalObject, structure);\n");
     1068    push(@headerContent, "        ${className}Prototype* ptr = new (NotNull, JSC::allocateCell<${className}Prototype>(globalData.heap)) ${className}Prototype(globalData, globalObject, structure);\n");
    10691069    push(@headerContent, "        ptr->finishCreation(globalData);\n");
    10701070    push(@headerContent, "        return ptr;\n");
     
    33273327    push(@$outputArray, "    static $constructorClassName* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)\n");
    33283328    push(@$outputArray, "    {\n");
    3329     push(@$outputArray, "        $constructorClassName* ptr = new (JSC::allocateCell<$constructorClassName>(*exec->heap())) $constructorClassName(structure, globalObject);\n");
     3329    push(@$outputArray, "        $constructorClassName* ptr = new (NotNull, JSC::allocateCell<$constructorClassName>(*exec->heap())) $constructorClassName(structure, globalObject);\n");
    33303330    push(@$outputArray, "        ptr->finishCreation(exec, globalObject);\n");
    33313331    push(@$outputArray, "        return ptr;\n");
     
    33623362    static JS${interfaceName}NamedConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
    33633363    {
    3364         JS${interfaceName}NamedConstructor* constructor = new (JSC::allocateCell<JS${interfaceName}NamedConstructor>(*exec->heap())) JS${interfaceName}NamedConstructor(structure, globalObject);
     3364        JS${interfaceName}NamedConstructor* constructor = new (NotNull, JSC::allocateCell<JS${interfaceName}NamedConstructor>(*exec->heap())) JS${interfaceName}NamedConstructor(structure, globalObject);
    33653365        constructor->finishCreation(exec, globalObject);
    33663366        return constructor;
  • trunk/Source/WebCore/bridge/c/CRuntimeObject.h

    r103083 r103243  
    4646        // We need to pass in the right global object for "i".
    4747        Structure* domStructure = WebCore::deprecatedGetDOMStructure<CRuntimeObject>(exec);
    48         CRuntimeObject* object = new (allocateCell<CRuntimeObject>(*exec->heap())) CRuntimeObject(exec, globalObject, domStructure, instance);
     48        CRuntimeObject* object = new (NotNull, allocateCell<CRuntimeObject>(*exec->heap())) CRuntimeObject(exec, globalObject, domStructure, instance);
    4949        object->finishCreation(globalObject);
    5050        return object;
  • trunk/Source/WebCore/bridge/c/c_instance.cpp

    r95936 r103243  
    119119        // We need to pass in the right global object for "i".
    120120        Structure* domStructure = WebCore::deprecatedGetDOMStructure<CRuntimeMethod>(exec);
    121         CRuntimeMethod* method = new (allocateCell<CRuntimeMethod>(*exec->heap())) CRuntimeMethod(globalObject, domStructure, list);
     121        CRuntimeMethod* method = new (NotNull, allocateCell<CRuntimeMethod>(*exec->heap())) CRuntimeMethod(globalObject, domStructure, list);
    122122        method->finishCreation(exec->globalData(), name);
    123123        return method;
  • trunk/Source/WebCore/bridge/jni/jsc/JavaInstanceJSC.cpp

    r95936 r103243  
    124124        // We need to pass in the right global object for "i".
    125125        Structure* domStructure = WebCore::deprecatedGetDOMStructure<JavaRuntimeMethod>(exec);
    126         JavaRuntimeMethod* method = new (allocateCell<JavaRuntimeMethod>(*exec->heap())) JavaRuntimeMethod(globalObject, domStructure, list);
     126        JavaRuntimeMethod* method = new (NotNull, allocateCell<JavaRuntimeMethod>(*exec->heap())) JavaRuntimeMethod(globalObject, domStructure, list);
    127127        method->finishCreation(exec->globalData(), name);
    128128        return method;
  • trunk/Source/WebCore/bridge/jni/jsc/JavaRuntimeObject.h

    r103083 r103243  
    4444        // We need to pass in the right global object for "i".
    4545        Structure* domStructure = WebCore::deprecatedGetDOMStructure<JavaRuntimeObject>(exec);
    46         JavaRuntimeObject* object = new (allocateCell<JavaRuntimeObject>(*exec->heap())) JavaRuntimeObject(exec, globalObject, domStructure, javaInstance);
     46        JavaRuntimeObject* object = new (NotNull, allocateCell<JavaRuntimeObject>(*exec->heap())) JavaRuntimeObject(exec, globalObject, domStructure, javaInstance);
    4747        object->finishCreation(globalObject);
    4848        return object;
  • trunk/Source/WebCore/bridge/objc/ObjCRuntimeObject.h

    r103083 r103243  
    4343        // We need to pass in the right global object for "i".
    4444        Structure* structure = WebCore::deprecatedGetDOMStructure<ObjCRuntimeObject>(exec);
    45         ObjCRuntimeObject* object = new (allocateCell<ObjCRuntimeObject>(*exec->heap())) ObjCRuntimeObject(exec, globalObject, inst, structure);
     45        ObjCRuntimeObject* object = new (NotNull, allocateCell<ObjCRuntimeObject>(*exec->heap())) ObjCRuntimeObject(exec, globalObject, inst, structure);
    4646        object->finishCreation(globalObject);
    4747        return object;
  • trunk/Source/WebCore/bridge/objc/objc_instance.mm

    r102691 r103243  
    187187        // We need to pass in the right global object for "i".
    188188        Structure* domStructure = WebCore::deprecatedGetDOMStructure<ObjCRuntimeMethod>(exec);
    189         ObjCRuntimeMethod* method = new (allocateCell<ObjCRuntimeMethod>(*exec->heap())) ObjCRuntimeMethod(globalObject, domStructure, list);
     189        ObjCRuntimeMethod* method = new (NotNull, allocateCell<ObjCRuntimeMethod>(*exec->heap())) ObjCRuntimeMethod(globalObject, domStructure, list);
    190190        method->finishCreation(exec->globalData(), name);
    191191        return method;
  • trunk/Source/WebCore/bridge/objc/objc_runtime.h

    r103083 r103243  
    9999        // FIXME: deprecatedGetDOMStructure uses the prototype off of the wrong global object
    100100        Structure* domStructure = WebCore::deprecatedGetDOMStructure<ObjcFallbackObjectImp>(exec);
    101         ObjcFallbackObjectImp* fallbackObject = new (allocateCell<ObjcFallbackObjectImp>(*exec->heap())) ObjcFallbackObjectImp(globalObject, domStructure, instance, propertyName);
     101        ObjcFallbackObjectImp* fallbackObject = new (NotNull, allocateCell<ObjcFallbackObjectImp>(*exec->heap())) ObjcFallbackObjectImp(globalObject, domStructure, instance, propertyName);
    102102        fallbackObject->finishCreation(globalObject);
    103103        return fallbackObject;
  • trunk/Source/WebCore/bridge/runtime_array.h

    r103083 r103243  
    4242        // We need to pass in the right global object for "array".
    4343        Structure* domStructure = WebCore::deprecatedGetDOMStructure<RuntimeArray>(exec);
    44         RuntimeArray* runtimeArray = new (allocateCell<RuntimeArray>(*exec->heap())) RuntimeArray(exec, domStructure);
     44        RuntimeArray* runtimeArray = new (NotNull, allocateCell<RuntimeArray>(*exec->heap())) RuntimeArray(exec, domStructure);
    4545        runtimeArray->finishCreation(exec->globalData(), array);
    4646        return runtimeArray;
  • trunk/Source/WebCore/bridge/runtime_method.h

    r103083 r103243  
    4242    static RuntimeMethod* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const Identifier& name, Bindings::MethodList& methodList)
    4343    {
    44         RuntimeMethod* method = new (allocateCell<RuntimeMethod>(*exec->heap())) RuntimeMethod(globalObject, structure, methodList);
     44        RuntimeMethod* method = new (NotNull, allocateCell<RuntimeMethod>(*exec->heap())) RuntimeMethod(globalObject, structure, methodList);
    4545        method->finishCreation(exec->globalData(), name);
    4646        return method;
  • trunk/Source/WebCore/bridge/runtime_object.h

    r103083 r103243  
    3939    static RuntimeObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, PassRefPtr<Instance> instance)
    4040    {
    41         RuntimeObject* object = new (allocateCell<RuntimeObject>(*exec->heap())) RuntimeObject(exec, globalObject, structure, instance);
     41        RuntimeObject* object = new (NotNull, allocateCell<RuntimeObject>(*exec->heap())) RuntimeObject(exec, globalObject, structure, instance);
    4242        object->finishCreation(globalObject);
    4343        return object;
  • trunk/Source/WebCore/dom/Document.h

    r103166 r103243  
    202202
    203203struct FormElementKeyHashTraits : WTF::GenericHashTraits<FormElementKey> {
    204     static void constructDeletedValue(FormElementKey& slot) { new (&slot) FormElementKey(WTF::HashTableDeletedValue); }
     204    static void constructDeletedValue(FormElementKey& slot) { new (NotNull, &slot) FormElementKey(WTF::HashTableDeletedValue); }
    205205    static bool isDeletedValue(const FormElementKey& value) { return value.isHashTableDeletedValue(); }
    206206};
  • trunk/Source/WebCore/platform/PODArena.h

    r103030 r103243  
    8787    template<class T> T* allocateObject()
    8888    {
    89         void* ptr = allocateBase<T>();
    90         if (ptr) {
    91             // Use placement operator new to allocate a T at this location.
    92             new(ptr) T();
    93         }
    94         return static_cast<T*>(ptr);
     89        return new (allocateBase<T>()) T();
    9590    }
    9691
     
    9893    template<class T, class Argument1Type> T* allocateObject(const Argument1Type& argument1)
    9994    {
    100         void* ptr = allocateBase<T>();
    101         if (ptr) {
    102             // Use placement operator new to allocate a T at this location.
    103             new(ptr) T(argument1);
    104         }
    105         return static_cast<T*>(ptr);
     95        return new (allocateBase<T>()) T(argument1);
    10696    }
    10797
  • trunk/Source/WebCore/platform/graphics/FontCache.cpp

    r96342 r103243  
    241241    static void constructDeletedValue(FontPlatformData& slot)
    242242    {
    243         new (&slot) FontPlatformData(HashTableDeletedValue);
     243        new (NotNull, &slot) FontPlatformData(HashTableDeletedValue);
    244244    }
    245245    static bool isDeletedValue(const FontPlatformData& value)
  • trunk/Source/WebCore/platform/graphics/IntRectHash.h

    r95901 r103243  
    5151    static const bool emptyValueIsZero = true;
    5252    static const bool needsDestruction = false;
    53     static void constructDeletedValue(WebCore::IntRect& slot) { new (&slot) WebCore::IntRect(-1, -1, -1, -1); }
     53    static void constructDeletedValue(WebCore::IntRect& slot) { new (NotNull, &slot) WebCore::IntRect(-1, -1, -1, -1); }
    5454    static bool isDeletedValue(const WebCore::IntRect& value) { return value.x() == -1 && value.y() == -1 && value.width() == -1 && value.height() == -1; }
    5555};
  • trunk/Source/WebCore/platform/graphics/IntSizeHash.h

    r76660 r103243  
    3737        static const bool emptyValueIsZero = true;
    3838        static const bool needsDestruction = false;
    39         static void constructDeletedValue(WebCore::IntSize& slot) { new (&slot) WebCore::IntSize(-1, -1); }
     39        static void constructDeletedValue(WebCore::IntSize& slot) { new (NotNull, &slot) WebCore::IntSize(-1, -1); }
    4040        static bool isDeletedValue(const WebCore::IntSize& value) { return value.width() == -1 && value.height() == -1; }
    4141    };
  • trunk/Source/WebCore/rendering/BidiRun.cpp

    r96880 r103243  
    5454}
    5555
    56 void* BidiRun::operator new(size_t sz, RenderArena* renderArena) throw()
     56void* BidiRun::operator new(size_t sz, RenderArena* renderArena)
    5757{
    5858#ifndef NDEBUG
  • trunk/Source/WebCore/rendering/BidiRun.h

    r95901 r103243  
    4646
    4747    // Overloaded new operator.
    48     void* operator new(size_t, RenderArena*) throw();
     48    void* operator new(size_t, RenderArena*);
    4949
    5050    // Overridden to prevent the normal delete from being called.
  • trunk/Source/WebCore/rendering/InlineBox.cpp

    r101342 r103243  
    8787}
    8888
    89 void* InlineBox::operator new(size_t sz, RenderArena* renderArena) throw()
     89void* InlineBox::operator new(size_t sz, RenderArena* renderArena)
    9090{
    9191    return renderArena->allocate(sz);
  • trunk/Source/WebCore/rendering/InlineBox.h

    r101342 r103243  
    125125
    126126    // Overloaded new operator.
    127     void* operator new(size_t, RenderArena*) throw();
     127    void* operator new(size_t, RenderArena*);
    128128
    129129    // Overridden to prevent the normal delete from being called.
  • trunk/Source/WebCore/rendering/LayoutState.cpp

    r97888 r103243  
    167167}
    168168
    169 void* LayoutState::operator new(size_t sz, RenderArena* renderArena) throw()
     169void* LayoutState::operator new(size_t sz, RenderArena* renderArena)
    170170{
    171171    return renderArena->allocate(sz);
  • trunk/Source/WebCore/rendering/LayoutState.h

    r95648 r103243  
    6161
    6262    // Overloaded new operator.
    63     void* operator new(size_t, RenderArena*) throw();
     63    void* operator new(size_t, RenderArena*);
    6464
    6565    // Overridden to prevent the normal delete from being called.
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r103170 r103243  
    124124const int MinimumHeightWhileResizing = 40;
    125125
    126 void* ClipRects::operator new(size_t sz, RenderArena* renderArena) throw()
     126void* ClipRects::operator new(size_t sz, RenderArena* renderArena)
    127127{
    128128    return renderArena->allocate(sz);
     
    10731073}
    10741074
    1075 void* RenderLayer::operator new(size_t sz, RenderArena* renderArena) throw()
     1075void* RenderLayer::operator new(size_t sz, RenderArena* renderArena)
    10761076{
    10771077    return renderArena->allocate(sz);
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r103170 r103243  
    178178
    179179    // Overloaded new operator.
    180     void* operator new(size_t, RenderArena*) throw();
     180    void* operator new(size_t, RenderArena*);
    181181
    182182    // Overridden to prevent the normal delete from being called.
     
    528528    // Overloaded new operator. Derived classes must override operator new
    529529    // in order to allocate out of the RenderArena.
    530     void* operator new(size_t, RenderArena*) throw();
     530    void* operator new(size_t, RenderArena*);
    531531
    532532    // Overridden to prevent the normal delete from being called.
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r103020 r103243  
    9999bool RenderObject::s_affectsParentBlock = false;
    100100
    101 void* RenderObject::operator new(size_t sz, RenderArena* renderArena) throw()
     101void* RenderObject::operator new(size_t sz, RenderArena* renderArena)
    102102{
    103103    return renderArena->allocate(sz);
  • trunk/Source/WebCore/rendering/RenderObject.h

    r103056 r103243  
    266266    // Overloaded new operator.  Derived classes must override operator new
    267267    // in order to allocate out of the RenderArena.
    268     void* operator new(size_t, RenderArena*) throw();
     268    void* operator new(size_t, RenderArena*);
    269269
    270270    // Overridden to prevent the normal delete from being called.
Note: See TracChangeset for help on using the changeset viewer.