Commit 215589e0 authored by ggaren@apple.com's avatar ggaren@apple.com

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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 3d191a0f
......@@ -37,7 +37,7 @@ public:
static JSCallbackConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, JSObjectCallAsConstructorCallback callback)
{
JSCallbackConstructor* constructor = new (allocateCell<JSCallbackConstructor>(*exec->heap())) JSCallbackConstructor(globalObject, structure, classRef, callback);
JSCallbackConstructor* constructor = new (NotNull, allocateCell<JSCallbackConstructor>(*exec->heap())) JSCallbackConstructor(globalObject, structure, classRef, callback);
constructor->finishCreation(globalObject, classRef);
return constructor;
}
......
......@@ -41,7 +41,7 @@ public:
static JSCallbackFunction* create(ExecState* exec, JSGlobalObject* globalObject, JSObjectCallAsFunctionCallback callback, const Identifier& name)
{
JSCallbackFunction* function = new (allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, callback);
JSCallbackFunction* function = new (NotNull, allocateCell<JSCallbackFunction>(*exec->heap())) JSCallbackFunction(globalObject, callback);
function->finishCreation(exec->globalData(), name);
return function;
}
......
......@@ -119,10 +119,6 @@ class JSCallbackObject : public Parent {
protected:
JSCallbackObject(ExecState*, Structure*, JSClassRef, void* data);
JSCallbackObject(JSGlobalData&, JSClassRef, Structure*);
// We'd like to use the placement version of operator new defined in JSCell, but
// we can't because Parent is a template argument, so we just duplicate the same
// functionality here.
void* operator new(size_t, void* ptr) { return ptr; }
void finishCreation(ExecState*);
void finishCreation(JSGlobalData&);
......@@ -133,13 +129,13 @@ public:
static JSCallbackObject* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, JSClassRef classRef, void* data)
{
ASSERT_UNUSED(globalObject, !structure->globalObject() || structure->globalObject() == globalObject);
JSCallbackObject* callbackObject = new (allocateCell<JSCallbackObject>(*exec->heap())) JSCallbackObject(exec, structure, classRef, data);
JSCallbackObject* callbackObject = new (NotNull, allocateCell<JSCallbackObject>(*exec->heap())) JSCallbackObject(exec, structure, classRef, data);
callbackObject->finishCreation(exec);
return callbackObject;
}
static JSCallbackObject* create(JSGlobalData& globalData, JSClassRef classRef, Structure* structure)
{
JSCallbackObject* callbackObject = new (allocateCell<JSCallbackObject>(globalData.heap)) JSCallbackObject(globalData, classRef, structure);
JSCallbackObject* callbackObject = new (NotNull, allocateCell<JSCallbackObject>(globalData.heap)) JSCallbackObject(globalData, classRef, structure);
callbackObject->finishCreation(globalData);
return callbackObject;
}
......
2011-12-15 Geoffrey Garen <ggaren@apple.com>
Placement new does an unnecessary NULL check
https://bugs.webkit.org/show_bug.cgi?id=74676
Reviewed by Sam Weinig.
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.
2011-12-19 Eric Carlson <eric.carlson@apple.com>
Enable <track> for Mac build
......@@ -36,7 +36,7 @@ namespace JSC {
static DebuggerActivation* create(JSGlobalData& globalData, JSObject* object)
{
DebuggerActivation* activation = new (allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData);
DebuggerActivation* activation = new (NotNull, allocateCell<DebuggerActivation>(globalData.heap)) DebuggerActivation(globalData);
activation->finishCreation(globalData, object);
return activation;
}
......
......@@ -56,7 +56,7 @@ void HandleHeap::grow()
Node* block = m_blockStack.grow();
for (int i = m_blockStack.blockLength - 1; i >= 0; --i) {
Node* node = &block[i];
new (node) Node(this);
new (NotNull, node) Node(this);
m_freeList.push(node);
}
}
......
......@@ -158,7 +158,7 @@ inline HandleSlot HandleHeap::allocate()
grow();
Node* node = m_freeList.pop();
new (node) Node(this);
new (NotNull, node) Node(this);
m_immediateList.push(node);
return toHandle(node);
}
......
......@@ -37,12 +37,12 @@ MarkedBlock* MarkedBlock::create(Heap* heap, size_t cellSize)
PageAllocationAligned allocation = PageAllocationAligned::allocate(blockSize, blockSize, OSAllocator::JSGCHeapPages);
if (!static_cast<bool>(allocation))
CRASH();
return new (allocation.base()) MarkedBlock(allocation, heap, cellSize);
return new (NotNull, allocation.base()) MarkedBlock(allocation, heap, cellSize);
}
MarkedBlock* MarkedBlock::recycle(MarkedBlock* block, size_t cellSize)
{
return new (block) MarkedBlock(block->m_allocation, block->m_heap, cellSize);
return new (NotNull, block) MarkedBlock(block->m_allocation, block->m_heap, cellSize);
}
void MarkedBlock::destroy(MarkedBlock* block)
......
......@@ -147,7 +147,7 @@ namespace JSC {
void clear()
{
m_ref.~CodeRef();
new (&m_ref) CodeRef();
new (NotNull, &m_ref) CodeRef();
}
private:
......
......@@ -156,7 +156,7 @@ public:
static GlobalObject* create(JSGlobalData& globalData, Structure* structure, const Vector<UString>& arguments)
{
GlobalObject* object = new (allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure);
GlobalObject* object = new (NotNull, allocateCell<GlobalObject>(globalData.heap)) GlobalObject(globalData, structure);
object->finishCreation(globalData, arguments);
return object;
}
......
......@@ -87,7 +87,7 @@ namespace WTF {
template<> struct HashTraits<JSC::CallIdentifier> : GenericHashTraits<JSC::CallIdentifier> {
static void constructDeletedValue(JSC::CallIdentifier& slot)
{
new (&slot) JSC::CallIdentifier(JSC::UString(), JSC::UString(), std::numeric_limits<unsigned>::max());
new (NotNull, &slot) JSC::CallIdentifier(JSC::UString(), JSC::UString(), std::numeric_limits<unsigned>::max());
}
static bool isDeletedValue(const JSC::CallIdentifier& value)
{
......
......@@ -59,7 +59,7 @@ namespace JSC {
static Arguments* create(JSGlobalData& globalData, CallFrame* callFrame)
{
Arguments* arguments = new (allocateCell<Arguments>(globalData.heap)) Arguments(callFrame);
Arguments* arguments = new (NotNull, allocateCell<Arguments>(globalData.heap)) Arguments(callFrame);
arguments->finishCreation(callFrame);
return arguments;
}
......
......@@ -33,7 +33,7 @@ namespace JSC {
static ArrayConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ArrayPrototype* arrayPrototype)
{
ArrayConstructor* constructor = new (allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(globalObject, structure);
ArrayConstructor* constructor = new (NotNull, allocateCell<ArrayConstructor>(*exec->heap())) ArrayConstructor(globalObject, structure);
constructor->finishCreation(exec, arrayPrototype);
return constructor;
}
......
......@@ -35,7 +35,7 @@ namespace JSC {
static ArrayPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
ArrayPrototype* prototype = new (allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure);
ArrayPrototype* prototype = new (NotNull, allocateCell<ArrayPrototype>(*exec->heap())) ArrayPrototype(globalObject, structure);
prototype->finishCreation(globalObject);
return prototype;
}
......
......@@ -33,7 +33,7 @@ namespace JSC {
static BooleanConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, BooleanPrototype* booleanPrototype)
{
BooleanConstructor* constructor = new (allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(globalObject, structure);
BooleanConstructor* constructor = new (NotNull, allocateCell<BooleanConstructor>(*exec->heap())) BooleanConstructor(globalObject, structure);
constructor->finishCreation(exec, booleanPrototype);
return constructor;
}
......
......@@ -35,7 +35,7 @@ namespace JSC {
static BooleanObject* create(JSGlobalData& globalData, Structure* structure)
{
BooleanObject* boolean = new (allocateCell<BooleanObject>(globalData.heap)) BooleanObject(globalData, structure);
BooleanObject* boolean = new (NotNull, allocateCell<BooleanObject>(globalData.heap)) BooleanObject(globalData, structure);
boolean->finishCreation(globalData);
return boolean;
}
......
......@@ -31,7 +31,7 @@ namespace JSC {
static BooleanPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
BooleanPrototype* prototype = new (allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, structure);
BooleanPrototype* prototype = new (NotNull, allocateCell<BooleanPrototype>(*exec->heap())) BooleanPrototype(exec, structure);
prototype->finishCreation(exec, globalObject);
return prototype;
}
......
......@@ -33,7 +33,7 @@ namespace JSC {
static DateConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, DatePrototype* datePrototype)
{
DateConstructor* constructor = new (allocateCell<DateConstructor>(*exec->heap())) DateConstructor(globalObject, structure);
DateConstructor* constructor = new (NotNull, allocateCell<DateConstructor>(*exec->heap())) DateConstructor(globalObject, structure);
constructor->finishCreation(exec, datePrototype);
return constructor;
}
......
......@@ -42,14 +42,14 @@ namespace JSC {
static DateInstance* create(ExecState* exec, Structure* structure, double date)
{
DateInstance* instance = new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
DateInstance* instance = new (NotNull, allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
instance->finishCreation(exec->globalData(), date);
return instance;
}
static DateInstance* create(ExecState* exec, Structure* structure)
{
DateInstance* instance = new (allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
DateInstance* instance = new (NotNull, allocateCell<DateInstance>(*exec->heap())) DateInstance(exec, structure);
instance->finishCreation(exec->globalData());
return instance;
}
......
......@@ -36,7 +36,7 @@ namespace JSC {
static DatePrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
DatePrototype* prototype = new (allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, structure);
DatePrototype* prototype = new (NotNull, allocateCell<DatePrototype>(*exec->heap())) DatePrototype(exec, structure);
prototype->finishCreation(exec, globalObject);
return prototype;
}
......
......@@ -89,7 +89,7 @@ namespace JSC {
static StrictModeTypeErrorFunction* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, const UString& message)
{
StrictModeTypeErrorFunction* function = new (allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);
StrictModeTypeErrorFunction* function = new (NotNull, allocateCell<StrictModeTypeErrorFunction>(*exec->heap())) StrictModeTypeErrorFunction(globalObject, structure, message);
function->finishCreation(exec->globalData(), exec->globalData().propertyNames->emptyIdentifier);
return function;
}
......
......@@ -34,7 +34,7 @@ namespace JSC {
static ErrorConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, ErrorPrototype* errorPrototype)
{
ErrorConstructor* constructor = new (allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(globalObject, structure);
ErrorConstructor* constructor = new (NotNull, allocateCell<ErrorConstructor>(*exec->heap())) ErrorConstructor(globalObject, structure);
constructor->finishCreation(exec, errorPrototype);
return constructor;
}
......
......@@ -38,14 +38,14 @@ namespace JSC {
static ErrorInstance* create(JSGlobalData& globalData, Structure* structure, const UString& message)
{
ErrorInstance* instance = new (allocateCell<ErrorInstance>(globalData.heap)) ErrorInstance(globalData, structure);
ErrorInstance* instance = new (NotNull, allocateCell<ErrorInstance>(globalData.heap)) ErrorInstance(globalData, structure);
instance->finishCreation(globalData, message);
return instance;
}
static ErrorInstance* create(ExecState* exec, Structure* structure, JSValue message)
{
if (message.isUndefined()) {
ErrorInstance* instance = new (allocateCell<ErrorInstance>(*exec->heap())) ErrorInstance(exec->globalData(), structure);
ErrorInstance* instance = new (NotNull, allocateCell<ErrorInstance>(*exec->heap())) ErrorInstance(exec->globalData(), structure);
instance->finishCreation(exec->globalData(), UString("", 0));
return instance;
}
......
......@@ -33,7 +33,7 @@ namespace JSC {
static ErrorPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
ErrorPrototype* prototype = new (allocateCell<ErrorPrototype>(*exec->heap())) ErrorPrototype(exec, structure);
ErrorPrototype* prototype = new (NotNull, allocateCell<ErrorPrototype>(*exec->heap())) ErrorPrototype(exec, structure);
prototype->finishCreation(exec, globalObject);
return prototype;
}
......
......@@ -69,7 +69,7 @@ public:
static InterruptedExecutionError* create(JSGlobalData& globalData)
{
InterruptedExecutionError* error = new (allocateCell<InterruptedExecutionError>(globalData.heap)) InterruptedExecutionError(globalData);
InterruptedExecutionError* error = new (NotNull, allocateCell<InterruptedExecutionError>(globalData.heap)) InterruptedExecutionError(globalData);
error->finishCreation(globalData);
return error;
}
......@@ -96,7 +96,7 @@ public:
static TerminatedExecutionError* create(JSGlobalData& globalData)
{
TerminatedExecutionError* error = new (allocateCell<TerminatedExecutionError>(globalData.heap)) TerminatedExecutionError(globalData);
TerminatedExecutionError* error = new (NotNull, allocateCell<TerminatedExecutionError>(globalData.heap)) TerminatedExecutionError(globalData);
error->finishCreation(globalData);
return error;
}
......
......@@ -186,10 +186,10 @@ namespace JSC {
ASSERT(globalData.canUseJIT());
NativeExecutable* executable;
if (!callThunk) {
executable = new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
executable = new (NotNull, allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
executable->finishCreation(globalData, JITCode(), JITCode(), intrinsic);
} else {
executable = new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
executable = new (NotNull, allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
executable->finishCreation(globalData, JITCode::HostFunction(callThunk), JITCode::HostFunction(constructThunk), intrinsic);
}
globalData.heap.addFinalizer(executable, &finalize);
......@@ -201,7 +201,7 @@ namespace JSC {
static NativeExecutable* create(JSGlobalData& globalData, NativeFunction function, NativeFunction constructor)
{
ASSERT(!globalData.canUseJIT());
NativeExecutable* executable = new (allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
NativeExecutable* executable = new (NotNull, allocateCell<NativeExecutable>(globalData.heap)) NativeExecutable(globalData, function, constructor);
executable->finishCreation(globalData);
globalData.heap.addFinalizer(executable, &finalize);
return executable;
......@@ -348,7 +348,7 @@ namespace JSC {
static EvalExecutable* create(ExecState* exec, const SourceCode& source, bool isInStrictContext)
{
EvalExecutable* executable = new (allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext);
EvalExecutable* executable = new (NotNull, allocateCell<EvalExecutable>(*exec->heap())) EvalExecutable(exec, source, isInStrictContext);
executable->finishCreation(exec->globalData());
exec->globalData().heap.addFinalizer(executable, &finalize);
return executable;
......@@ -389,7 +389,7 @@ namespace JSC {
static ProgramExecutable* create(ExecState* exec, const SourceCode& source)
{
ProgramExecutable* executable = new (allocateCell<ProgramExecutable>(*exec->heap())) ProgramExecutable(exec, source);
ProgramExecutable* executable = new (NotNull, allocateCell<ProgramExecutable>(*exec->heap())) ProgramExecutable(exec, source);
executable->finishCreation(exec->globalData());
exec->globalData().heap.addFinalizer(executable, &finalize);
return executable;
......@@ -458,7 +458,7 @@ namespace JSC {
static FunctionExecutable* create(ExecState* exec, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
{
FunctionExecutable* executable = new (allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext);
FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(*exec->heap())) FunctionExecutable(exec, name, source, forceUsesArguments, parameters, isInStrictContext);
executable->finishCreation(exec->globalData(), name, firstLine, lastLine);
exec->globalData().heap.addFinalizer(executable, &finalize);
return executable;
......@@ -466,7 +466,7 @@ namespace JSC {
static FunctionExecutable* create(JSGlobalData& globalData, const Identifier& name, const SourceCode& source, bool forceUsesArguments, FunctionParameters* parameters, bool isInStrictContext, int firstLine, int lastLine)
{
FunctionExecutable* executable = new (allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext);
FunctionExecutable* executable = new (NotNull, allocateCell<FunctionExecutable>(globalData.heap)) FunctionExecutable(globalData, name, source, forceUsesArguments, parameters, isInStrictContext);
executable->finishCreation(globalData, name, firstLine, lastLine);
globalData.heap.addFinalizer(executable, &finalize);
return executable;
......
......@@ -37,7 +37,7 @@ namespace JSC {
static FunctionConstructor* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure, FunctionPrototype* functionPrototype)
{
FunctionConstructor* constructor = new (allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(globalObject, structure);
FunctionConstructor* constructor = new (NotNull, allocateCell<FunctionConstructor>(*exec->heap())) FunctionConstructor(globalObject, structure);
constructor->finishCreation(exec, functionPrototype);
return constructor;
}
......
......@@ -31,7 +31,7 @@ namespace JSC {
static FunctionPrototype* create(ExecState* exec, JSGlobalObject* globalObject, Structure* structure)
{
FunctionPrototype* prototype = new (allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(globalObject, structure);
FunctionPrototype* prototype = new (NotNull, allocateCell<FunctionPrototype>(*exec->heap())) FunctionPrototype(globalObject, structure);
prototype->finishCreation(exec, exec->propertyNames().nullIdentifier);
return prototype;
}
......
......@@ -48,7 +48,7 @@ namespace JSC {
static GetterSetter* create(ExecState* exec)
{
GetterSetter* getterSetter = new (allocateCell<GetterSetter>(*exec->heap())) GetterSetter(exec);
GetterSetter* getterSetter = new (NotNull, allocateCell<GetterSetter>(*exec->heap())) GetterSetter(exec);
getterSetter->finishCreation(exec->globalData());
return getterSetter;
}
......
......@@ -46,7 +46,7 @@ namespace JSC {
static JSAPIValueWrapper* create(ExecState* exec, JSValue value)
{
JSAPIValueWrapper* wrapper = new (allocateCell<JSAPIValueWrapper>(*exec->heap())) JSAPIValueWrapper(exec);
JSAPIValueWrapper* wrapper = new (NotNull, allocateCell<JSAPIValueWrapper>(*exec->heap())) JSAPIValueWrapper(exec);
wrapper->finishCreation(exec, value);
return wrapper;
}
......
......@@ -48,7 +48,7 @@ namespace JSC {
static JSActivation* create(JSGlobalData& globalData, CallFrame* callFrame, FunctionExecutable* funcExec)
{
JSActivation* activation = new (allocateCell<JSActivation>(globalData.heap)) JSActivation(callFrame, funcExec);
JSActivation* activation = new (NotNull, allocateCell<JSActivation>(globalData.heap)) JSActivation(callFrame, funcExec);
activation->finishCreation(callFrame);
return activation;